Skip to content
Back

graphql queries not working anymore. json_decode

  • 0
  • GraphQL
Malte
18 Mar, 2024, 21:53

Hey, i used graphql in appwrite 1.4.9 with this graphql query (It worked back then):

query { databasesListDocuments( databaseId: "myId", collectionId: "myId", queries: ["equal('correct', [true])"] ) { total, documents { _createdAt } } }

In Appwrite 1.5.3 the "queries" part throws an "Invalid query" exception in json_decode of the utopia-php: Query.php (https://github.com/utopia-php/database/blob/main/src/Database/Query.php)

What do I need to change? I tried several different variants of the "queries" parameter

TL;DR
GraphQL queries in Appwrite 1.5 now use the new `or` and `and` operators. Update your query to include these operators. Change your query from: ``` queries: ["equal('correct', [true])"] ``` to: ``` queries: ["equal('correct', true)"] ```
D5
18 Mar, 2024, 21:57

Queries formatting in 1.5 changed as now they have the new or and and operators

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more