Replies: 3 comments 14 replies
-
|
Is there any plan to implement this feature? |
Beta Was this translation helpful? Give feedback.
-
|
Hi @andris-sevcenko besides the idea of persisted queries, would something like "RESTified GraphQL Endpoints" be easier to implement? Hasura GraphQL Engine is using this idea: https://hasura.io/docs/latest/api-reference/restified/ |
Beta Was this translation helpful? Give feedback.
-
|
@brandonkelly are there any plans to integrate this? maybe for craft 6? For bigger projects we see GraphQL being the biggest issue in regards to performance when the IA is using a lot of relationship fields and the content gets updated regularly. any update for a stronger/better caching/performance for graphql would highly appreciated |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
The concept of persisted queries in GraphQL is essentially that you keep track of your queries in an allow-list with queries mapped to IDs. When executing the query, instead of passing the entire thing, you just pass a
queryId. The GraphQL server is then responsible for looking up that query and ensuring it's allowed. Generally, the process of generating the allow list is automated using a frontend build tool to extract queries and generate the allow-list for you, replacing queries with their IDs in your compiled code.The feature already exists on the webonyx/graphql-php server via the
persistentQueryLoaderconfig; however, it would need to be implemented in Craft's implementation.Benefits
Related Reading
Relay Persisted Queries Reference: https://relay.dev/docs/en/persisted-queries.html
Apollo Server Reference: https://www.apollographql.com/docs/apollo-server/performance/apq/
Example Webpack Loader: https://github.com/leoasis/graphql-persisted-document-loader
Beta Was this translation helpful? Give feedback.
All reactions