Class GenerateGraphQLSchema
java.lang.Object
com.graphql_java_generator.plugin.generate_schema.GenerateGraphQLSchema
This class merges one or more given GraphQL schema files into a new GraphQL schema, that is written in the given
target schema file. If
The job is done by using this class as a Spring bean, and calling its
CommonConfiguration.isAddRelayConnections()
is true, then the generated schema is
updated to be conform to the relay connection
specification.The job is done by using this class as a Spring bean, and calling its
generateGraphQLSchema()
method.- Author:
- etienne-sf
-
Constructor Summary
ConstructorDescriptionGenerateGraphQLSchema
(DocumentParser documentParser, GraphqlUtils graphqlUtils, GenerateGraphQLSchemaConfiguration configuration, ResourceSchemaStringProvider resourceSchemaStringProvider) A constructor that can be called by other tasks/goals.GenerateGraphQLSchema
(GenerateGraphQLSchemaDocumentParser documentParser, GraphqlUtils graphqlUtils, GenerateGraphQLSchemaConfiguration configuration, ResourceSchemaStringProvider resourceSchemaStringProvider) The constructor that Spring will use to load this Spring bean -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method is the entry point, for the generation of the schema that merges the GraphQL source schema filesprotected String
resolveTemplate
(CodeTemplate template) Resolves the template for the given key
-
Constructor Details
-
GenerateGraphQLSchema
@Autowired public GenerateGraphQLSchema(GenerateGraphQLSchemaDocumentParser documentParser, GraphqlUtils graphqlUtils, GenerateGraphQLSchemaConfiguration configuration, ResourceSchemaStringProvider resourceSchemaStringProvider) The constructor that Spring will use to load this Spring bean- Parameters:
documentParser
- The document parser, that loads the GraphQL schema into memory, and prepares the data for the schema generation.graphqlUtils
- A runtime utility classconfiguration
- The configuration for the generateGraphQLSchema task/goal
-
GenerateGraphQLSchema
public GenerateGraphQLSchema(DocumentParser documentParser, GraphqlUtils graphqlUtils, GenerateGraphQLSchemaConfiguration configuration, ResourceSchemaStringProvider resourceSchemaStringProvider) A constructor that can be called by other tasks/goals. For instance, theGenerateCodeGenerator
class creates an instance of this class, when in server mode and addRelayConnections is true, to generate the GraphQL schema, as it is necessary for the graphql-java at runtime.- Parameters:
documentParser
-graphqlUtils
-configuration
-
-
-
Method Details
-
generateGraphQLSchema
public void generateGraphQLSchema()This method is the entry point, for the generation of the schema that merges the GraphQL source schema files -
resolveTemplate
Resolves the template for the given key- Parameters:
templateKey
-defaultValue
-- Returns:
-