Class GenerateGraphQLSchema

java.lang.Object
com.graphql_java_generator.plugin.generate_schema.GenerateGraphQLSchema

@Component public class GenerateGraphQLSchema extends Object
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 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 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 class
      configuration - 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, the GenerateCodeGenerator 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

      protected String resolveTemplate(CodeTemplate template)
      Resolves the template for the given key
      Parameters:
      templateKey -
      defaultValue -
      Returns: