Skip to content
Back

Two-deep relationships only expand on the first document in listDocuments

  • 0
  • Databases
  • Flutter
Javier Medina
27 Aug, 2025, 18:03

After the latest release, I noticed that two-deep relationships only expand correctly in the first document returned by listDocuments. • On the first document, all attributes are included (e.g. company and company.subscription). • On the second document and beyond, the two-deep relationships (company.subscription) only return the ID, not the full object.

This breaks consistency and makes it impossible to rely on expanded data for multiple documents.

Steps to Reproduce 1. Create a collection with a relationship (e.g. company → subscription). 2. Use listDocuments in Flutter SDK with a simple filter (e.g. Query.equal(...)). 3. Include a query like:

Query.select(['', 'company.', 'company.subscription.*'])

TypeScript
4.    Observe the response:
First document: company and company.subscription return full objects.
Second document: company.subscription only returns the ID.

Expected Behavior

All documents in the response should expand two-deep relationships consistently, not just the first one.

Actual Behavior

Only the first document expands correctly. Subsequent documents return only IDs for the nested (two-deep) relationships.

Environment • Appwrite version: 15.0.0 • SDK: Flutter 3.7.2 • Method: listDocuments • Query: only Query.equal(...)

TL;DR
Developers found that two-deep relationships only fully expand in the first document when using listDocuments in Flutter SDK. After updating to 1.8.x, this issue arose. To reproduce, create a collection with a relationship, use listDocuments with a filter, and observe that only the first document expands correctly. A solution may involve updating the SDK to be compatible with the current version.
Steven
27 Aug, 2025, 18:14

FYI, it's best to wrap code in backticks to format a bit nicer. You can use 1 backtick for inline code (https://www.markdownguide.org/basic-syntax/#code) and 3 backticks for multiline code (https://www.markdownguide.org/extended-syntax/#syntax-highlighting).

Steven
27 Aug, 2025, 18:15

your sdk is too old. It was meant for 1.6.x. We're on 1.8.x now

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