Replies: 7 comments 1 reply
-
Hi All, I turned on the persisted query support in the Apollo graphQL Federation and there are some issues in the DGS framework
I'm gonna try and patch the code to see if I can get it into the logic like described above... thus far, I can't even get to it. |
Beta Was this translation helpful? Give feedback.
-
This would be great to support. We've discussed it recently, but it didn't make it in our planning yet. That just means any help would be much appreciated! |
Beta Was this translation helpful? Give feedback.
-
@paulbakker in DefaultDgsQueryExecutor. add extensions to the BaseExecutor val executionResult = BaseDgsQueryExecutor.baseExecute( BaseExecutor fun baseExecute(
DefaultDgsReactiveQueryExecutor.kt DgsRestController.kt logger.debug("Parsed variables: {}", queryVariables) I am NOT a kotlin developer, but you get the gist... find a way to send an empty query string to the execution,
@@ -179,6 +199,7 @@ open class DgsRestController(open val dgsQueryExecutor: DgsQueryExecutor) { |
Beta Was this translation helpful? Give feedback.
-
In BaseQueryExecutor where it catches PersistedQueryNotFound, it's not worth logging an error and stack trace because this is catch(pqnf: PersistedQueryNotFound) { // THIS IS NEW, the PreparsedDocumentProvider needs to throw this error, Gateway looks specifically for the message..don't dump this is a full blown stack trace cause it can happen all the time and not worth littering the logs
|
Beta Was this translation helpful? Give feedback.
-
@golfingal72 Please can you elaborate steps to enable this feature happy to get the APQ working |
Beta Was this translation helpful? Give feedback.
-
@jregistr Please can you let me know where you able to get APQ to work in dgs in some form. |
Beta Was this translation helpful? Give feedback.
-
Created PR #829 with an initial implementation of this feature. The PR is up for review and cleanup but describes some ergonomics that you, as a user, will have available. Feedback is welcomed since at this stage is easy to influence the ergonomics the framework will provide you. |
Beta Was this translation helpful? Give feedback.
-
Hello, It'd be really nice if DGS had built-in support for Apollo Persisted Queries as it's something we use in production.
TLDR: APQ allows a client to pass a smaller request body containing a hash as an identifier for a Query the server has stored. It is great when some clients have large queries that are too big for CDN's cache.
e.g.
Btw, this is related to #50.
In the initial investigation on adding this, we can see that both parsing&validation caching and an APQ cache are both done via the PreparsedDocumentProvider. See PersistedQuerySupport.java for example.
In our in-house implementation and apollo's (Query String Cache, Ast Document Store), caching the query for a hash and the validation cache are separate. This allows us to put the Query cache in redis. The document cache must be in memory as it's entire purpose is to avoid de-serializing the query multiple times.
I've been experimenting with this and my initial ideation is to add an implementation of PersistedQueryCache that uses the spring boot caching annotations (
@Cacheable
,@CacheEvict
) for the Query cache and a Concurrent HashMap for the document store.https://github.com/jregistr/dgs-framework/tree/feature/experimenting-with-apq/graphql-apollo-apq/src/main/kotlin/com/netflix/graphql/dgs/apolloapq
Anyone else using APQ?
And I'd greatly appreciate some feedback and thoughts on APQ support with DGS.
Thank You!
Beta Was this translation helpful? Give feedback.
All reactions