Does Directus GraphQL API support batch requests?

While porting my site to Directus, I found that my frontend that used graphql-request was continually failing to do batch requests. When splitting all the GQL requests out into seperate requests with a Promise.all() they all complete successfully, so it’s not the fault of the queries.

Just to check, so I can go in and debug more, does the Directus GQL API support batch requests?

Do you have an example GraphQL query that your mentioned library will send to the API? Batching itself is not a GraphQL native feature so it depends on the query your frontend library sends

1 Answer

1

I have tested with Apollo that can generate batch requests, and Directus responded with errors. So it is a no for me, but perhaps with a middleware you could extend Directus features.

Apollo's flavor of GraphQL is their own spec on top of GraphQL. Directus does not support Apollo GraphQL at this time