Class Directive
java.lang.Object
com.graphql_java_generator.client.directive.Directive
public class Directive
extends java.lang.Object
This object can represent both:
- A directive definition, as defined in the GraphQL schema, or as a standard GraphQL directive (skip, include, deprecated). In this case the argument's value is null.
- An applied directive within a query/mutation/subscription. In this case, the argument's value is the value read in the query/mutation/subscription. Thus it can be a hard coded value, or a bind parameter)/
- Author:
- etienne-sf
-
Constructor Summary
Constructors Constructor Description Directive()
Default constructor, used by the generated DirectiveRegistryInitializeDirective(QueryTokenizer qt)
Create a Directive from aQueryTokenizer
. -
Method Summary
Modifier and Type Method Description void
appendToGraphQLRequests(java.lang.StringBuilder sb, java.util.Map<java.lang.String,java.lang.Object> parameters)
Appends this current directive into the givenStringBuilder
, to build the GraphQL requestjava.util.List<InputParameter>
getArguments()
Directive
getDirectiveDefinition()
Returns the definition for this GraphQL directivejava.util.List<DirectiveLocation>
getDirectiveLocations()
java.lang.String
getName()
java.lang.String
getPackageName()
Returns the package name where the code for this directive has been generated.void
setArguments(java.util.List<InputParameter> arguments)
void
setDirectiveLocations(java.util.List<DirectiveLocation> directiveLocations)
void
setName(java.lang.String name)
void
setPackageName(java.lang.String packageName)
-
Constructor Details
-
Directive
Create a Directive from aQueryTokenizer
. ThisQueryTokenizer
should have read the starting @, and the next token should be the directive's name.- Parameters:
qt
-- Throws:
GraphQLRequestPreparationException
-
Directive
public Directive()Default constructor, used by the generated DirectiveRegistryInitialize- Parameters:
qt
-
-
-
Method Details
-
appendToGraphQLRequests
public void appendToGraphQLRequests(java.lang.StringBuilder sb, java.util.Map<java.lang.String,java.lang.Object> parameters) throws GraphQLRequestExecutionExceptionAppends this current directive into the givenStringBuilder
, to build the GraphQL request- Parameters:
sb
-parameters
- The list of bind values for the possible bind parameters- Throws:
GraphQLRequestExecutionException
-
getName
public java.lang.String getName() -
setName
public void setName(java.lang.String name) -
getArguments
-
setArguments
-
getDirectiveLocations
-
setDirectiveLocations
-
getDirectiveDefinition
Returns the definition for this GraphQL directive- Returns:
- Throws:
GraphQLRequestPreparationException
-
getPackageName
public java.lang.String getPackageName()Returns the package name where the code for this directive has been generated. It's used to properly parse the directive arguments- Returns:
-
setPackageName
public void setPackageName(java.lang.String packageName)
-