
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
- Encountering More factors are required w...
I am encoutering the more factors error even though I am providing proper mfa code in the workflow. The following happens: 1) User provides email adress 2) Use...
- AppwriteException: Missing required para...
I'm having a problem accessing my users collection to list all my users. I was having trouble creating users but it has been resolved. I'm using react/nodejs on...
- URL attribute in "processing" state
Good day everyone! I just started learning React/Vite. In my current database right now I have these 4 attributes, and the URL attributes seems to still be in ...
