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
Our graphql client uses apollo-link-batch-http to send requests like that, with up to 10 operations combined and sent as an array of maps.
Running lacinia-pedestal, individually sent operations work, but when our existing client sends batched operations, lacinia returns an error, saying "Request content type must be application/graphql or application/json" (which isn't even accurate - the request has a content-type of application/json - but it's the default case in com.walmartlabs.lacinia.pedestal/query-not-found-error).
The lacinia-pedestal docs do not appear to mention support for this, and I think com.walmartlabs.lacinia.pedestal/extra-query only works with a top-level operation map.
What's the best way to support these types of requests using lacinia-pedestal?
I thought about writing new interceptors, but every single one seems really set on adding keys to the context/request maps assuming that there is only one operation.
The text was updated successfully, but these errors were encountered:
a613
changed the title
How to support batched operations like in apollo?
How to support batched operations like in apollo-link-batch-http?
Aug 9, 2018
a613
changed the title
How to support batched operations like in apollo-link-batch-http?
How to support batched operations like in Apollo?
Aug 9, 2018
We don't currently have any plans to support batched operations. In your above example, it would be quite reasonable to execute it as a single query document; if your resolvers support it, you'll even see the queries executing in parallel.
It might be possible to hack this using a Pedestal interceptor.
We can discuss this further on the #graphql slack channel.
Apollo server supports batched operations in a single POST request:
[{ query: '{ testString }' }, { query: 'query q2{ test(who: "you" ) }' }]
Our graphql client uses apollo-link-batch-http to send requests like that, with up to 10 operations combined and sent as an array of maps.
Running lacinia-pedestal, individually sent operations work, but when our existing client sends batched operations, lacinia returns an error, saying "Request content type must be application/graphql or application/json" (which isn't even accurate - the request has a content-type of
application/json
- but it's the default case incom.walmartlabs.lacinia.pedestal/query-not-found-error
).I can't tell if it's the same feature described in graphql/graphql-spec#375.
The lacinia-pedestal docs do not appear to mention support for this, and I think
com.walmartlabs.lacinia.pedestal/extra-query
only works with a top-level operation map.What's the best way to support these types of requests using lacinia-pedestal?
I thought about writing new interceptors, but every single one seems really set on adding keys to the context/request maps assuming that there is only one operation.
The text was updated successfully, but these errors were encountered: