You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const db = new Databases(client);
const response = await db.listDocuments(
DB_ID,
COLECTION_PRACTICES,
Query.select(['title', 'description', 'intro', 'exercises']), // here title, description, intro are strings; exercises is relationship
);
return response.documents;
👍 Expected behavior
It should correctly allow getting exercises relationship object plus allow querying filtered relationship fields like exercises.title, etc.
👎 Actual Behavior
The code returns an error I am logging:
[Error: Failed to fetch practices. AppwriteException: Invalid queries: Value must a valid array and Value must be a valid string and at least 1 chars and no longer than 4096 chars]
Both skipping the exercises value or removing Query.select() works correctly and returns full objects.
🎲 Appwrite version
Version 1.3.x
💻 Operating system
MacOS
🧱 Your Environment
Appwrite 1.3.x version, using through Web SDK on React Native
👀 Have you spent some time to check if this issue has been raised before?
Hey @asjustis, the issue here is that the queries need to be an array, you can fix it like this:
constresponse=awaitdb.listDocuments(DB_ID,COLECTION_PRACTICES,[Query.select(['title','description','intro','exercises.*'])],// here title, description, intro are strings; exercises is relationship);
Note the exercises.*, this is how you select all attributes of a relationship
👟 Reproduction steps
👍 Expected behavior
It should correctly allow getting
exercises
relationship object plus allow querying filtered relationship fields likeexercises.title
, etc.👎 Actual Behavior
The code returns an error I am logging:
[Error: Failed to fetch practices. AppwriteException: Invalid queries: Value must a valid array and Value must be a valid string and at least 1 chars and no longer than 4096 chars]
Both skipping the
exercises
value or removingQuery.select()
works correctly and returns full objects.🎲 Appwrite version
Version 1.3.x
💻 Operating system
MacOS
🧱 Your Environment
Appwrite 1.3.x version, using through Web SDK on React Native
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: