Class DataFetchingEnvironment
java.lang.Object
com.codename1.backend.graphql.DataFetchingEnvironment
What a DataFetcher is given: the parent value, the field's arguments and
the request's context.
Arguments are already coerced to the schema's types: an Int is an
Integer, a Float a Double, an ID a String, an enum the value's
name, an input object a Map and a list a List. Use
Json.convert(Object, Class) to read a map into a
class of the application's own.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsArgument(String name) Whether the client gave the argument -- as null too -- or the schema defaulted it.getArgument(String name) One argument, or null when it was neither given nor defaulted.getArgumentAsJson(String name) One argument as its JSON tree -- whole numbers asLong, objects as maps -- the form the generated JSON codecs read a class of the application's own from.Every argument, by name.Every argument as one JSON object tree; seegetArgumentAsJson(String).The context the request was executed with: theHttpServer.Requestwhen it came over HTTP or WebSocket, unless the program supplied its own.Where the field is in the response, as names and list indexes.The field's name in the schema, not its alias.The name of the object type the field belongs to.The parent value, from which this field is resolved; null on a root field unless the execution was given a root value.The operation's coerced variables.
-
Method Details
-
getSource
The parent value, from which this field is resolved; null on a root field unless the execution was given a root value. -
getArgument
-
containsArgument
Whether the client gave the argument -- as null too -- or the schema defaulted it. -
getArguments
-
getArgumentAsJson
-
getArgumentsAsJson
Every argument as one JSON object tree; seegetArgumentAsJson(String). -
getContext
The context the request was executed with: theHttpServer.Requestwhen it came over HTTP or WebSocket, unless the program supplied its own. -
getFieldName
The field's name in the schema, not its alias. -
getParentTypeName
The name of the object type the field belongs to. -
getExecutionPath
-
getVariables
-