Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graphql java 22 update #1967

Merged
merged 5 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Expedia, Inc
* Copyright 2024 Expedia, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,6 +22,7 @@ import graphql.execution.instrumentation.InstrumentationContext
import graphql.execution.instrumentation.InstrumentationState
import graphql.execution.instrumentation.SimpleInstrumentationContext
import graphql.execution.instrumentation.SimplePerformantInstrumentation
import graphql.execution.instrumentation.parameters.InstrumentationCreateStateParameters
import graphql.execution.instrumentation.parameters.InstrumentationExecutionParameters
import graphql.execution.instrumentation.parameters.InstrumentationFieldFetchParameters
import org.slf4j.LoggerFactory
Expand All @@ -37,7 +38,7 @@ class TrackTimesInvokedInstrumentation : SimplePerformantInstrumentation() {

private val logger = LoggerFactory.getLogger(TrackTimesInvokedInstrumentation::class.java)

override fun createState(): InstrumentationState = TrackTimesInvokedInstrumenationState()
override fun createState(parameters: InstrumentationCreateStateParameters): InstrumentationState = TrackTimesInvokedInstrumenationState()

override fun beginFieldFetch(parameters: InstrumentationFieldFetchParameters, state: InstrumentationState?): InstrumentationContext<Any> {
if (parameters.field.getDirective(TRACK_TIMES_INVOKED_DIRECTIVE_NAME) != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@ import graphql.execution.preparsed.persisted.PersistedQueryCacheMiss
import java.util.concurrent.CompletableFuture

interface AutomaticPersistedQueriesCache : PersistedQueryCache {

@Deprecated(
message = "deprecated in favor of async retrieval of PreparsedDocumentEntry",
replaceWith = ReplaceWith("getPersistedQueryDocumentAsync(persistedQueryId, executionInput, onCacheMiss)")
)
override fun getPersistedQueryDocument(
persistedQueryId: Any,
executionInput: ExecutionInput,
onCacheMiss: PersistedQueryCacheMiss
): PreparsedDocumentEntry =
getPersistedQueryDocumentAsync(persistedQueryId, executionInput, onCacheMiss).get()

override fun getPersistedQueryDocumentAsync(
persistedQueryId: Any,
executionInput: ExecutionInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,6 @@ import java.util.function.Function
class AutomaticPersistedQueriesProvider(
private val cache: AutomaticPersistedQueriesCache
) : PreparsedDocumentProvider {

@Deprecated(
"deprecated in favor of async retrieval of Document",
ReplaceWith("this.getDocumentAsync(executionInput, parseAndValidateFunction).get()")
)
override fun getDocument(
executionInput: ExecutionInput,
parseAndValidateFunction: Function<ExecutionInput, PreparsedDocumentEntry>
): PreparsedDocumentEntry =
this.getDocumentAsync(
executionInput,
parseAndValidateFunction
).get()

override fun getDocumentAsync(
executionInput: ExecutionInput,
parseAndValidateFunction: Function<ExecutionInput, PreparsedDocumentEntry>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Expedia, Inc
* Copyright 2024 Expedia, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,8 +19,6 @@ package com.expediagroup.graphql.dataloader.instrumentation.extensions
import com.expediagroup.graphql.dataloader.KotlinDataLoaderRegistry
import com.expediagroup.graphql.dataloader.instrumentation.exceptions.MissingInstrumentationStateException
import com.expediagroup.graphql.dataloader.instrumentation.exceptions.MissingKotlinDataLoaderRegistryException
import com.expediagroup.graphql.dataloader.instrumentation.level.state.ExecutionLevelDispatchedState
import com.expediagroup.graphql.dataloader.instrumentation.level.state.Level
import com.expediagroup.graphql.dataloader.instrumentation.syncexhaustion.state.SyncExecutionExhaustedState
import graphql.schema.DataFetchingEnvironment
import org.dataloader.DataLoader
Expand All @@ -38,11 +36,6 @@ fun <V> CompletableFuture<V>.dispatchIfNeeded(

if (dataLoaderRegistry.dataLoadersInvokedOnDispatch()) {
val cantContinueExecution = when {
environment.graphQlContext.hasKey(ExecutionLevelDispatchedState::class) -> {
environment
.graphQlContext.get<ExecutionLevelDispatchedState>(ExecutionLevelDispatchedState::class)
.allExecutionsDispatched(Level(environment.executionStepInfo.path.level))
}
environment.graphQlContext.hasKey(SyncExecutionExhaustedState::class) -> {
environment
.graphQlContext.get<SyncExecutionExhaustedState>(SyncExecutionExhaustedState::class)
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading