Interface CommonConfiguration

All Known Subinterfaces:
GenerateClientCodeConfiguration, GenerateCodeCommonConfiguration, GenerateGraphQLSchemaConfiguration, GeneratePojoConfiguration, GenerateServerCodeConfiguration, GraphQLConfiguration

public interface CommonConfiguration
This interface contains all the configuration parameters for the graphql goal (Maven) or task (Gradle) of the plugin, as an interface.
All these methods are directly the property names, to map against a Spring Configuration that defines the Beans. These beans can then be reused in Spring Component, thank to Spring IoC and its dependency injection capability.
Author:
etienne-sf
  • Field Details

  • Method Details

    • getEnumPrefix

      String getEnumPrefix()
      An optional prefix to add to the classnames of the generated java classes for GraphQL enums. The prefix is added at the beginning of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)
    • getEnumSuffix

      String getEnumSuffix()
      An optional suffix to add to the classnames of the generated java classes for GraphQL enums. The suffix is added at the end of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)
    • getInputPrefix

      String getInputPrefix()
      An optional prefix to add to the classnames of the generated java classes for GraphQL input objects. The prefix is added at the beginning of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)
    • getInputSuffix

      String getInputSuffix()
      An optional suffix to add to the classnames of the generated java classes for GraphQL input objects. The suffix is added at the end of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)
    • getInterfacePrefix

      String getInterfacePrefix()
      An optional prefix to add to the classnames of the generated java classes for GraphQL interfaces. The prefix is added at the beginning of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)
    • getInterfaceSuffix

      String getInterfaceSuffix()
      An optional suffix to add to the classnames of the generated java classes for GraphQL interfaces. The suffix is added at the end of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)
    • getMaxTokens

      Integer getMaxTokens()
      (Useless, since 1.18.7)Defines the options that maximum number of tokens that the GraphQL schema parser may read. The default value is Integer.MAX_VALUE (=2147483647). If the schema contains more than maxTokens, the build will fail with an error.
      Returns:
    • getProjectDir

      File getProjectDir()
      Get the File for the current project's directory. This allows to compute the full path of file that are within this project (like custom templates for instance)
      Returns:
    • getSchemaFileFolder

      File getSchemaFileFolder()
      The main resources folder, typically '/src/main/resources' of the current project. That's where the GraphQL schema(s) are expected to be: in this folder, or one of these subfolders
    • getSchemaFilePattern

      String getSchemaFilePattern()

      The pattern to find the graphql schema file(s). The default value is "/*.graphqls" meaning that the maven plugin will search all graphqls files in the "/src/main/resources" folder (please check also the schemaFileFolder plugin parameter).

      You can put the star (*) joker in the filename, to retrieve several files at ones, for instance /myschema*.graphqls will retrieve the /src/main/resources/myschema.graphqls and /src/main/resources/myschema_extend.graphqls files.

    • getTargetSchemaSubFolder

      default String getTargetSchemaSubFolder()

      Returns the folder in the classpath that should contain the GraphQL schema. The default is the default for spring-graphql, that is: graphql.

      Returns:
    • getTemplates

      Map<String,String> getTemplates()

      Map of the code templates to be used: this allows to override the default templates, and control exactly what code is generated by the plugin.

      You can override any of the Velocity templates of the project. The list of templates is defined in the enum CodeTemplate, that you can check here.

      You can find a sample in the CustomTemplates client sample.

      Important notice: Please note that the default templates may change in the future. And some of these modifications would need to be reported into the custom templates. We'll try to better expose a stable public API in the future.

    • isAddRelayConnections

      boolean isAddRelayConnections()

      True if the plugin is configured to add the Relay connection capabilities to the field marked by the @RelayConnection directive.

      If so, the plugin reads the provided GraphQL schema file(s), and enriches them with the interfaces and types needed to respect the Relay Connection specification. The entry point for that is the @RelayConnection directive.

      You'll find all the information on the plugin web site. Please check the <A HREF="https://graphql-maven-plugin-project.graphql-java-generator.com/client_add_relay_connection.html>client Relay capability page or the <A HREF="https://graphql-maven-plugin-project.graphql-java-generator.com/server_add_relay_connection.html>server Relay capability page.

    • getTypePrefix

      String getTypePrefix()
      An optional prefix to add to the classnames of the generated java classes for GraphQL types. The prefix is added at the beginning of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)
    • getTypeSuffix

      String getTypeSuffix()
      An optional suffix to add to the classnames of the generated java classes for GraphQL types. The suffix is added at the end of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)
    • getUnionPrefix

      String getUnionPrefix()
      An optional prefix to add to the classnames of the generated java classes for GraphQL unions. The prefix is added at the beginning of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)
    • getUnionSuffix

      String getUnionSuffix()
      An optional suffix to add to the classnames of the generated java classes for GraphQL unions. The suffix is added at the end of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)
    • isGenerateJacksonAnnotations

      default boolean isGenerateJacksonAnnotations()
      This method is used only in GeneratePojoConfiguration.
      Returns:
      The GeneratePojoConfiguration implementation of this method always returns true
      See Also:
    • isSkipGenerationIfSchemaHasNotChanged

      @Deprecated boolean isSkipGenerationIfSchemaHasNotChanged()
      Deprecated.

      This parameter is now deprecated: it's value used in the plugin is always true, that is: if the generated sources or resources are older than the GraphQL schema file(s), then there is no source or resource generation. In clear, the source and resource generation is executed only if the provided input (GraphQL schema...) has been updated since the last plugin execution.

    • getDefaultTargetSchemaFileName

      default String getDefaultTargetSchemaFileName()
      The default name of the target filename.
      This method must be accessible by the Velocity engine. Thus, it can not be a default interface method.
    • logConfiguration

      void logConfiguration()
      Logs all the configuration parameters (only when in the debug level)
    • logCommonConfiguration

      default void logCommonConfiguration()
      Logs all the common configuration parameters (only when in the debug level)