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
- No server error on selfhosted appwrite
Please help me, my clients is ask what happen on their data? How can i make it up again?
- Upgrading selfhost version?
It is okay to upgrade version to higher one, of my current version is 1.7.4 to 1.8.1. Is that safe to do cause my clients already have data on that? Also is a...
- Streamlit UI and local DB
I want to use Appwrite for automation, like run watchdog service every morning 3 am. Anyone got suggestions, already explored github and documentation no luck. ...