-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples for using this with the Serverless framework? #24
Comments
Serverless framework: https://github.com/serverless/serverless It tied to Express only for batching queries. It contains simple express middleware that accepts array of queries in one http request So if your serverless server side will accept |
Thanks, with that information I was able to write a handler for batched queries. |
Ok. So I should you provide additional information. Client side (react-relay-network-layer)This is a place in code where is constructed batch request https://github.com/nodkz/react-relay-network-layer/blob/master/src/relay/queriesBatch.js#L21-L27 And where is read response (in the same file) https://github.com/nodkz/react-relay-network-layer/blob/master/src/relay/queriesBatch.js#L31-L39 Standard single request {
query:
variables:
} Batched request [{
id: // <--- added relay request ID
query:
variables:
},
{
id: // <--- another request ID provided by Relay
query:
variables:
},
] Server side (your handler)Standard single response for details can see spec {
data: {}, // by spec should be undefined if exists `errors`
errors: {}, // may be undefined if no error
extensions: {} | undefined, // some [additional info](https://github.com/graphql/express-graphql#providing-extensions), eg. performance
} Batched response [
{
id: // pass back id obtained from batched request item (Relay request id)
payload: { // standard graphql response
data: {},
errors: {},
extensions: {},
},
},
] I pass Relay request |
The example given looks like it's tied to Express.
The text was updated successfully, but these errors were encountered: