Hi hope you doing well !
I cant seam to figure how to use environments variables.
const response = await graphql.query({
query: `query {
databasesGetDocument(
databaseId: "social"
collectionId: "cards"
documentId: $documentId
) {
data
_id
_collectionId
_databaseId
_createdAt
_updatedAt
_permissions
}
}`,
variables: {
documentId: params.cardId,
},
});
Thi give me the following GraphQl error :
Variable "$documentId" is not defined.
params.cardId is correctly set
can you see this once and let me know if this helps? https://appwrite.io/docs/graphql#sdk-usage
Thanks, I already saw it. But i dont see my mistake :/
You need to add GetDocument($documentId: String)
const response = await graphql.query({
query: `query GetDocument($documentId: String!) {
databasesGetDocument(
databaseId: "social"
collectionId: "cards"
documentId: $documentId
) {
data
_id
_collectionId
_databaseId
_createdAt
_updatedAt
_permissions
}
}`,
variables: {
documentId: params.cardId,
},
});```
Can you try it once @Luky ?
I ended by not using qraphQl i moved to it trying to do join like queries :/
But this doesn't seem possible
Thanks for your help !
Recommended threads
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...
- apple exchange code to token
hello guys, im new here 🙂 I have created a project and enabled apple oauth, filled all data (client id, key id, p8 file itself etc). I generate oauth code form...
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...