Package graphql.execution.preparsed
Interface PreparsedDocumentProvider
-
- All Known Implementing Classes:
ApolloPersistedQuerySupport
,NoOpPreparsedDocumentProvider
,PersistedQuerySupport
@PublicSpi public interface PreparsedDocumentProvider
Interface that allows clients to hook in Document caching and/or the whitelisting of queries.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description PreparsedDocumentEntry
getDocument(ExecutionInput executionInput, java.util.function.Function<ExecutionInput,PreparsedDocumentEntry> parseAndValidateFunction)
default java.util.concurrent.CompletableFuture<PreparsedDocumentEntry>
getDocumentAsync(ExecutionInput executionInput, java.util.function.Function<ExecutionInput,PreparsedDocumentEntry> parseAndValidateFunction)
This is called to get a "cached" pre-parsed query and if it's not present, then the "parseAndValidateFunction" can be called to parse and validate the query.
-
-
-
Method Detail
-
getDocument
@Deprecated PreparsedDocumentEntry getDocument(ExecutionInput executionInput, java.util.function.Function<ExecutionInput,PreparsedDocumentEntry> parseAndValidateFunction)
Deprecated.This is called to get a "cached" pre-parsed query and if it's not present, then the "parseAndValidateFunction" can be called to parse and validate the query.Note - the "parseAndValidateFunction" MUST be called if you don't have a per parsed version of the query because it not only parses and validates the query, it invokes
Instrumentation
calls as well for parsing and validation. if you don't make a call back on this then these wont happen.- Parameters:
executionInput
- TheExecutionInput
containing the queryparseAndValidateFunction
- If the query has not be pre-parsed, this function MUST be called to parse and validate it- Returns:
- an instance of
PreparsedDocumentEntry
-
getDocumentAsync
default java.util.concurrent.CompletableFuture<PreparsedDocumentEntry> getDocumentAsync(ExecutionInput executionInput, java.util.function.Function<ExecutionInput,PreparsedDocumentEntry> parseAndValidateFunction)
This is called to get a "cached" pre-parsed query and if it's not present, then the "parseAndValidateFunction" can be called to parse and validate the query.Note - the "parseAndValidateFunction" MUST be called if you don't have a per parsed version of the query because it not only parses and validates the query, it invokes
Instrumentation
calls as well for parsing and validation. if you don't make a call back on this then these won't happen.- Parameters:
executionInput
- TheExecutionInput
containing the queryparseAndValidateFunction
- If the query has not be pre-parsed, this function MUST be called to parse and validate it- Returns:
- a promise to an
PreparsedDocumentEntry
-
-