private CompletableFuture<ExecutionResult> parseValidateAndExecute(ExecutionInput executionInput, GraphQLSchema graphQLSchema, InstrumentationState instrumentationState) { AtomicReference<ExecutionInput> executionInputRef = new AtomicReference<>(executionInput); PreparsedDocumentEntry preparsedDoc = preparsedDocumentProvider.get(executionInput.getQuery(), transformedQuery -> { // if they change the original query in the pre-parser, then we want to see it downstream from then on executionInputRef.set(executionInput.transform(bldr -> bldr.query(transformedQuery))); return parseAndValidate(executionInputRef, graphQLSchema, instrumentationState); }); if (preparsedDoc.hasErrors()) { return CompletableFuture.completedFuture(new ExecutionResultImpl(preparsedDoc.getErrors())); } return execute(executionInputRef.get(), preparsedDoc.getDocument(), graphQLSchema, instrumentationState); }
private CompletableFuture<ExecutionResult> parseValidateAndExecute(ExecutionInput executionInput, GraphQLSchema graphQLSchema, InstrumentationState instrumentationState) { AtomicReference<ExecutionInput> executionInputRef = new AtomicReference<>(executionInput); PreparsedDocumentEntry preparsedDoc = preparsedDocumentProvider.get(executionInput.getQuery(), transformedQuery -> { // if they change the original query in the pre-parser, then we want to see it downstream from then on executionInputRef.set(executionInput.transform(bldr -> bldr.query(transformedQuery))); return parseAndValidate(executionInputRef, graphQLSchema, instrumentationState); }); if (preparsedDoc.hasErrors()) { return CompletableFuture.completedFuture(new ExecutionResultImpl(preparsedDoc.getErrors())); } return execute(executionInputRef.get(), preparsedDoc.getDocument(), graphQLSchema, instrumentationState); }