Getting an error ERROR: could not validate document '%!s()' for read
MongoDB Forum » GraphQL
by Tam_Nguyen1
1M ago
Hi, I’m getting the above error when calling a graphql customer resolver endpoint. It works fine when I’m calling the function in the mongodb cloud Function Editor or GraphQL. But when I call it from the C# GraphQL.Client.Http library it shows that error in my mongo logs. I’ve seen this error before but usually it has an id to see which doc is not conforming to the schema. I ran Run Validation in the schema tab on all my tables and nothing showed up. Thanks 2 posts - 1 participant Read full topic ..read more
Visit website
GrpahQL Api endpoints for databases within the same cluster
MongoDB Forum » GraphQL
by Monica_Stoica
3M ago
Hi, Is there any way to create different GraphQL API endpoints for databases within the same cluster? Currently, the generated URL only connects to the cluster and, in there, we can do a query to select the correct database. But that seems like an extra step and would like to be able to separate the API calls per DB with their own URL & authKey. Thank you in advance, Monica 1 post - 1 participant Read full topic ..read more
Visit website
Is it possible to Custom Resolver extend/use existing schema for payload type?
MongoDB Forum » GraphQL
by Joseph_Wilson3
3M ago
As per the GraphQL schema generation, I have some existing schemas that I was wondering if it would be possible to embed as part of the Payload Type for a Custom Resolver. The use case is that I’m looking to do paging, and would like to also include some metadata like the totalcount. I have used the Existing Type [List], which is really nice as in the GraphQL API it allows you to specify the fields you require. Lets just say the Existing Type [List] is a collection of Fruit. If someone could help with this that would be amazing, this is one approach I had but not sure of the implementation det ..read more
Visit website
Data Access Rules - user and role in array
MongoDB Forum » GraphQL
by Abhishek_Mishra7
6M ago
Hi, I have a documents in this schema { "name": "Some Org", "team": [ { "email": "useremail1@company.com", "role": "admin" }, { "email": "useremail2@company.com", "role": "viewer" } ] }, { "name": "Some Org 2", "team": [ { "email": "useremail1@company.com", "role": "viewer" } ] } I want to let the role evaluate to the respective role being viewer or admin for the caller’s email (%%user.data.email) to allow search and insert operations respectively. Unable to understand how to reach to that point. For example ..read more
Visit website
OR condition in graphql query under variable section
MongoDB Forum » GraphQL
by Nikhil_Chawla
6M ago
Hello Team, How do you pass OR condition in graphql query under variable? For e.g. If graphql query needs to return all schema fields for a document where expiry date is either empty or for future. Currently if i pass OR operator in query, it gives me an error that OR is unknown field in schema. Thanks Nikhil 1 post - 1 participant Read full topic ..read more
Visit website
MongoDB graphql not supporting aliases in query
MongoDB Forum » GraphQL
by Nikhil_Chawla
6M ago
Hello team, I tried to create an alias in graphql query. Query output gave the parameter back in alias form but values were always null. Is it a known issue? Thanks Nikhil Chawla 1 post - 1 participant Read full topic ..read more
Visit website
GraphQL API not supporting double embedded objects in schema
MongoDB Forum » GraphQL
by Olivier_Wouters
7M ago
I’m working with App Services and Realm. I’m defining my schema in Realm (typescript) then sync it to App Services. I noticed that when I have the same double embedded object in two collection schemas and I query those two related collections, the further embedded property is null. Sometimes you refresh the query and the value appears, some other times it disappears. Work around: remove the titles from the embedded objects. Something you can’t do from Realm (or I don’t know how ?) but then you graphQL schema is much more complex and prevents reuse (fragments, …) The graphQL query (counters.cat ..read more
Visit website
Filter collections by user collection attribute
MongoDB Forum » GraphQL
by RG5
8M ago
Hi everyone, I am currently exploring the features offered by MongoDB services, in ‘App Services.’ My goal is to understand how these services can be used to meet various needs. In the context of my experiments, I am facing a specific case: I want to extract specific values from my data collections based on a custom attribute associated with users who authenticate via an access token. Specifically, I have multiple data collections that contain an attribute called ‘country,’ and I want users who query my GraphQL service to retrieve only items from these collections that match their own ‘country ..read more
Visit website
Mongodb $lookup in pipeline of aggregate function is slow in Atlas Function
MongoDB Forum » GraphQL
by Narayan_Maharjan
8M ago
I implemented a custom graphql resolver which does a series of pipelines inside aggregate function. When I execute it , it takes about 20 seconds. I thought it was because of deployment of regional vs global but I changed it and it is still the same. I tried running same thing in mongosh which gave me result pretty fast with the instance of $cursor. Then I changed my pipelines to only include search and match condition which works pretty fast. So I thought its because of the sorting and $lookup. I tried to keep only one and try which made the query slower. Finally I thought may be it is becaus ..read more
Visit website
Help needed to add GraphQL API keys in LangChain script
MongoDB Forum » GraphQL
by Rasmus_Gregersen
9M ago
Hi guys, I wanna chat with the data in MongoDB I have succeeded with data that is not stored in MongoDB. Does anyone have experience in working with LangChain? and connecting OpenAI/ChatGPT to MongoDB with GraphQL API keys? I have issues connecting to the database because I can’t find a way to add a header/apikey correctly so I don’t get an error 401 “401 Client Error: Unauthorized for url:…” I have tested with a simple connect with requests, and i worked fine. requests.post(url, json={‘query’: query}, headers=headers) LangChain with GQL doc: python.langchain.com GraphQL tool | ?️? Langchain ..read more
Visit website

Follow MongoDB Forum » GraphQL on FeedSpot

Continue with Google
Continue with Apple
OR