Skip to content

Commit

Permalink
graphql java 22 update (#1967)
Browse files Browse the repository at this point in the history
### 📝 Description
waiting for an official release of this PR
graphql-java/graphql-java#3571

UPDATE:
next graphql-java update will be on July,
https://github.com/graphql-java/graphql-java/milestone/69

they helped us releasing from this branch 
graphql-java/graphql-java#3571

which will unblock us.

https://github.com/graphql-java/graphql-java/releases/tag/v22.0
  • Loading branch information
samuelAndalon committed May 6, 2024
1 parent bf98546 commit bce5bc4
Show file tree
Hide file tree
Showing 40 changed files with 102 additions and 1,175 deletions.
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

0 comments on commit bce5bc4

Please sign in to comment.