Open shortcircuit3 opened 4 years ago
Interesting; at the moment that feature is not supported.
To get it working, we would need to either need to build in support for it (config option, hashing the query, multiple fetch requests per operation), or allow configuring the fetcher for custom implementations.
The new graphql-react
v13 API has composable React hooks for the separate concerns of reading from the cache vs loading it.
A custom hook could be used as an alternative to useLoadGraphQL
, that does the persisted queries stuff instead of a single, normal fetch request. Here is the source for inspiration:
If you know for sure the query is persisted and you don't need to make fallback fetch requests, you could just have some sort of hook/function that creates appropriate fetch
options for a persisted query to pass into the normal useLoadGraphQL
hook.
I’ll be using a go library for the server and I was not sure if this library supported automatic persisted queries
If so, how do I use this functionality?