Skip to content

Commit af7aa32

Browse files
committed
Merge remote-tracking branch 'origin/master' into remove-slf4j
# Conflicts: # build.gradle
2 parents 170b4c8 + d275323 commit af7aa32

78 files changed

Lines changed: 3195 additions & 1084 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/invoke_test_runner.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050

5151
- id: 'auth'
5252
name: 'Authenticate to Google Cloud'
53-
uses: google-github-actions/auth@v2.0.0
53+
uses: google-github-actions/auth@v2.0.1
5454
with:
5555
credentials_json: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
5656

.github/workflows/stale-pr-issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
close-pending:
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/stale@v8
18+
- uses: actions/stale@v9
1919
with:
2020
# GLOBAL ------------------------------------------------------------
2121
# Exempt any PRs or issues already added to a milestone

build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ def getDevelopmentVersion() {
6161
return makeDevelopmentVersion(["0.0.0", branchName, "SNAPSHOT"])
6262
}
6363

64-
def releaseVersion = System.env.RELEASE_VERSION
6564
def reactiveStreamsVersion = '1.0.3'
65+
def releaseVersion = System.env.RELEASE_VERSION
6666
def antlrVersion = '4.11.1' // https://mvnrepository.com/artifact/org.antlr/antlr4-runtime
6767
def guavaVersion = '32.1.2-jre'
6868
version = releaseVersion ? releaseVersion : getDevelopmentVersion()
@@ -106,18 +106,18 @@ dependencies {
106106
implementation 'com.google.guava:guava:' + guavaVersion
107107
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
108108
testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0'
109-
testImplementation 'org.codehaus.groovy:groovy:3.0.19'
110-
testImplementation 'org.codehaus.groovy:groovy-json:3.0.19'
109+
testImplementation 'org.codehaus.groovy:groovy:3.0.20'
110+
testImplementation 'org.codehaus.groovy:groovy-json:3.0.20'
111111
testImplementation 'com.google.code.gson:gson:2.10.1'
112112
testImplementation 'org.eclipse.jetty:jetty-server:11.0.15'
113-
testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.16.0'
113+
testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.16.1'
114114
testImplementation 'org.awaitility:awaitility-groovy:4.2.0'
115115
testImplementation 'com.github.javafaker:javafaker:1.0.2'
116116

117117
testImplementation 'org.reactivestreams:reactive-streams-tck:' + reactiveStreamsVersion
118118
testImplementation "io.reactivex.rxjava2:rxjava:2.2.21"
119119

120-
testImplementation 'org.testng:testng:7.8.0' // use for reactive streams test inheritance
120+
testImplementation 'org.testng:testng:7.9.0' // use for reactive streams test inheritance
121121

122122
testImplementation 'org.openjdk.jmh:jmh-core:1.37'
123123
testAnnotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.37'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

src/main/java/graphql/DeprecatedAt.java

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/main/java/graphql/Directives.java

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package graphql;
22

33

4+
import graphql.language.BooleanValue;
45
import graphql.language.Description;
56
import graphql.language.DirectiveDefinition;
67
import graphql.language.StringValue;
@@ -33,14 +34,14 @@ public class Directives {
3334
private static final String SPECIFIED_BY = "specifiedBy";
3435
private static final String DEPRECATED = "deprecated";
3536
private static final String ONE_OF = "oneOf";
37+
private static final String DEFER = "defer";
3638

3739
public static final String NO_LONGER_SUPPORTED = "No longer supported";
3840
public static final DirectiveDefinition DEPRECATED_DIRECTIVE_DEFINITION;
3941
public static final DirectiveDefinition SPECIFIED_BY_DIRECTIVE_DEFINITION;
4042
@ExperimentalApi
4143
public static final DirectiveDefinition ONE_OF_DIRECTIVE_DEFINITION;
4244

43-
4445
static {
4546
DEPRECATED_DIRECTIVE_DEFINITION = DirectiveDefinition.newDirectiveDefinition()
4647
.name(DEPRECATED)
@@ -77,6 +78,34 @@ public class Directives {
7778
.build();
7879
}
7980

81+
/**
82+
* The @defer directive can be used to defer sending data for a fragment until later in the query.
83+
* This is an opt-in directive that is not available unless it is explicitly put into the schema.
84+
* <p>
85+
* This implementation is based on the state of <a href="https://github.com/graphql/graphql-spec/pull/742">Defer/Stream PR</a>
86+
* More specifically at the state of this
87+
* <a href="https://github.com/graphql/graphql-spec/commit/c630301560d9819d33255d3ba00f548e8abbcdc6">commit</a>
88+
* <p>
89+
* The execution behaviour should match what we get from running Apollo Server 4.9.5 with graphql-js v17.0.0-alpha.2
90+
*/
91+
@ExperimentalApi
92+
public static final GraphQLDirective DeferDirective = GraphQLDirective.newDirective()
93+
.name(DEFER)
94+
.description("This directive allows results to be deferred during execution")
95+
.validLocations(FRAGMENT_SPREAD, INLINE_FRAGMENT)
96+
.argument(newArgument()
97+
.name("if")
98+
.type(nonNull(GraphQLBoolean))
99+
.description("Deferred behaviour is controlled by this argument")
100+
.defaultValueLiteral(BooleanValue.newBooleanValue(true).build())
101+
)
102+
.argument(newArgument()
103+
.name("label")
104+
.type(GraphQLString)
105+
.description("A unique label that represents the fragment being deferred")
106+
)
107+
.build();
108+
80109
public static final GraphQLDirective IncludeDirective = GraphQLDirective.newDirective()
81110
.name("include")
82111
.description("Directs the executor to include this field or fragment only when the `if` argument is true")

src/main/java/graphql/DirectivesUtil.java

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
@Internal
2424
public class DirectivesUtil {
2525

26-
27-
@Deprecated // use GraphQLAppliedDirectives eventually
28-
@DeprecatedAt("2022-02-24")
26+
@Deprecated(since = "2022-02-24") // use GraphQLAppliedDirectives eventually
2927
public static Map<String, GraphQLDirective> nonRepeatableDirectivesByName(List<GraphQLDirective> directives) {
3028
// filter the repeatable directives
3129
List<GraphQLDirective> singletonDirectives = directives.stream()
@@ -34,15 +32,13 @@ public static Map<String, GraphQLDirective> nonRepeatableDirectivesByName(List<G
3432
return FpKit.getByName(singletonDirectives, GraphQLDirective::getName);
3533
}
3634

37-
@Deprecated // use GraphQLAppliedDirectives eventually
38-
@DeprecatedAt("2022-02-24")
35+
@Deprecated(since = "2022-02-24") // use GraphQLAppliedDirectives eventually
3936
public static Map<String, ImmutableList<GraphQLDirective>> allDirectivesByName(List<GraphQLDirective> directives) {
4037

4138
return ImmutableMap.copyOf(FpKit.groupingBy(directives, GraphQLDirective::getName));
4239
}
4340

44-
@Deprecated // use GraphQLAppliedDirectives eventually
45-
@DeprecatedAt("2022-02-24")
41+
@Deprecated(since = "2022-02-24") // use GraphQLAppliedDirectives eventually
4642
public static Optional<GraphQLArgument> directiveWithArg(List<GraphQLDirective> directives, String directiveName, String argumentName) {
4743
GraphQLDirective directive = nonRepeatableDirectivesByName(directives).get(directiveName);
4844
GraphQLArgument argument = null;
@@ -52,9 +48,7 @@ public static Optional<GraphQLArgument> directiveWithArg(List<GraphQLDirective>
5248
return Optional.ofNullable(argument);
5349
}
5450

55-
56-
@Deprecated // use GraphQLAppliedDirectives eventually
57-
@DeprecatedAt("2022-02-24")
51+
@Deprecated(since = "2022-02-24") // use GraphQLAppliedDirectives eventually
5852
public static boolean isAllNonRepeatable(List<GraphQLDirective> directives) {
5953
if (directives == null || directives.isEmpty()) {
6054
return false;
@@ -67,26 +61,23 @@ public static boolean isAllNonRepeatable(List<GraphQLDirective> directives) {
6761
return true;
6862
}
6963

70-
@Deprecated // use GraphQLAppliedDirectives eventually
71-
@DeprecatedAt("2022-02-24")
64+
@Deprecated(since = "2022-02-24") // use GraphQLAppliedDirectives eventually
7265
public static List<GraphQLDirective> add(List<GraphQLDirective> targetList, GraphQLDirective newDirective) {
7366
assertNotNull(targetList, () -> "directive list can't be null");
7467
assertNotNull(newDirective, () -> "directive can't be null");
7568
targetList.add(newDirective);
7669
return targetList;
7770
}
7871

79-
@Deprecated // use GraphQLAppliedDirectives eventually
80-
@DeprecatedAt("2022-02-24")
72+
@Deprecated(since = "2022-02-24") // use GraphQLAppliedDirectives eventually
8173
public static List<GraphQLDirective> addAll(List<GraphQLDirective> targetList, List<GraphQLDirective> newDirectives) {
8274
assertNotNull(targetList, () -> "directive list can't be null");
8375
assertNotNull(newDirectives, () -> "directive list can't be null");
8476
targetList.addAll(newDirectives);
8577
return targetList;
8678
}
8779

88-
@Deprecated // use GraphQLAppliedDirectives eventually
89-
@DeprecatedAt("2022-02-24")
80+
@Deprecated(since = "2022-02-24") // use GraphQLAppliedDirectives eventually
9081
public static GraphQLDirective getFirstDirective(String name, Map<String, List<GraphQLDirective>> allDirectivesByName) {
9182
List<GraphQLDirective> directives = allDirectivesByName.getOrDefault(name, emptyList());
9283
if (directives.isEmpty()) {

src/main/java/graphql/ExecutionInput.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ public String getOperationName() {
6868
*
6969
* @deprecated - use {@link #getGraphQLContext()}
7070
*/
71-
@Deprecated
72-
@DeprecatedAt("2021-07-05")
71+
@Deprecated(since = "2021-07-05")
7372
public Object getContext() {
7473
return context;
7574
}
@@ -273,8 +272,7 @@ public Builder localContext(Object localContext) {
273272
*
274273
* @deprecated - the {@link ExecutionInput#getGraphQLContext()} is a fixed mutable instance now
275274
*/
276-
@Deprecated
277-
@DeprecatedAt("2021-07-05")
275+
@Deprecated(since = "2021-07-05")
278276
public Builder context(Object context) {
279277
this.context = context;
280278
return this;
@@ -289,8 +287,7 @@ public Builder context(Object context) {
289287
*
290288
* @deprecated - the {@link ExecutionInput#getGraphQLContext()} is a fixed mutable instance now
291289
*/
292-
@Deprecated
293-
@DeprecatedAt("2021-07-05")
290+
@Deprecated(since = "2021-07-05")
294291
public Builder context(GraphQLContext.Builder contextBuilder) {
295292
this.context = contextBuilder.build();
296293
return this;
@@ -305,8 +302,7 @@ public Builder context(GraphQLContext.Builder contextBuilder) {
305302
*
306303
* @deprecated - the {@link ExecutionInput#getGraphQLContext()} is a fixed mutable instance now
307304
*/
308-
@Deprecated
309-
@DeprecatedAt("2021-07-05")
305+
@Deprecated(since = "2021-07-05")
310306
public Builder context(UnaryOperator<GraphQLContext.Builder> contextBuilderFunction) {
311307
GraphQLContext.Builder builder = GraphQLContext.newContext();
312308
builder = contextBuilderFunction.apply(builder);

src/main/java/graphql/ExperimentalApi.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
/**
1414
* This represents code that the graphql-java project considers experimental API and while our intention is that it will
15-
* progress to be {@link PublicApi}, its existence, signature of behavior may change between releases.
16-
*
17-
* In general unnecessary changes will be avoided but you should not depend on experimental classes being stable
15+
* progress to be {@link PublicApi}, its existence, signature or behavior may change between releases.
16+
* <p>
17+
* In general unnecessary changes will be avoided, but you should not depend on experimental classes being stable.
1818
*/
1919
@Retention(RetentionPolicy.RUNTIME)
2020
@Target(value = {CONSTRUCTOR, METHOD, TYPE, FIELD})

src/main/java/graphql/TypeResolutionEnvironment.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ public GraphQLSchema getSchema() {
9494
*
9595
* @deprecated use {@link #getGraphQLContext()} instead
9696
*/
97-
@Deprecated
98-
@DeprecatedAt("2021-12-27")
97+
@Deprecated(since = "2021-12-27")
9998
public <T> T getContext() {
10099
//noinspection unchecked
101100
return (T) context;

0 commit comments

Comments
 (0)