Does GraphQL-SPQR has support for PersistedQueries or not, if not what's the suggested way of handling persisted queries in SPQR.
Asked
Active
Viewed 299 times
1 Answers
0
I presume you're referring to SPQR Spring Starter here. It currently does not have this feature built-in. I believe only Apollo Engine (Link?) does. But you should be able to use it with any GraphQL server.
A post from Apollo blog says:
Automatic persisted queries — a built-in feature when using Apollo Link and Engine, works with any client or server
So you could have your SPQR-based server behind Apollo Engine, and get this and other features it offers.
I think you could also implement this specific feature yourself, relatively easily.
As of v0.0.4 of SPQR Spring Starter you can replace the GraphQLServletExecutor
(or GraphQLReactiveExecutor
if you're using WebFlux, or GraphQLWebSocketExecutor
if you're using subscriptions):
@Bean
public GraphQLServletExecutor graphQLExecutor(ServletContextFactory contextFactory) {
return new CustomExecutorThatPersistsQueries();
}

kaqqao
- 12,984
- 10
- 64
- 118
-
Hi @kaqqao, thank your for you reply. Yes I was referring to the SPQR spring boot starter project. I was looking for a endpoint that can intercept the persisted query request and get the query for given persisted query id and make the `GraphQLRequest` along with the variables and execute the request using `GraphQL` and return the result. Let me know if it make sense to share a code snippet to explains what I am talking abont. – user2224632 Jan 17 '19 at 22:32
-
@user2224632 Oh, I understand now. I'll update the answer. – kaqqao Jan 23 '19 at 09:54
-
@kaqqao Now its 2020, Thought i'd check again, Is this feature available in the recent SPQR lib now or above holds still valid ? Sorry i couldn't find much about spqr documentation. – opuser1 Jul 30 '20 at 15:38