Skip to content

Update dependency com.graphql-java:graphql-java to v23 #6603

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

Open
wants to merge 5 commits into
base: dev-2.x
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
<dependency>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java</artifactId>
<version>22.3</version>
<version>23.0</version>
</dependency>
<dependency>
<groupId>com.graphql-java</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
# // Append to the existing field description
# Quay.name.description.append=(Source NSR)
#
# // Insert deprecated reason. Due to a bug in the Java GraphQL lib, an existing deprecated
# // reason cannot be updated. Deleting the reason from the schema, and adding it back using
# // the "default" TransmodelApiDocumentationProfile is a workaround.
# // Insert deprecated reason.
# Quay.name.deprecated=This field is deprecated ...


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ public static GraphQLSchema createSchema() {
TypeDefinitionRegistry typeRegistry = new SchemaParser().parse(url.openStream());
IntrospectionTypeWiring typeWiring = new IntrospectionTypeWiring(typeRegistry);
RuntimeWiring runtimeWiring = RuntimeWiring.newRuntimeWiring()
// This is needed because we have our own implementation for the ID scalar
.strictMode(false)
.scalar(GraphQLScalars.DURATION_SCALAR)
.scalar(GraphQLScalars.POLYLINE_SCALAR)
.scalar(GraphQLScalars.GEOJSON_SCALAR)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,23 @@ This is only worth it when the execution is long running, i.e. more than ~50 mil
"""
directive @async on FIELD_DEFINITION

"This directive allows results to be deferred during execution"
directive @defer(
"Deferred behaviour is controlled by this argument"
if: Boolean! = true,
"A unique label that represents the fragment being deferred"
label: String
) on FRAGMENT_SPREAD | INLINE_FRAGMENT

"Marks the field, argument, input field or enum value as deprecated"
directive @deprecated(
"The reason for the deprecation"
reason: String = "No longer supported"
reason: String! = "No longer supported"
) on FIELD_DEFINITION | ARGUMENT_DEFINITION | ENUM_VALUE | INPUT_FIELD_DEFINITION

"This directive disables error propagation when a non nullable field returns null for the given operation."
directive @experimental_disableErrorPropagation on QUERY | MUTATION | SUBSCRIPTION

"Directs the executor to include this field or fragment only when the `if` argument is true"
directive @include(
"Included when true."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@ schema {
query: QueryType
}

"This directive allows results to be deferred during execution"
directive @defer(
"Deferred behaviour is controlled by this argument"
if: Boolean! = true,
"A unique label that represents the fragment being deferred"
label: String
) on FRAGMENT_SPREAD | INLINE_FRAGMENT

"Marks the field, argument, input field or enum value as deprecated"
directive @deprecated(
"The reason for the deprecation"
reason: String = "No longer supported"
reason: String! = "No longer supported"
) on FIELD_DEFINITION | ARGUMENT_DEFINITION | ENUM_VALUE | INPUT_FIELD_DEFINITION

"This directive disables error propagation when a non nullable field returns null for the given operation."
directive @experimental_disableErrorPropagation on QUERY | MUTATION | SUBSCRIPTION

"Directs the executor to include this field or fragment only when the `if` argument is true"
directive @include(
"Included when true."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.opentripplanner.apis.support.graphql.injectdoc;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static com.google.common.truth.Truth.assertThat;

import graphql.schema.Coercing;
import graphql.schema.GraphQLScalarType;
Expand All @@ -25,11 +25,6 @@
* new schema to an SDL text string. The result is then compared to the
* "expected" SDL file. The input and expected files are found in the
* resources - with the same name as this test.
* <p>
* Note! There is a bug in the Java GraphQL library. Existing deprecated reasons
* cannot be changed or replaced. This test adds test-cases for this, but excludes
* them from the expected result. If this is fixed in the GraphQL library, this
* test will fail, and should be updated by updating the expected result.
*/
class InjectCustomDocumentationTest {

Expand Down Expand Up @@ -109,16 +104,7 @@ void test() {
.filter(it -> !result.contains(it))
.toList();

// There is a bug in the Java GraphQL API, existing deprecated
// doc is not updated or replaced.
var expected = List.of(
"AEnum.E3.deprecated",
"BType.a.deprecated",
"CType.b.deprecated.append",
"InputType.c.deprecated"
);

assertEquals(expected, missingValues);
assertThat(missingValues).isEmpty();

TextAssertions.assertLinesEquals(sdlExpected, result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@ schema {
query: QueryType
}

"This directive allows results to be deferred during execution"
directive @defer(
"Deferred behaviour is controlled by this argument"
if: Boolean! = true,
"A unique label that represents the fragment being deferred"
label: String
) on FRAGMENT_SPREAD | INLINE_FRAGMENT

"Marks the field, argument, input field or enum value as deprecated"
directive @deprecated(
"The reason for the deprecation"
reason: String = "No longer supported"
reason: String! = "No longer supported"
) on FIELD_DEFINITION | ARGUMENT_DEFINITION | ENUM_VALUE | INPUT_FIELD_DEFINITION

"This directive disables error propagation when a non nullable field returns null for the given operation."
directive @experimental_disableErrorPropagation on QUERY | MUTATION | SUBSCRIPTION

"Directs the executor to include this field or fragment only when the `if` argument is true"
directive @include(
"Included when true."
Expand Down Expand Up @@ -49,7 +60,7 @@ type AType {
"BType.description"
type BType {
"BType.a.description"
a: String @deprecated(reason : "REPLACE")
a: String @deprecated(reason : "BType.a.deprecated")
}

"""
Expand All @@ -60,11 +71,11 @@ CType.description.append
type CType {
"""
APPENT TO

CType.a.description.append
"""
a: Duration
b: String @deprecated(reason : "APPEND TO")
b: String @deprecated(reason : "APPEND TO\n\nCType.b.deprecated.append")
}

type QueryType {
Expand All @@ -80,7 +91,7 @@ enum AEnum {
"AEnum.E1.description"
E1
E2 @deprecated(reason : "AEnum.E2.deprecated")
E3 @deprecated(reason : "REPLACE")
E3 @deprecated(reason : "AEnum.E3.deprecated")
}

"Duration.description"
Expand All @@ -91,5 +102,5 @@ input InputType {
"InputType.a.description"
a: String
b: String @deprecated(reason : "InputType.b.deprecated")
c: String @deprecated(reason : "REPLACE")
c: String @deprecated(reason : "InputType.c.deprecated")
}
Loading