override fun getDocumentAsync()

in graphql-dgs-spring-graphql/src/main/kotlin/com/netflix/graphql/dgs/apq/DgsAPQPreParsedDocumentProviderWrapper.kt [32:46]


    override fun getDocumentAsync(
        executionInput: ExecutionInput,
        parseAndValidateFunction: Function<ExecutionInput, PreparsedDocumentEntry>,
    ): CompletableFuture<PreparsedDocumentEntry> {
        val queryId = getPersistedQueryId(executionInput)
        if (queryId.isPresent) {
            return super.getDocumentAsync(executionInput, parseAndValidateFunction)
        }

        if (preparsedDocumentProvider.isPresent) {
            return preparsedDocumentProvider.get().getDocumentAsync(executionInput, parseAndValidateFunction)
        }

        return CompletableFuture.completedFuture(parseAndValidateFunction.apply(executionInput))
    }