Annotation Type 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
Author:
etienne-sf
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The name of the Directive, as defined in the GraphQL schema.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The list of parameter names for each parameter of this directive applied to the current item.
    The list of parameter types for each parameter of this directive applied to the current item.
    The list of values types for each parameter of this directive applied to the current item, in their string representation.
  • Element Details

    • name

      String name
      The name of the Directive, as defined in the GraphQL schema.
    • parameterNames

      String[] parameterNames
      The 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[] parameterTypes
      The list of parameter types for each parameter of this directive applied to the current item. These types much match exactly the parameterNames() content: same parameters, in the exact same order.
      If parameterNames() is null or empty, it may be null or empty.
      Returns:
      Default:
      {}
    • parameterValues

      String[] parameterValues
      The list of values types for each parameter of this directive applied to the current item, in their string representation. These values much match exactly the parameterNames() content: same parameters, in the exact same order.
      If parameterNames() is null or empty, it may be null or empty.
      The value is the string representation of the Value 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:
      {}