Class Directive
java.lang.Object
com.graphql_java_generator.client.directive.Directive
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
ConstructorDescriptionDefault constructor, used by the generated DirectiveRegistryInitializeDirective
(QueryTokenizer qt, String schema) Create a Directive from aQueryTokenizer
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendToGraphQLRequests
(StringBuilder sb, Map<String, Object> parameters) Appends this current directive into the givenStringBuilder
, to build the GraphQL requestReturns the definition for this GraphQL directivegetName()
Returns the package name where the code for this directive has been generated.void
setArguments
(List<InputParameter> arguments) void
setDirectiveLocations
(List<DirectiveLocation> directiveLocations) void
void
setPackageName
(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
-schema
- value of the springBeanSuffix plugin parameter for the searched schema. When there is only one schema, this plugin parameter is usually not set. In this case, its default value ("") is used.- Throws:
GraphQLRequestPreparationException
-
Directive
public Directive()Default constructor, used by the generated DirectiveRegistryInitialize- Parameters:
qt
-
-
-
Method Details
-
appendToGraphQLRequests
public void appendToGraphQLRequests(StringBuilder sb, Map<String, 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
-
setName
-
getArguments
-
setArguments
-
getDirectiveLocations
-
setDirectiveLocations
-
getDirectiveDefinition
Returns the definition for this GraphQL directive- Returns:
- Throws:
GraphQLRequestPreparationException
-
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
-