Back

[SOLVED] Is it possible to stitch GQL queries for Account or Team objects?

  • 0
  • Databases
  • Tools
jordorama
7 Mar, 2023, 22:12

Im trying to query some data that belongs to each team. So essentially the query is on the team.$id

Instead of manually providing all the IDs in two separate requests I want to stitch them all together.

TypeScript
query GetTeamsAndRelatedDocuments {
    teamsList {
        total
        teams {
            _id
            name
            teamDocuments: databasesListDocuments(
                databaseId: "<databaseId>",
                collectionId: _id
            ) {
                total
                documents {
                    _id
                    _collectionId
                    _databaseId
                }
            }
        }
    }
}

Is this possible in Appwrite's implementation?

Cannot query field \"databasesListDocuments\" on type \"Team\". Im guessing the resolvers don't exist

TL;DR
The user is asking if it is possible to stitch GraphQL queries for Account or Team objects in Appwrite. Another user suggests that although you can't nest requests, you can get the list of teams and then issue multiple databasesListDocuments using 1 GraphQL request. The user provides an example query. The error message "Cannot query field 'databasesListDocuments' on type 'Team'" is mentioned, implying that the resolvers don't exist. Solution: It is not currently possible to stitch GQL queries for Account or Team objects in Appwrite as the resolvers for 'databasesListDocuments' on type 'Team' do not
Drake
7 Mar, 2023, 22:14

Although you can't nest requests, you can get the list of teams and then issue multiple databasesListDocuments using 1 graphql request

jordorama
7 Mar, 2023, 22:29

Thanks. I'll just do that then. It would be nice to able and nest these queries but idk how complex that is from the Appwrite side.

Drake
7 Mar, 2023, 23:07

[SOLVED] Is it possible to stitch GQL queries for Account or Team objects?

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