Skip to content

Commit 1399e49

Browse files
committed
improve javadoc
1 parent 22483e9 commit 1399e49

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

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

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,15 @@
1313
*/
1414
@PublicApi
1515
public interface DataFetchingEnvironment {
16+
1617
/**
18+
* This is the value of the current object to be queried.
19+
* Or to put it differently: it is the value of the parent field.
20+
* <p>
21+
* For the root query, it is equal to {{@link DataFetchingEnvironment#getRoot}
22+
*
1723
* @param <T> you decide what type it is
18-
* @return the current object being queried
24+
* @return can be null for the root query, otherwise it is never null
1925
*/
2026
<T> T getSource();
2127

@@ -42,14 +48,22 @@ public interface DataFetchingEnvironment {
4248
<T> T getArgument(String name);
4349

4450
/**
45-
* Returns a context argument that is set up when the {@link graphql.GraphQL#execute(String, Object)} method
46-
* is invoked
51+
* Returns a context argument that is set up when the {@link graphql.GraphQL#execute} method
52+
* is invoked.
53+
* <p>
54+
* This is a info object which is provided to all DataFetcher, but never used by graphql-java itself.
4755
*
4856
* @param <T> you decide what type it is
49-
* @return a context object
57+
* @return can be null
5058
*/
5159
<T> T getContext();
5260

61+
/**
62+
* This is the source object for the root query.
63+
*
64+
* @param <T>
65+
* @return can be null
66+
*/
5367
<T> T getRoot();
5468

5569
/**

0 commit comments

Comments
 (0)