Skip to content

Commit 47b64a1

Browse files
committed
Add deprecated at dates
1 parent f1cf719 commit 47b64a1

21 files changed

Lines changed: 120 additions & 0 deletions

src/main/java/graphql/DirectivesUtil.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public class DirectivesUtil {
2525

2626

2727
@Deprecated // use GraphQLAppliedDirectives eventually
28+
@DeprecatedAt("2022-02-24")
2829
public static Map<String, GraphQLDirective> nonRepeatableDirectivesByName(List<GraphQLDirective> directives) {
2930
// filter the repeatable directives
3031
List<GraphQLDirective> singletonDirectives = directives.stream()
@@ -34,12 +35,14 @@ public static Map<String, GraphQLDirective> nonRepeatableDirectivesByName(List<G
3435
}
3536

3637
@Deprecated // use GraphQLAppliedDirectives eventually
38+
@DeprecatedAt("2022-02-24")
3739
public static Map<String, ImmutableList<GraphQLDirective>> allDirectivesByName(List<GraphQLDirective> directives) {
3840

3941
return ImmutableMap.copyOf(FpKit.groupingBy(directives, GraphQLDirective::getName));
4042
}
4143

4244
@Deprecated // use GraphQLAppliedDirectives eventually
45+
@DeprecatedAt("2022-02-24")
4346
public static Optional<GraphQLArgument> directiveWithArg(List<GraphQLDirective> directives, String directiveName, String argumentName) {
4447
GraphQLDirective directive = nonRepeatableDirectivesByName(directives).get(directiveName);
4548
GraphQLArgument argument = null;
@@ -51,6 +54,7 @@ public static Optional<GraphQLArgument> directiveWithArg(List<GraphQLDirective>
5154

5255

5356
@Deprecated // use GraphQLAppliedDirectives eventually
57+
@DeprecatedAt("2022-02-24")
5458
public static boolean isAllNonRepeatable(List<GraphQLDirective> directives) {
5559
if (directives == null || directives.isEmpty()) {
5660
return false;
@@ -64,6 +68,7 @@ public static boolean isAllNonRepeatable(List<GraphQLDirective> directives) {
6468
}
6569

6670
@Deprecated // use GraphQLAppliedDirectives eventually
71+
@DeprecatedAt("2022-02-24")
6772
public static List<GraphQLDirective> add(List<GraphQLDirective> targetList, GraphQLDirective newDirective) {
6873
assertNotNull(targetList, () -> "directive list can't be null");
6974
assertNotNull(newDirective, () -> "directive can't be null");
@@ -72,6 +77,7 @@ public static List<GraphQLDirective> add(List<GraphQLDirective> targetList, Grap
7277
}
7378

7479
@Deprecated // use GraphQLAppliedDirectives eventually
80+
@DeprecatedAt("2022-02-24")
7581
public static List<GraphQLDirective> addAll(List<GraphQLDirective> targetList, List<GraphQLDirective> newDirectives) {
7682
assertNotNull(targetList, () -> "directive list can't be null");
7783
assertNotNull(newDirectives, () -> "directive list can't be null");
@@ -80,6 +86,7 @@ public static List<GraphQLDirective> addAll(List<GraphQLDirective> targetList, L
8086
}
8187

8288
@Deprecated // use GraphQLAppliedDirectives eventually
89+
@DeprecatedAt("2022-02-24")
8390
public static GraphQLDirective getFirstDirective(String name, Map<String, List<GraphQLDirective>> allDirectivesByName) {
8491
List<GraphQLDirective> directives = allDirectivesByName.getOrDefault(name, emptyList());
8592
if (directives.isEmpty()) {

src/main/java/graphql/ExecutionInput.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public String getOperationName() {
7272
* @deprecated - use {@link #getGraphQLContext()}
7373
*/
7474
@Deprecated
75+
@DeprecatedAt("2021-07-05")
7576
public Object getContext() {
7677
return context;
7778
}
@@ -124,6 +125,7 @@ public DataLoaderRegistry getDataLoaderRegistry() {
124125
* @deprecated - Apollo has deprecated the Cache Control specification
125126
*/
126127
@Deprecated
128+
@DeprecatedAt("2022-07-26")
127129
public CacheControl getCacheControl() {
128130
return cacheControl;
129131
}
@@ -227,6 +229,7 @@ public static class Builder {
227229
// dataloader field tracking away.
228230
//
229231
private DataLoaderRegistry dataLoaderRegistry = DataLoaderDispatcherInstrumentationState.EMPTY_DATALOADER_REGISTRY;
232+
@DeprecatedAt("2022-07-26")
230233
private CacheControl cacheControl = CacheControl.newCacheControl();
231234
private Locale locale = Locale.getDefault();
232235
private ExecutionId executionId;
@@ -287,6 +290,7 @@ public Builder localContext(Object localContext) {
287290
* @deprecated - the {@link ExecutionInput#getGraphQLContext()} is a fixed mutable instance now
288291
*/
289292
@Deprecated
293+
@DeprecatedAt("2021-07-05")
290294
public Builder context(Object context) {
291295
this.context = context;
292296
return this;
@@ -302,6 +306,7 @@ public Builder context(Object context) {
302306
* @deprecated - the {@link ExecutionInput#getGraphQLContext()} is a fixed mutable instance now
303307
*/
304308
@Deprecated
309+
@DeprecatedAt("2021-07-05")
305310
public Builder context(GraphQLContext.Builder contextBuilder) {
306311
this.context = contextBuilder.build();
307312
return this;
@@ -317,6 +322,7 @@ public Builder context(GraphQLContext.Builder contextBuilder) {
317322
* @deprecated - the {@link ExecutionInput#getGraphQLContext()} is a fixed mutable instance now
318323
*/
319324
@Deprecated
325+
@DeprecatedAt("2021-07-05")
320326
public Builder context(UnaryOperator<GraphQLContext.Builder> contextBuilderFunction) {
321327
GraphQLContext.Builder builder = GraphQLContext.newContext();
322328
builder = contextBuilderFunction.apply(builder);
@@ -394,6 +400,7 @@ public Builder dataLoaderRegistry(DataLoaderRegistry dataLoaderRegistry) {
394400
}
395401

396402
@Deprecated
403+
@DeprecatedAt("2022-07-26")
397404
public Builder cacheControl(CacheControl cacheControl) {
398405
this.cacheControl = assertNotNull(cacheControl);
399406
return this;

src/main/java/graphql/GraphQL.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ public ExecutionResult execute(String query) {
335335
* @deprecated Use {@link #execute(ExecutionInput)}
336336
*/
337337
@Deprecated
338+
@DeprecatedAt("2017-06-02")
338339
public ExecutionResult execute(String query, Object context) {
339340
ExecutionInput executionInput = ExecutionInput.newExecutionInput()
340341
.query(query)
@@ -356,6 +357,7 @@ public ExecutionResult execute(String query, Object context) {
356357
* @deprecated Use {@link #execute(ExecutionInput)}
357358
*/
358359
@Deprecated
360+
@DeprecatedAt("2017-06-02")
359361
public ExecutionResult execute(String query, String operationName, Object context) {
360362
ExecutionInput executionInput = ExecutionInput.newExecutionInput()
361363
.query(query)
@@ -378,6 +380,7 @@ public ExecutionResult execute(String query, String operationName, Object contex
378380
* @deprecated Use {@link #execute(ExecutionInput)}
379381
*/
380382
@Deprecated
383+
@DeprecatedAt("2017-06-02")
381384
public ExecutionResult execute(String query, Object context, Map<String, Object> variables) {
382385
ExecutionInput executionInput = ExecutionInput.newExecutionInput()
383386
.query(query)
@@ -401,6 +404,7 @@ public ExecutionResult execute(String query, Object context, Map<String, Object>
401404
* @deprecated Use {@link #execute(ExecutionInput)}
402405
*/
403406
@Deprecated
407+
@DeprecatedAt("2017-06-02")
404408
public ExecutionResult execute(String query, String operationName, Object context, Map<String, Object> variables) {
405409
ExecutionInput executionInput = ExecutionInput.newExecutionInput()
406410
.query(query)

src/main/java/graphql/TypeResolutionEnvironment.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public GraphQLSchema getSchema() {
9696
* @deprecated use {@link #getGraphQLContext()} instead
9797
*/
9898
@Deprecated
99+
@DeprecatedAt("2021-12-27")
99100
public <T> T getContext() {
100101
//noinspection unchecked
101102
return (T) context;

src/main/java/graphql/collect/ImmutableMapWithNullValues.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package graphql.collect;
22

33
import graphql.Assert;
4+
import graphql.DeprecatedAt;
45
import graphql.Internal;
56

67
import java.util.Collection;
@@ -82,24 +83,28 @@ public V get(Object key) {
8283

8384
@Override
8485
@Deprecated
86+
@DeprecatedAt("2020-11-10")
8587
public V put(K key, V value) {
8688
throw new UnsupportedOperationException();
8789
}
8890

8991
@Override
9092
@Deprecated
93+
@DeprecatedAt("2020-11-10")
9194
public V remove(Object key) {
9295
throw new UnsupportedOperationException();
9396
}
9497

9598
@Override
9699
@Deprecated
100+
@DeprecatedAt("2020-11-10")
97101
public void putAll(Map<? extends K, ? extends V> m) {
98102
throw new UnsupportedOperationException();
99103
}
100104

101105
@Override
102106
@Deprecated
107+
@DeprecatedAt("2020-11-10")
103108
public void clear() {
104109
throw new UnsupportedOperationException();
105110
}
@@ -141,54 +146,63 @@ public void forEach(BiConsumer<? super K, ? super V> action) {
141146

142147
@Override
143148
@Deprecated
149+
@DeprecatedAt("2020-11-10")
144150
public void replaceAll(BiFunction<? super K, ? super V, ? extends V> function) {
145151
throw new UnsupportedOperationException();
146152
}
147153

148154
@Override
149155
@Deprecated
156+
@DeprecatedAt("2020-11-10")
150157
public V putIfAbsent(K key, V value) {
151158
throw new UnsupportedOperationException();
152159
}
153160

154161
@Override
155162
@Deprecated
163+
@DeprecatedAt("2020-11-10")
156164
public boolean remove(Object key, Object value) {
157165
throw new UnsupportedOperationException();
158166
}
159167

160168
@Override
161169
@Deprecated
170+
@DeprecatedAt("2020-11-10")
162171
public boolean replace(K key, V oldValue, V newValue) {
163172
throw new UnsupportedOperationException();
164173
}
165174

166175
@Override
167176
@Deprecated
177+
@DeprecatedAt("2020-11-10")
168178
public V replace(K key, V value) {
169179
throw new UnsupportedOperationException();
170180
}
171181

172182
@Override
173183
@Deprecated
184+
@DeprecatedAt("2020-11-10")
174185
public V computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) {
175186
throw new UnsupportedOperationException();
176187
}
177188

178189
@Override
179190
@Deprecated
191+
@DeprecatedAt("2020-11-10")
180192
public V computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
181193
throw new UnsupportedOperationException();
182194
}
183195

184196
@Override
185197
@Deprecated
198+
@DeprecatedAt("2020-11-10")
186199
public V compute(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
187200
throw new UnsupportedOperationException();
188201
}
189202

190203
@Override
191204
@Deprecated
205+
@DeprecatedAt("2020-11-10")
192206
public V merge(K key, V value, BiFunction<? super V, ? super V, ? extends V> remappingFunction) {
193207
throw new UnsupportedOperationException();
194208
}

src/main/java/graphql/execution/DataFetcherExceptionHandler.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package graphql.execution;
22

3+
import graphql.DeprecatedAt;
34
import graphql.ExecutionResult;
45
import graphql.PublicSpi;
56
import graphql.schema.DataFetcher;
@@ -27,6 +28,7 @@ public interface DataFetcherExceptionHandler {
2728
* version
2829
*/
2930
@Deprecated
31+
@DeprecatedAt("2021-06-23")
3032
default DataFetcherExceptionHandlerResult onException(DataFetcherExceptionHandlerParameters handlerParameters) {
3133
return SimpleDataFetcherExceptionHandler.defaultImpl.onException(handlerParameters);
3234
}

src/main/java/graphql/execution/ExecutionContext.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import com.google.common.collect.ImmutableList;
55
import com.google.common.collect.ImmutableMap;
6+
import graphql.DeprecatedAt;
67
import graphql.ExecutionInput;
78
import graphql.GraphQLContext;
89
import graphql.GraphQLError;
@@ -121,6 +122,7 @@ public OperationDefinition getOperationDefinition() {
121122
* @deprecated use {@link #getCoercedVariables()} instead
122123
*/
123124
@Deprecated
125+
@DeprecatedAt("2022-05-24")
124126
public Map<String, Object> getVariables() {
125127
return coercedVariables.toMap();
126128
}
@@ -136,6 +138,7 @@ public CoercedVariables getCoercedVariables() {
136138
* @deprecated use {@link #getGraphQLContext()} instead
137139
*/
138140
@Deprecated
141+
@DeprecatedAt("2021-07-05")
139142
@SuppressWarnings({"unchecked", "TypeParameterUnusedInFormals"})
140143
public <T> T getContext() {
141144
return (T) context;
@@ -164,6 +167,7 @@ public DataLoaderRegistry getDataLoaderRegistry() {
164167
}
165168

166169
@Deprecated
170+
@DeprecatedAt("2022-07-26")
167171
public CacheControl getCacheControl() {
168172
return cacheControl;
169173
}

src/main/java/graphql/execution/ExecutionContextBuilder.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.google.common.collect.ImmutableList;
44
import com.google.common.collect.ImmutableMap;
5+
import graphql.DeprecatedAt;
56
import graphql.ExecutionInput;
67
import graphql.GraphQLContext;
78
import graphql.GraphQLError;
@@ -157,6 +158,7 @@ public ExecutionContextBuilder root(Object root) {
157158
* @deprecated use {@link #coercedVariables(CoercedVariables)} instead
158159
*/
159160
@Deprecated
161+
@DeprecatedAt("2022-05-24")
160162
public ExecutionContextBuilder variables(Map<String, Object> variables) {
161163
this.coercedVariables = CoercedVariables.of(variables);
162164
return this;
@@ -188,6 +190,7 @@ public ExecutionContextBuilder dataLoaderRegistry(DataLoaderRegistry dataLoaderR
188190
}
189191

190192
@Deprecated
193+
@DeprecatedAt("2022-07-26")
191194
public ExecutionContextBuilder cacheControl(CacheControl cacheControl) {
192195
this.cacheControl = cacheControl;
193196
return this;

src/main/java/graphql/execution/ExecutionStepInfo.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package graphql.execution;
22

3+
import graphql.DeprecatedAt;
34
import graphql.PublicApi;
45
import graphql.collect.ImmutableMapWithNullValues;
56
import graphql.schema.GraphQLFieldDefinition;
@@ -84,6 +85,7 @@ private ExecutionStepInfo(Builder builder) {
8485
* @deprecated use {@link #getObjectType()} instead as it is named better
8586
*/
8687
@Deprecated
88+
@DeprecatedAt("2022-02-03")
8789
public GraphQLObjectType getFieldContainer() {
8890
return fieldContainer;
8991
}

src/main/java/graphql/execution/TypeResolutionParameters.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package graphql.execution;
22

3+
import graphql.DeprecatedAt;
34
import graphql.GraphQLContext;
45
import graphql.Internal;
56
import graphql.TypeResolutionEnvironment;
@@ -74,6 +75,7 @@ public static Builder newParameters() {
7475
* @deprecated use {@link #getGraphQLContext()} instead
7576
*/
7677
@Deprecated
78+
@DeprecatedAt("2021-07-05")
7779
public Object getContext() {
7880
return context;
7981
}
@@ -124,6 +126,7 @@ public Builder schema(GraphQLSchema schema) {
124126
}
125127

126128
@Deprecated
129+
@DeprecatedAt("2021-07-05")
127130
public Builder context(Object context) {
128131
this.context = context;
129132
return this;

0 commit comments

Comments
 (0)