Skip to content

Commit e700c9c

Browse files
committed
add public/internal/spi annotations
1 parent 630a410 commit e700c9c

27 files changed

+119
-2
lines changed

src/main/java/graphql/Assert.java

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

33
import java.util.Collection;
44

5+
@Internal
56
public class Assert {
67

78
public static <T> T assertNotNull(T object, String errorMessage) {

src/main/java/graphql/AssertException.java

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

33

4+
@PublicApi
45
public class AssertException extends GraphQLException {
56

67
public AssertException(String message) {

src/main/java/graphql/ExceptionWhileDataFetching.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import java.util.List;
77

8+
@PublicApi
89
public class ExceptionWhileDataFetching implements GraphQLError {
910

1011
private final Throwable exception;

src/main/java/graphql/ExecutionResult.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.util.List;
55
import java.util.Map;
66

7+
@PublicApi
78
public interface ExecutionResult {
89

910
<T> T getData();

src/main/java/graphql/ExecutionResultImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import java.util.List;
77
import java.util.Map;
88

9+
@Internal
910
public class ExecutionResultImpl implements ExecutionResult {
1011

1112
private final List<GraphQLError> errors = new ArrayList<>();

src/main/java/graphql/GraphQL.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
import static graphql.Assert.assertNotNull;
2929

30+
@PublicApi
3031
public class GraphQL {
3132

3233
private static final Logger log = LoggerFactory.getLogger(GraphQL.class);
@@ -48,6 +49,7 @@ public class GraphQL {
4849
*
4950
* @deprecated use the {@link #newGraphQL(GraphQLSchema)} builder instead. This will be removed in a future version.
5051
*/
52+
@Internal
5153
public GraphQL(GraphQLSchema graphQLSchema) {
5254
//noinspection deprecation
5355
this(graphQLSchema, null, null);
@@ -61,6 +63,7 @@ public GraphQL(GraphQLSchema graphQLSchema) {
6163
*
6264
* @deprecated use the {@link #newGraphQL(GraphQLSchema)} builder instead. This will be removed in a future version.
6365
*/
66+
@Internal
6467
public GraphQL(GraphQLSchema graphQLSchema, ExecutionStrategy queryStrategy) {
6568
//noinspection deprecation
6669
this(graphQLSchema, queryStrategy, null);
@@ -75,6 +78,7 @@ public GraphQL(GraphQLSchema graphQLSchema, ExecutionStrategy queryStrategy) {
7578
*
7679
* @deprecated use the {@link #newGraphQL(GraphQLSchema)} builder instead. This will be removed in a future version.
7780
*/
81+
@Internal
7882
public GraphQL(GraphQLSchema graphQLSchema, ExecutionStrategy queryStrategy, ExecutionStrategy mutationStrategy) {
7983
this(graphQLSchema, queryStrategy, mutationStrategy, null, DEFAULT_EXECUTION_ID_PROVIDER, NoOpInstrumentation.INSTANCE);
8084
}
@@ -89,6 +93,7 @@ public GraphQL(GraphQLSchema graphQLSchema, ExecutionStrategy queryStrategy, Exe
8993
*
9094
* @deprecated use the {@link #newGraphQL(GraphQLSchema)} builder instead. This will be removed in a future version.
9195
*/
96+
@Internal
9297
public GraphQL(GraphQLSchema graphQLSchema, ExecutionStrategy queryStrategy, ExecutionStrategy mutationStrategy, ExecutionStrategy subscriptionStrategy) {
9398
this(graphQLSchema, queryStrategy, mutationStrategy, subscriptionStrategy, DEFAULT_EXECUTION_ID_PROVIDER, NoOpInstrumentation.INSTANCE);
9499
}
@@ -114,6 +119,7 @@ public static Builder newGraphQL(GraphQLSchema graphQLSchema) {
114119
}
115120

116121

122+
@PublicApi
117123
public static class Builder {
118124
private GraphQLSchema graphQLSchema;
119125
private ExecutionStrategy queryExecutionStrategy = new SimpleExecutionStrategy();

src/main/java/graphql/GraphQLError.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import java.util.List;
77

8+
@PublicApi
89
public interface GraphQLError {
910

1011
String getMessage();
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package graphql;
2+
3+
import java.lang.annotation.Retention;
4+
import java.lang.annotation.RetentionPolicy;
5+
import java.lang.annotation.Target;
6+
7+
import static java.lang.annotation.ElementType.CONSTRUCTOR;
8+
import static java.lang.annotation.ElementType.METHOD;
9+
import static java.lang.annotation.ElementType.TYPE;
10+
11+
@Retention(RetentionPolicy.RUNTIME)
12+
@Target(value = {CONSTRUCTOR, METHOD, TYPE})
13+
public @interface Internal {
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package graphql;
2+
3+
import java.lang.annotation.Retention;
4+
import java.lang.annotation.RetentionPolicy;
5+
import java.lang.annotation.Target;
6+
7+
import static java.lang.annotation.ElementType.CONSTRUCTOR;
8+
import static java.lang.annotation.ElementType.METHOD;
9+
import static java.lang.annotation.ElementType.TYPE;
10+
11+
@Retention(RetentionPolicy.RUNTIME)
12+
@Target(value = {CONSTRUCTOR, METHOD, TYPE})
13+
public @interface PublicApi {
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package graphql;
2+
3+
import java.lang.annotation.Retention;
4+
import java.lang.annotation.RetentionPolicy;
5+
import java.lang.annotation.Target;
6+
7+
import static java.lang.annotation.ElementType.CONSTRUCTOR;
8+
import static java.lang.annotation.ElementType.METHOD;
9+
import static java.lang.annotation.ElementType.TYPE;
10+
11+
@Retention(RetentionPolicy.RUNTIME)
12+
@Target(value = {CONSTRUCTOR, METHOD, TYPE})
13+
public @interface PublicSpi {
14+
}

0 commit comments

Comments
 (0)