Class GenerateServerCodeExtension

All Implemented Interfaces:
com.graphql_java_generator.plugin.conf.CommonConfiguration, com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration, com.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
Direct Known Subclasses:
GraphQLExtension

public class GenerateServerCodeExtension extends GenerateCodeCommonExtension implements com.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
  • Field Details

    • javaTypeForIDType

      public String javaTypeForIDType

      The javaTypeForIDType is the java class that is used in the generated code for GraphQL fields that are of the GraphQL ID type. The default value is java.util.UUID. Valid values are: java.lang.String, java.lang.Long and java.util.UUID.

      This parameter is only valid for the server mode. When generating the client code, the ID is always generated as a String type, as recommended in the GraphQL doc.

      In other words: when in server mode and javaTypeForIDType is not set, all GraphQL ID fields are UUID attributes in java. When in server mode and javaTypeForIDType is set to the X type, all GraphQL ID fields are X attributes in java.

      Note: you can override this, by using the schema personalization capability. For more information, please have a look at the Schema Personalization doc page.

  • Constructor Details

    • GenerateServerCodeExtension

      public GenerateServerCodeExtension(org.gradle.api.Project project)
  • Method Details

    • isGenerateBatchLoaderEnvironment

      public boolean isGenerateBatchLoaderEnvironment()
      Specified by:
      isGenerateBatchLoaderEnvironment in interface com.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
    • setGenerateBatchLoaderEnvironment

      public void setGenerateBatchLoaderEnvironment(boolean generateBatchLoaderEnvironment)
    • isGenerateJPAAnnotation

      public boolean isGenerateJPAAnnotation()
      Specified by:
      isGenerateJPAAnnotation in interface com.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
    • setGenerateJPAAnnotation

      public void setGenerateJPAAnnotation(boolean generateJPAAnnotation)
    • isGenerateDataLoaderForLists

      public boolean isGenerateDataLoaderForLists()
      Specified by:
      isGenerateDataLoaderForLists in interface com.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
    • setGenerateDataLoaderForLists

      public final void setGenerateDataLoaderForLists(boolean generateDataLoaderForLists)
    • getJavaTypeForIDType

      public String getJavaTypeForIDType()
      Specified by:
      getJavaTypeForIDType in interface com.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
    • setJavaTypeForIDType

      public void setJavaTypeForIDType(String javaTypeForIDType)
    • getMode

      public com.graphql_java_generator.plugin.conf.PluginMode getMode()
      The mode is forced to PluginMode.server
      Specified by:
      getMode in interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
      Overrides:
      getMode in class GenerateCodeCommonExtension
    • getPackaging

      public com.graphql_java_generator.plugin.conf.Packaging getPackaging()
      Specified by:
      getPackaging in interface com.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
    • getQuotedScanBasePackages

      public String getQuotedScanBasePackages()
      Specified by:
      getQuotedScanBasePackages in interface com.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
    • getScanBasePackages

      public String getScanBasePackages()
      Specified by:
      getScanBasePackages in interface com.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
    • setScanBasePackages

      public void setScanBasePackages(String scanBasePackages)