Package graphql.schema
Class FieldCoordinates
java.lang.Object
graphql.schema.FieldCoordinates
A field in graphql is uniquely located within a parent type and hence code elements
like
DataFetcher need to be specified using those coordinates.-
Method Summary
Modifier and TypeMethodDescriptionvoidChecks the validity of the field coordinate names.static FieldCoordinatescoordinates(GraphQLFieldsContainer parentType, GraphQLFieldDefinition fieldDefinition) Creates new field coordinatesstatic FieldCoordinatescoordinates(GraphQLFieldsContainer parentType, String fieldName) Creates new field coordinatesstatic FieldCoordinatescoordinates(String parentType, String fieldName) Creates new field coordinatesbooleaninthashCode()booleanstatic FieldCoordinatessystemCoordinates(String fieldName) The exception to the general rule is the system __xxxx Introspection fields which have no parent type and are able to be specified on any typetoString()
-
Method Details
-
getTypeName
-
getFieldName
-
isSystemCoordinates
public boolean isSystemCoordinates() -
assertValidNames
Checks the validity of the field coordinate names. The validity checks vary by coordinate type. Standard coordinates validate both thetypeNameandfieldName, while system coordinates do not have a parent so they only validate thefieldName.- Throws:
AssertException- if the coordinates are NOT valid; otherwise, returns normally.
-
equals
-
hashCode
public int hashCode() -
toString
-
coordinates
public static FieldCoordinates coordinates(GraphQLFieldsContainer parentType, GraphQLFieldDefinition fieldDefinition) Creates new field coordinates- Parameters:
parentType- the container of the fieldfieldDefinition- the field definition- Returns:
- new field coordinates represented by the two parameters
-
coordinates
Creates new field coordinates- Parameters:
parentType- the container of the fieldfieldName- the field name- Returns:
- new field coordinates represented by the two parameters
-
coordinates
Creates new field coordinates- Parameters:
parentType- the container of the fieldfieldName- the field name- Returns:
- new field coordinates represented by the two parameters
-
systemCoordinates
The exception to the general rule is the system __xxxx Introspection fields which have no parent type and are able to be specified on any type- Parameters:
fieldName- the name of the system field which MUST start with __- Returns:
- the coordinates
-