Skip to content

Commit 9ba7606

Browse files
authored
Better javadoc (#2089)
1 parent 3295066 commit 9ba7606

1 file changed

Lines changed: 7 additions & 14 deletions

File tree

src/main/java/graphql/schema/DataFetchingEnvironment.java

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public interface DataFetchingEnvironment extends IntrospectionDataFetchingEnviro
3434
* For the root query, it is equal to {{@link DataFetchingEnvironment#getRoot}
3535
*
3636
* @param <T> you decide what type it is
37-
*
3837
* @return can be null for the root query, otherwise it is never null
3938
*/
4039
<T> T getSource();
@@ -48,7 +47,6 @@ public interface DataFetchingEnvironment extends IntrospectionDataFetchingEnviro
4847
* Returns true of the named argument is present
4948
*
5049
* @param name the name of the argument
51-
*
5250
* @return true of the named argument is present
5351
*/
5452
boolean containsArgument(String name);
@@ -58,7 +56,6 @@ public interface DataFetchingEnvironment extends IntrospectionDataFetchingEnviro
5856
*
5957
* @param name the name of the argument
6058
* @param <T> you decide what type it is
61-
*
6259
* @return the named argument or null if its not present
6360
*/
6461
<T> T getArgument(String name);
@@ -69,7 +66,6 @@ public interface DataFetchingEnvironment extends IntrospectionDataFetchingEnviro
6966
* @param name the name of the argument
7067
* @param defaultValue the default value if the argument is not present
7168
* @param <T> you decide what type it is
72-
*
7369
* @return the named argument or the default if its not present
7470
*/
7571
<T> T getArgumentOrDefault(String name, T defaultValue);
@@ -81,7 +77,6 @@ public interface DataFetchingEnvironment extends IntrospectionDataFetchingEnviro
8177
* This is a info object which is provided to all DataFetchers, but never used by graphql-java itself.
8278
*
8379
* @param <T> you decide what type it is
84-
*
8580
* @return can be null
8681
*/
8782
<T> T getContext();
@@ -98,7 +93,6 @@ public interface DataFetchingEnvironment extends IntrospectionDataFetchingEnviro
9893
* fields execute.
9994
*
10095
* @param <T> you decide what type it is
101-
*
10296
* @return can be null if no field context objects are passed back by previous parent fields
10397
*/
10498
<T> T getLocalContext();
@@ -107,7 +101,6 @@ public interface DataFetchingEnvironment extends IntrospectionDataFetchingEnviro
107101
* This is the source object for the root query.
108102
*
109103
* @param <T> you decide what type it is
110-
*
111104
* @return can be null
112105
*/
113106
<T> T getRoot();
@@ -120,7 +113,6 @@ public interface DataFetchingEnvironment extends IntrospectionDataFetchingEnviro
120113

121114
/**
122115
* @return the list of fields
123-
*
124116
* @deprecated Use {@link #getMergedField()}.
125117
*/
126118
@Deprecated
@@ -199,7 +191,6 @@ public interface DataFetchingEnvironment extends IntrospectionDataFetchingEnviro
199191
* This gives you access to the directives related to this field
200192
*
201193
* @return the {@link graphql.execution.directives.QueryDirectives} for the currently executing field
202-
*
203194
* @see graphql.execution.directives.QueryDirectives for more information
204195
*/
205196
QueryDirectives getQueryDirectives();
@@ -210,9 +201,7 @@ public interface DataFetchingEnvironment extends IntrospectionDataFetchingEnviro
210201
* @param dataLoaderName the name of the data loader to fetch
211202
* @param <K> the key type
212203
* @param <V> the value type
213-
*
214204
* @return the named data loader or null
215-
*
216205
* @see org.dataloader.DataLoaderRegistry#getDataLoader(String)
217206
*/
218207
<K, V> DataLoader<K, V> getDataLoader(String dataLoaderName);
@@ -243,12 +232,16 @@ public interface DataFetchingEnvironment extends IntrospectionDataFetchingEnviro
243232
Document getDocument();
244233

245234
/**
246-
* This returns the variables that have been passed into the query. Note that this is the raw variables themselves and not the
235+
* This returns the variables that have been passed into the query. Note that this is the query variables themselves and not the
247236
* arguments to the field, which is accessed via {@link #getArguments()}
248237
* <p>
249-
* The field arguments are created by interpolating any referenced variables and AST literals and resolving them into the arguments
238+
* The field arguments are created by interpolating any referenced variables and AST literals and resolving them into the arguments.
239+
* <p>
240+
* Also note that the raw query variables are "coerced" into a map where the leaf scalar and enum types are called to create
241+
* input coerced values. So the values you get here are not exactly as passed via {@link graphql.ExecutionInput#getVariables()}
242+
* but have been processed.
250243
*
251-
* @return the variables that have been passed to the query that is being executed
244+
* @return the coerced variables that have been passed to the query that is being executed
252245
*/
253246
Map<String, Object> getVariables();
254247
}

0 commit comments

Comments
 (0)