Back

[SOLVED] Invalid Query Error in 12.0.1

  • 1
  • Databases
Vanshaj Kataria
14 Apr, 2024, 18:12

earlier i was using 1.4.x, when i updated the dependecies to 1.5.x, it gave me this error:

[Log] Error in appwriteGetHomeListData => AppwriteException: general_query_invalid, Invalid query: {"method":"equal","attribute":"userId","values":["65a582ccabd37ea03d4e"]} (400) (main.dart.js, line 34466)

TL;DR
Developers were facing an invalid query error in version 12.0.1 of the appwrite SDK. The solution was to use version 11.x for Appwrite Cloud still on 1.4.13 and version 12.x for localhost running version 1.5.4. To resolve the issue, they needed to update their dependencies accordingly.
Vanshaj Kataria
14 Apr, 2024, 18:12

okay thanks for the help

darShan
14 Apr, 2024, 18:13

there's some confusion here maybe. what was 1.4.x and how did you update it to 1.5.x? You cannot update the Appwrite Cloud instance.

Vanshaj Kataria
14 Apr, 2024, 18:14

i updated the dependecy

darShan
14 Apr, 2024, 18:14

your Client endpoint is https://cloud.appwrite.io/v1, right?

Vanshaj Kataria
14 Apr, 2024, 18:15

no it's a custom endpoint

darShan
14 Apr, 2024, 18:15

what version of appwrite is it running then?

Vanshaj Kataria
14 Apr, 2024, 18:15

12.0.1 or 1.5.x

darShan
14 Apr, 2024, 18:16

appwrite version shown in the console at the footer. 1.5.4?

darShan
14 Apr, 2024, 18:17

12.0.1 is the SDK.

Vanshaj Kataria
14 Apr, 2024, 18:17

okay understood

Vanshaj Kataria
14 Apr, 2024, 18:17

then it must be the SDK

Vanshaj Kataria
14 Apr, 2024, 18:27

on the cloud it's 1.4.13

Vanshaj Kataria
14 Apr, 2024, 18:27

but i tried on self-hosted which is on 1.5.4

Vanshaj Kataria
14 Apr, 2024, 18:28

getting error: [Log] Error in appwriteGetHomeListData => AppwriteException: , ClientException: XMLHttpRequest error., uri=http://localhost/v1/databases/65d893aeb9f8651819e4/collections/65d9e063f1f3a282d0b9/documents?queries%5B%5D=%7B%22method%22%3A%22equal%22%2C%22attribute%22%3A%22userId%22%2C%22values%22%3A%5B%2265a582ccabd37ea03d4e%22%5D%7D# (0) (main.dart.js, line 34466)

darShan
14 Apr, 2024, 18:29

gotcha. seems like you are connecting to multiple instances, maybe testing? so while Cloud is still on 1.4.13, you need to use the 11.x version. On localhost, where the version is 1.5.4, use 12.x version of the sdk.

Vanshaj Kataria
14 Apr, 2024, 18:30

okay understood the mistake i was doing

Vanshaj Kataria
14 Apr, 2024, 18:30

now i have switched to localhost

Vanshaj Kataria
14 Apr, 2024, 18:30

getting this error

darShan
14 Apr, 2024, 18:31

make sure to clear pub cache, reinstall the correct sdk.

Vanshaj Kataria
14 Apr, 2024, 18:31

okay will do that

Vanshaj Kataria
14 Apr, 2024, 18:34

Thanks for the help, really appreciate it will let you know if something else comes up.

darShan
14 Apr, 2024, 18:35

no worries. please mark this thread as [SOLVED] once your issue resolves.

Feel free to ping here otherwise create a new thread if you face any other issues!

Happy Appwriting :appwritecheers:.

Vanshaj Kataria
14 Apr, 2024, 18:36

Sure Thanks

Vanshaj Kataria
14 Apr, 2024, 18:47

[SOLVED] Invalid Query Error in 12.0.1

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