Class ApolloPersistedQuerySupport
- java.lang.Object
-
- graphql.execution.preparsed.persisted.PersistedQuerySupport
-
- graphql.execution.preparsed.persisted.ApolloPersistedQuerySupport
-
- All Implemented Interfaces:
PreparsedDocumentProvider
@PublicApi public class ApolloPersistedQuerySupport extends PersistedQuerySupport
This persisted query support class supports the Apollo scheme where the persisted query id is inExecutionInput.getExtensions().You need to provide a
PersistedQueryCachecache implementation as the backing cache.The Apollo client sends a hash of the persisted query in the input extensions in the following form
{ "extensions":{ "persistedQuery":{ "version":1, "sha256Hash":"fcf31818e50ac3e818ca4bdbc433d6ab73176f0b9d5f9d5ad17e200cdab6fba4" } } }- See Also:
ExecutionInput.getExtensions()
-
-
Field Summary
-
Fields inherited from class graphql.execution.preparsed.persisted.PersistedQuerySupport
PERSISTED_QUERY_MARKER
-
-
Constructor Summary
Constructors Constructor Description ApolloPersistedQuerySupport(PersistedQueryCache persistedQueryCache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Optional<java.lang.Object>getPersistedQueryId(ExecutionInput executionInput)This method is required for concrete types to work out the query id (often a hash) that should be used to look up the persisted query in the cache.protected booleanpersistedQueryIdIsInvalid(java.lang.Object persistedQueryId, java.lang.String queryText)-
Methods inherited from class graphql.execution.preparsed.persisted.PersistedQuerySupport
getDocumentAsync, mkMissingError
-
-
-
-
Constructor Detail
-
ApolloPersistedQuerySupport
public ApolloPersistedQuerySupport(PersistedQueryCache persistedQueryCache)
-
-
Method Detail
-
getPersistedQueryId
protected java.util.Optional<java.lang.Object> getPersistedQueryId(ExecutionInput executionInput)
Description copied from class:PersistedQuerySupportThis method is required for concrete types to work out the query id (often a hash) that should be used to look up the persisted query in the cache.- Specified by:
getPersistedQueryIdin classPersistedQuerySupport- Parameters:
executionInput- the execution input- Returns:
- an optional id of the persisted query
-
persistedQueryIdIsInvalid
protected boolean persistedQueryIdIsInvalid(java.lang.Object persistedQueryId, java.lang.String queryText)- Overrides:
persistedQueryIdIsInvalidin classPersistedQuerySupport
-
-