This could help with performance and maybe security.
Thanks for the suggestion :slightly_smiling_face:
as a example here is how scaphold does it
+1 for the suggestion for using persistgraphql (like Schd)
Apollo blog for reference: https://dev-blog.apollodata.com/persisted-graphql-queries-with-apollo-client-119fd7e6bba5
There are two ways to expose this functionality:
persistgraphql to generate a mapping file that can be added to the Graphcool project definitionTo me the two biggest benefits of persisted queries are:
Allowing persistent queries would also help teams where the backend team focus on creating specific graphql query endpoints and the frontend team just query those without having them to recreate the queries each time.
Is this still being worked on? Does the persistgraphql tool works with graph.cool?
Sorry, but I have to say this: I believe persisted queries are a huge anti-pattern, as they basically turn your flexible GraphQL api into an old REST-like api, by defining the queries on the server, and just sending over a query id or name. I strongly dislike the entire concept.
Persisted queries will be possible using the new GraphQL gateway pattern. (There's an open issue to add an example for persisted queries.)
@kbrandwijk it's just a way to set up business logic, so you don't have to tell the different teams to create the query over and over again when you can just do it once, test it once and be done with it.
@kbrandwijk
Dev mode. The GQL API is completely open. The front end dev creates the queries they needs in the dev environment.
Once the app version/feature is finished, the queries are considered finalized and the API is locked. At that point, the queries are persisted and the app is moved to production, where the production GQL API looks up the persisted queries.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.
Most helpful comment
Allowing persistent queries would also help teams where the backend team focus on creating specific graphql query endpoints and the frontend team just query those without having them to recreate the queries each time.
Is this still being worked on? Does the
persistgraphqltool works with graph.cool?