Query.select ["attribute name.*"] doesn't return the attribute if it's a relationship
- 0
- Databases
- Flutter
My document have a relationship "source"
If I query without doing a select, source is present in the attributes.
But if I do: Query.select( ["title", ..., "source.* ", ...systemAttributes]);
Based on this https://github.com/appwrite/appwrite/issues/5657, it should work.
But in my case, every attributes I include are present except the relationship one which is "source".
If I do : Query.select(["source.* ", ...systemAttributes]):
I have documents like this:
{$id: 6609f1fa3031203835fb, $createdAt: 2024-03-31T23:30:03.205+00:00, $updatedAt: 2024-03-31T23:30:03.205+00:00, $permissions: []}
Basically, source is never included.
But I know that at least the server recognize the request since doing it wrongly throw an error instead.
Query.select(["source", ...systemAttributes]):
Any idea?
No queries work on relationships
🧐 I'm confused, why would appwrite Engineering Lead suggest a solution that doesn't actually work?
I mean, it's not even a suggestion, it's presented as though it is the actual solution to this specific isue then the github issue was marked as completed without any mention of this not actually working or being something that should be present in the future, not the present day.
Maybe someone from the core team will have to come and check this out. It could be a bug that that doesn’t work. I’m not entirely sure.
I can throw together a POC sometime tomorrow to verify I get the same behavior
Let me know if I'm missing something, but here is my POC, and it looks like it's working.
Here is my stackblitz. It's in the page test.svelte
Sorry for the late response, I am on vacation.
Can you possibly try this POC again on with the flutter appwrite package version 11.0.1? Or I can post my own barebone code on github. I tried again with the most barebone implementation client side (but still the same project server side), but I'm still getting the same issue:
With this query : Query.select(["source.*", ...systemAttributes]);
I have this this result :
{$id: 65df580ee8de480290fd, $createdAt: 2024-02-28T15:58:06.956+00:00, $updatedAt: 2024-02-28T15:58:06.956+00:00, $permissions: []}
The source is still nowhere to be seen, but I know at least that the server do recognize the query since if I mispell "source", for example in this query : Query.select(["fakeSource.*", ...systemAttributes]);
I have this error :
AppwriteException: general_query_invalid, Invalid query: Attribute not found in schema: fakeSource (400)#0
Also, the reason why I'm not directly sharing the code is because I'm on a very limited network currently but if it's needed to help resolve this issue, I will do it.
What I really don't know is wether the appwrite package is tampering with the server response somehow or is the server just not giving the appropriate response back depending on the client that's requesting (maybe this specific feature is disabled for this specific appwrite version I don't know, but I think that's odd and probably not the case given the date of the github posts and responses.)
@paritodev is this a related PR that could fix your issue? I think this involves making querying relational data work, as well as fixing a few other issues with relationships https://github.com/utopia-php/database/pull/400
Recommended threads
- DB connection | Got timeout reading comm...
When looking at the logs of `appwrite-mariadb` I'm seeing a lot of: ``` 2026-04-09 7:37:28 10 [Warning] Aborted connection 10 to db: 'appwrite' user: 'appwrit...
- Invalid document structure: Unknown attr...
Environment: Dart version: 3.5.1 dart_appwrite: 13.0.0 I’ve already created the database structure using a Dart function. I can create data records using cloud...
- android platform invaild origina
It happened today suddenly. Our app says invalid origin. And appwrite cloud says every time we tried to add the app to it: "param platformId" is not optional.