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
- is `account.get()` safe to be used in th...
I want to user's `id` for authentication. However, a while ago I was told in this server not to use `account.get()` and instead add user preferences for that us...
- Usage of the new Client() and dealing wi...
Hey guys, just a quick one - we had some web traffic the other day and it ended up bombing out - To put in perspective of how the app works, we have a Nuxt Ap...
- CORS errors in Obsidian custom plugin
Hi, anyone here familiar with obsidian community plugins? In short: it's a local first note app which supports writing your own add-ons / plugin But I keep get...