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, java.lang.String schema)Create a Directive from aQueryTokenizer. -
Method Summary
Modifier and Type Method Description voidappendToGraphQLRequests(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()DirectivegetDirectiveDefinition()Returns the definition for this GraphQL directivejava.util.List<DirectiveLocation>getDirectiveLocations()java.lang.StringgetName()java.lang.StringgetPackageName()Returns the package name where the code for this directive has been generated.voidsetArguments(java.util.List<InputParameter> arguments)voidsetDirectiveLocations(java.util.List<DirectiveLocation> directiveLocations)voidsetName(java.lang.String name)voidsetPackageName(java.lang.String packageName)
-
Constructor Details
-
Directive
public Directive(QueryTokenizer qt, java.lang.String schema) throws GraphQLRequestPreparationExceptionCreate a Directive from aQueryTokenizer. ThisQueryTokenizershould 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(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)
-