Annotation Type GraphQLDirective
@Retention(RUNTIME)
@Repeatable(GraphQLDirectives.class)
@Target({TYPE,FIELD,METHOD,PARAMETER})
public @interface GraphQLDirective
This annotation contains the information for a directive that was applied to a GraphQL item in the GraphQL schema
used to generate the code. It allows to retrieve at runtime the directives that were defined in the GraphQL
schema.
Note: this annotation is not added to these objects : schema, scalar (that may receive a Directive when extended) and custom scalars
Note: this annotation is not added to these objects : schema, scalar (that may receive a Directive when extended) and custom scalars
- Author:
- etienne-sf
-
Required Element Summary
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionString[]
The list of parameter names for each parameter of this directive applied to the current item.String[]
The list of parameter types for each parameter of this directive applied to the current item.String[]
The list of values types for each parameter of this directive applied to the current item, in their string representation.
-
Element Details
-
name
String nameThe name of the Directive, as defined in the GraphQL schema.
-
-
-
parameterNames
String[] parameterNamesThe list of parameter names for each parameter of this directive applied to the current item. It may be null or empty.- Returns:
- Default:
- {}
-
parameterTypes
String[] parameterTypesThe list of parameter types for each parameter of this directive applied to the current item. These types much match exactly theparameterNames()
content: same parameters, in the exact same order.
IfparameterNames()
is null or empty, it may be null or empty.- Returns:
- Default:
- {}
-
parameterValues
String[] parameterValuesThe list of values types for each parameter of this directive applied to the current item, in their string representation. These values much match exactly theparameterNames()
content: same parameters, in the exact same order.
IfparameterNames()
is null or empty, it may be null or empty.
The value is the string representation of theValue
class that match this value. For instance:@GraphQLDirective( name = "@testDirective", parameterNames = {"aBoolean", "aCustomScalarDate", "anID", "anArray", "anInt", "aFloat", "anObject", "anEnum", "value", "anotherValue"}, parameterTypes = {"Boolean", "Date", "ID", "[String!]", "Int", "Float", "CharacterInput", "Episode", "String!", "String"}, parameterValues = { "BooleanValue{value=true}", "StringValue{value='2001-02-28'}", "StringValue{value='00000000-0000-0000-0000-000000000002'}", "ArrayValue{values=[StringValue{value='str1'}, StringValue{value='str2'}]}", "IntValue{value=666}", "FloatValue{value=666.666}", "ObjectValue{objectFields=[ObjectField{name='name', value=StringValue{value='specific name'}}, ObjectField{name='appearsIn', value=ArrayValue{values=[EnumValue{name='NEWHOPE'}, EnumValue{name='EMPIRE'}]}}, ObjectField{name='type', value=StringValue{value='Human'}}]}", "EnumValue{name='NEWHOPE'}", "StringValue{value='on Enum'}", "StringValue{value='69'}"})
- Returns:
- Default:
- {}
-