-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
document how to use persisted queries #37
Comments
Currently you'd have a hard time setting up persisted queries because AST parsing is run on the subscribe payload query before the I will lift this limitation and then you should be able to request something like this: {
"id": "unique-transport-id",
"type": "subscribe",
"payload": {
"query": "persisted-query-id",
"variables": { "hey": "there" }
}
} Find the persisted query in |
Could we implement a handler that is run before that e.g. onOperation? |
Good idea! We should offer a handler like that. However, The current |
🎉 This issue has been resolved in version 1.9.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Quick heads up, @n1ru4l, This means that you now can pass along the |
Story
I want to be able to only send an
id
instead of a full GraphQL document to the server and then read the actual GraphQL document from a hash table (maybe even asynchronous).Edit: #36 showed that this is already possible. It just needs to be documented.
In my Socket.io GraphQL layer I choose to omit passing a context, schema, execute, subscribe etc parameters on a server factory level, but instead choose that agetParameter
function must be passed to the server factory. That function is invoked for each GraphQL operation executed with the socket and the sent payload. The user can then decide to map the provided GraphQL Payload to anything else and providing a different context/schema/execute/subscribe based on that.It has the following type signatureWhich then allows doing stuff like this:
(This design could also address #36 as the getParameter function could throw an error or return a rejected Promise etc).graphql-transport-ws
might get some inspiration from this.The text was updated successfully, but these errors were encountered: