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
Required Elements Modifier and Type Required Element Description java.lang.StringnameThe name of the Directive, as defined in the GraphQL schema. -
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.String[]parameterNamesThe list of parameter names for each parameter of this directive applied to the current item.java.lang.String[]parameterTypesThe list of parameter types for each parameter of this directive applied to the current item.java.lang.String[]parameterValuesThe list of values types for each parameter of this directive applied to the current item, in their string representation.
-
Element Details
-
name
java.lang.String nameThe name of the Directive, as defined in the GraphQL schema.
-
-
-
parameterNames
java.lang.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
java.lang.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
java.lang.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 theValueclass 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:
- {}
-