Class GraphQLGeneratorOptions
java.lang.Object
org.brapi.schematools.core.options.AbstractGeneratorOptions
org.brapi.schematools.core.graphql.options.GraphQLGeneratorOptions
- All Implemented Interfaces:
Options,Validatable
Options for the
GraphQLGenerator.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the name of the Create Mutation of specific primary modelGets the name of the Delete Mutation of specific primary modelgetListQueryNameFor(String name) Gets the name of the List Query of specific primary modelfinal StringgetQueryInputParameterNameFor(@NonNull String name) Gets the name of the List or Search Query input parameter for of specific primary modelfinal StringgetQueryInputParameterNameFor(@NonNull BrAPIType type) Gets the name of the List or Search Query input parameter for of specific primary modelfinal StringgetQueryInputTypeNameFor(@NonNull String name) Gets the name of the List or Search Query input type for of specific primary modelfinal StringgetQueryInputTypeNameFor(@NonNull BrAPIType type) Gets the name of the List or Search Query input type for of specific primary modelgetSearchQueryNameFor(String name) Gets the name of the Search Query of specific primary modelgetSingleQueryNameFor(String name) Gets the name of the Single Query of specific primary modelGets the name of the Update Mutation of specific primary modelbooleanDetermines if the Generator should generate the New mutations.booleanDetermines if the Generator should generate the New mutation for a specific Primary Model.booleanDetermines if the Generator should generate the Delete mutations.booleanDetermines if the Generator should generate the Delete mutation for a specific Primary Model.booleanDetermines if the Generator should generate any List Query.booleanDetermines if the Generator should generate the List Query for a specific Primary Model.booleanDetermines if the Generator should generate the Mutation Type.booleanDetermines if the Generator should generate the Query Type.booleanDetermines if the Generator should generate any Search Query.booleanDetermines if the Generator should generate the Search Query for a specific Primary Model.booleanDetermines if the Generator should generate any single query.booleanDetermines if the Generator should generate the single query for a specific Primary Model.booleanDetermines if the Generator should generate the Update mutations.booleanDetermines if the Generator should generate the Update mutation for a specific Primary Model.booleanisMergingOneOfType(BrAPIClass type) Gets if the possible types of a 'OneOf' type are merged into a single type.booleanDetermines if the built-in GraphQLID type should be used for IDs instead of GraphQLStringstatic GraphQLGeneratorOptionsload()Load the default optionsstatic GraphQLGeneratorOptionsload(InputStream inputStream) Load the options from an options input stream in YAML or Json.static GraphQLGeneratorOptionsLoad the options from an options file in YAML or Json.override(GraphQLGeneratorOptions overrideOptions) Overrides the values in this Options Object from the provided Options Object if they are non-nullfinal GraphQLGeneratorOptionssetMergeOneOfType(String name, boolean isMergingOneOfType) Sets if the possible types of a 'OneOf' type are merged into a single type.validate()Checks if the Validatable object is valid, return a list of errors if it is not validMethods inherited from class org.brapi.schematools.core.options.AbstractGeneratorOptions
getPluralFor, getPluralFor, override, setPluralFor
-
Constructor Details
-
GraphQLGeneratorOptions
public GraphQLGeneratorOptions()
-
-
Method Details
-
load
Load the default options- Returns:
- The default options
-
load
Load the options from an options file in YAML or Json. The options file may have missing (defined) values, in these cases the default values are loaded. Seeload()- Parameters:
optionsFile- The path to the options file in YAML or Json.- Returns:
- The options loaded from the YAML or Json file.
- Throws:
IOException- if the options file can not be found or is incorrectly formatted.
-
load
Load the options from an options input stream in YAML or Json. The options file may have missing (defined) values, in these cases the default values are loaded. Seeload()- Parameters:
inputStream- The input stream in YAML or Json.- Returns:
- The options loaded from input stream.
- Throws:
IOException- if the input stream is not valid or the content is incorrectly formatted.
-
validate
Description copied from interface:ValidatableChecks if the Validatable object is valid, return a list of errors if it is not valid- Returns:
- a Validation object than can be used queried to find if the object is valid and any errors if it is not valid
-
override
Overrides the values in this Options Object from the provided Options Object if they are non-null- Parameters:
overrideOptions- the options which will be used to override this Options Object- Returns:
- this options for method chaining
-
isGeneratingQueryType
public boolean isGeneratingQueryType()Determines if the Generator should generate the Query Type.- Returns:
trueif the Generator should generate the Query Type,falseotherwise
-
isGeneratingSingleQueries
public boolean isGeneratingSingleQueries()Determines if the Generator should generate any single query. ReturnstrueifAbstractGeneratorSubOptions.isGenerating()is set totrueor- Returns:
trueif the Generator should generate any single query,falseotherwise
-
isGeneratingSingleQueryFor
Determines if the Generator should generate the single query for a specific Primary Model. ReturnstrueifAbstractGeneratorSubOptions.isGeneratingFor(String)is set totruefor the specified type- Parameters:
name- the name of the Primary Model- Returns:
trueif the Generator should generate single query for a specific Primary Model,falseotherwise
-
isGeneratingListQueries
public boolean isGeneratingListQueries()Determines if the Generator should generate any List Query. ReturnstrueifAbstractGeneratorSubOptions.isGenerating()is set totruefor any type- Returns:
trueif the Generator should generate any List Query,falseotherwise
-
isGeneratingListQueryFor
Determines if the Generator should generate the List Query for a specific Primary Model. ReturnstrueifAbstractGeneratorSubOptions.isGeneratingFor(String)is set totruefor the specified type- Parameters:
name- the name of the Primary Model- Returns:
trueif the Generator should generate List Query for a specific Primary Model,falseotherwise
-
isGeneratingSearchQueries
public boolean isGeneratingSearchQueries()Determines if the Generator should generate any Search Query. ReturnstrueifAbstractGeneratorSubOptions.isGenerating()is set totrue- Returns:
trueif the Generator should generate any Search Query,falseotherwise
-
isGeneratingSearchQueryFor
Determines if the Generator should generate the Search Query for a specific Primary Model. ReturnstrueifAbstractGeneratorSubOptions.isGeneratingFor(String)is set totruefor the specified type- Parameters:
name- the name of the Primary Model- Returns:
trueif the Generator should generate Search Query for a specific Primary Model,falseotherwise
-
isGeneratingMutationType
public boolean isGeneratingMutationType()Determines if the Generator should generate the Mutation Type.- Returns:
trueif the Generator should generate the Mutation Type,falseotherwise
-
isGeneratingCreateMutation
public boolean isGeneratingCreateMutation()Determines if the Generator should generate the New mutations. ReturnstrueifAbstractGeneratorSubOptions.isGenerating()is set totrue- Returns:
trueif the Generator should generate New mutations,falseotherwise
-
isGeneratingCreateMutationFor
Determines if the Generator should generate the New mutation for a specific Primary Model. ReturnstrueifAbstractGeneratorSubOptions.isGeneratingFor(String)is set totruefor the specified type- Parameters:
name- the name of the Primary Model- Returns:
trueif the Generator should generate Create mutation for a specific Primary Model,falseotherwise
-
isGeneratingUpdateMutation
public boolean isGeneratingUpdateMutation()Determines if the Generator should generate the Update mutations. ReturnstrueifAbstractGeneratorSubOptions.isGenerating()is set totrue- Returns:
trueif the Generator should generate Update mutations,falseotherwise
-
isGeneratingUpdateMutationFor
Determines if the Generator should generate the Update mutation for a specific Primary Model. ReturnstrueifAbstractGeneratorSubOptions.isGeneratingFor(String)is set totrueor the specified type- Parameters:
name- the name of the Primary Model- Returns:
trueif the Generator should generate Update mutation for a specific Primary Model,falseotherwise
-
isGeneratingDeleteMutation
public boolean isGeneratingDeleteMutation()Determines if the Generator should generate the Delete mutations. ReturnstrueifAbstractGeneratorSubOptions.isGenerating()is set totrueor- Returns:
trueif the Generator should generate Delete mutations,falseotherwise
-
isGeneratingDeleteMutationFor
Determines if the Generator should generate the Delete mutation for a specific Primary Model. ReturnstrueifAbstractGeneratorSubOptions.isGeneratingFor(String)is set totruefor the specified type- Parameters:
name- the name of the Primary Model- Returns:
trueif the Generator should generate Delete mutation for a specific Primary Model,falseotherwise
-
isUsingIDType
public boolean isUsingIDType()Determines if the built-in GraphQLID type should be used for IDs instead of GraphQLString- Returns:
trueif the built-in GraphQLID type should be used for IDs instead of GraphQLString,falseotherwise
-
getQueryInputParameterNameFor
Gets the name of the List or Search Query input parameter for of specific primary model- Parameters:
name- the name of the primary model- Returns:
- the name of the List or Search Query input parameter for of specific primary model
-
getQueryInputParameterNameFor
Gets the name of the List or Search Query input parameter for of specific primary model- Parameters:
type- the primary model- Returns:
- the name of the List or Search Query input parameter for of specific primary model
-
getQueryInputTypeNameFor
Gets the name of the List or Search Query input type for of specific primary model- Parameters:
name- the name of the primary model- Returns:
- the name of the List or Search input type for of specific primary model
-
getQueryInputTypeNameFor
Gets the name of the List or Search Query input type for of specific primary model- Parameters:
type- the primary model- Returns:
- the name of the List or Search input type for of specific primary model
-
getSingleQueryNameFor
Gets the name of the Single Query of specific primary model- Parameters:
name- the name of the primary model- Returns:
- the name of the Single Query of specific primary model
-
getListQueryNameFor
Gets the name of the List Query of specific primary model- Parameters:
name- the name of the primary model- Returns:
- the name of the List Query of specific primary model
-
getSearchQueryNameFor
Gets the name of the Search Query of specific primary model- Parameters:
name- the name of the primary model- Returns:
- the name of the Search Query of specific primary model
-
getCreateMutationNameFor
Gets the name of the Create Mutation of specific primary model- Parameters:
name- the name of the primary model- Returns:
- the name of the Create Mutation of specific primary model
-
getUpdateMutationNameFor
Gets the name of the Update Mutation of specific primary model- Parameters:
name- the name of the primary model- Returns:
- the name of the Update Mutation of specific primary model
-
getDeleteMutationNameFor
Gets the name of the Delete Mutation of specific primary model- Parameters:
name- the name of the primary model- Returns:
- the name of the Delete Mutation of specific primary model
-
isMergingOneOfType
Gets if the possible types of a 'OneOf' type are merged into a single type.- Parameters:
type- the BrAPIClass- Returns:
trueif the possible types of a 'OneOf' type are merged into a single type.
-
setMergeOneOfType
Sets if the possible types of a 'OneOf' type are merged into a single type.- Parameters:
name- the name of the typeisMergingOneOfType-trueif the possible types of a 'OneOf' type are merged into a single type,falseotherwise- Returns:
- the options for chaining
-