Skip to content

Commit 276dfc8

Browse files
authored
Added JavaDoc to be important types (graphql-java#731)
Added JavaDoc to the important types
1 parent a273cd7 commit 276dfc8

40 files changed

+556
-207
lines changed

src/main/java/graphql/Directives.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@
55
import graphql.schema.GraphQLNonNull;
66

77
import static graphql.Scalars.GraphQLBoolean;
8-
import static graphql.introspection.Introspection.DirectiveLocation.*;
8+
import static graphql.introspection.Introspection.DirectiveLocation.FIELD;
9+
import static graphql.introspection.Introspection.DirectiveLocation.FRAGMENT_SPREAD;
10+
import static graphql.introspection.Introspection.DirectiveLocation.INLINE_FRAGMENT;
911
import static graphql.schema.GraphQLArgument.newArgument;
1012

13+
/**
14+
* The query directives that are under stood by graphql-java
15+
*/
1116
public class Directives {
1217

1318
public static final GraphQLDirective IncludeDirective = GraphQLDirective.newDirective()

src/main/java/graphql/ErrorType.java

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

33

4+
/**
5+
* All the errors in graphql belong to one of these categories
6+
*/
7+
@PublicApi
48
public enum ErrorType {
59
InvalidSyntax,
610
ValidationError,

src/main/java/graphql/ExceptionWhileDataFetching.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
import static graphql.Assert.assertNotNull;
1313
import static java.lang.String.format;
1414

15+
/**
16+
* This graphql error will be used if a runtime exception is encountered while a data fetcher is invoked
17+
*/
1518
@PublicApi
1619
public class ExceptionWhileDataFetching implements GraphQLError {
1720

src/main/java/graphql/ExecutionInput.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import java.util.Collections;
44
import java.util.Map;
55

6+
/**
7+
* This represents the series of values that can be input on a graphql query execution
8+
*/
69
@PublicApi
710
public class ExecutionInput {
811
private final String query;
@@ -20,22 +23,37 @@ public ExecutionInput(String query, String operationName, Object context, Object
2023
this.variables = variables;
2124
}
2225

26+
/**
27+
* @return the query text
28+
*/
2329
public String getQuery() {
2430
return query;
2531
}
2632

33+
/**
34+
* @return the name of the query operation
35+
*/
2736
public String getOperationName() {
2837
return operationName;
2938
}
3039

40+
/**
41+
* @return the context object to pass to all data fetchers
42+
*/
3143
public Object getContext() {
3244
return context;
3345
}
3446

47+
/**
48+
* @return the root object to start the query execution on
49+
*/
3550
public Object getRoot() {
3651
return root;
3752
}
3853

54+
/**
55+
* @return a map of variables that can be referenced via $syntax in the query
56+
*/
3957
public Map<String, Object> getVariables() {
4058
return variables;
4159
}
@@ -51,6 +69,9 @@ public String toString() {
5169
'}';
5270
}
5371

72+
/**
73+
* @return a new builder of ExecutionInput objects
74+
*/
5475
public static Builder newExecutionInput() {
5576
return new Builder();
5677
}

src/main/java/graphql/GraphQL.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@
3434
import static graphql.Assert.assertNotNull;
3535
import static graphql.InvalidSyntaxError.toInvalidSyntaxError;
3636

37+
/**
38+
* This class is where all graphql-java query execution begins. It combines the objects that are needed
39+
* to make a successful graphql query, with the most important being the {@link graphql.schema.GraphQLSchema schema}
40+
* and the {@link graphql.execution.ExecutionStrategy execution strategy}
41+
*
42+
* Building this object is very cheap and can be done on each execution if necessary. Building the schema is often not
43+
* as cheap, especially if its parsed from graphql IDL schema format via {@link graphql.schema.idl.SchemaParser}.
44+
*/
3745
@PublicApi
3846
public class GraphQL {
3947

src/main/java/graphql/Internal.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
import static java.lang.annotation.ElementType.METHOD;
99
import static java.lang.annotation.ElementType.TYPE;
1010

11+
/**
12+
* This represents code that the graphql-java project considers internal code that MAY not be stable within
13+
* major releases.
14+
*
15+
* In general unecessary changes will be avoided but you should not depend on internal classes being stable
16+
*/
1117
@Retention(RetentionPolicy.RUNTIME)
1218
@Target(value = {CONSTRUCTOR, METHOD, TYPE})
1319
public @interface Internal {

src/main/java/graphql/PublicApi.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
import static java.lang.annotation.ElementType.METHOD;
1010
import static java.lang.annotation.ElementType.TYPE;
1111

12+
/**
13+
* This represents code that the graphql-java project considers public API and has an imperative to be stable within
14+
* major releases.
15+
*
16+
* The guarantee is for code calling classes and interfaces with this annotation, not derived from them. New methods
17+
* maybe be added which would break derivations but not callers.
18+
*/
1219
@Retention(RetentionPolicy.RUNTIME)
1320
@Target(value = {CONSTRUCTOR, METHOD, TYPE})
1421
@Documented

src/main/java/graphql/PublicSpi.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
import static java.lang.annotation.ElementType.METHOD;
1010
import static java.lang.annotation.ElementType.TYPE;
1111

12+
/**
13+
* This represents code that the graphql-java project considers public SPI and has an imperative to be stable within
14+
* major releases.
15+
*
16+
* The guarantee is for callers of code with this annotation as well as derivations that inherit / implement this code.
17+
*
18+
* New methods will not be added (without using default methods say) that would nominally breaks SPI implementations
19+
* within a major release.
20+
*/
1221
@Retention(RetentionPolicy.RUNTIME)
1322
@Target(value = {CONSTRUCTOR, METHOD, TYPE})
1423
@Documented

0 commit comments

Comments
 (0)