Class GraphQLMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- com.graphql_java_generator.mavenplugin.AbstractCommonMojo
-
- com.graphql_java_generator.mavenplugin.AbstractGenerateCodeCommonMojo
-
- com.graphql_java_generator.mavenplugin.AbstractGenerateServerCodeMojo
-
- com.graphql_java_generator.mavenplugin.AbstractGraphQLMojo
-
- com.graphql_java_generator.mavenplugin.GraphQLMojo
-
- All Implemented Interfaces:
CommonConfiguration,GenerateClientCodeConfiguration,GenerateCodeCommonConfiguration,GenerateServerCodeConfiguration,GraphQLConfiguration,org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="graphql", defaultPhase=GENERATE_SOURCES, requiresProject=true) @ThreadSafe public class GraphQLMojo extends AbstractGraphQLMojoThis goal is deprecated. The graphql goal generates the java code from one or more GraphQL schemas. It allows to work in Java with graphQL, in a schema first approach.
It will be maintained in the future 2.x versions. The generateClientCode and generateServerCode should be used instead.
The graphql goal has two main modes:- client mode: it does the same jobs as the generateClientCode goal. It generates a class for each query, mutation and subscription type. These classes contain the methods to call the queries, mutations and subscriptions. That is: to execute a query against the GraphQL server, you just have to call one of this method. It also generates the POJOs from the GraphQL schema. The GraphQL response is stored in these POJOs, for an easy and standard use in Java.
- server mode: it does the same jobs as the generateServerCode goal. It generates the whole heart of the GraphQL server. The developer has only to develop request to the data. That is the main method (in a jar project) or the main server (in a war project), and all the Spring wiring, based on graphql-java-spring, itself being build on top of graphql-java. It also generates the POJOs. An option allows to annotate them with the standard JPA annotations, to make it easy to link with a database. This goal generates the interfaces for the DataFetchersDelegate (often named providers) that the server needs to implement
- Author:
- etienne-sf
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classGraphQLMojo.SpringConfiguration
-
Field Summary
-
Fields inherited from class com.graphql_java_generator.mavenplugin.AbstractGenerateServerCodeMojo
generateBatchLoaderEnvironment, javaTypeForIDType
-
Fields inherited from class com.graphql_java_generator.mavenplugin.AbstractCommonMojo
buildContext, ctx, enumPrefix, enumSuffix, inputPrefix, inputSuffix, interfacePrefix, interfaceSuffix, maxTokens, projectHelper, springConfigurationClass, typePrefix, typeSuffix, unionPrefix, unionSuffix
-
Fields inherited from interface com.graphql_java_generator.plugin.conf.CommonConfiguration
DEFAULT_ADD_RELAY_CONNECTIONS, DEFAULT_MAX_TOKENS, DEFAULT_PACKAGE_NAME, DEFAULT_PREFIX, DEFAULT_SCHEMA_FILE_FOLDER, DEFAULT_SCHEMA_FILE_PATTERN, DEFAULT_SKIP_GENERATION_IF_SCHEMA_HAS_NOT_CHANGED, DEFAULT_SUFFIX
-
Fields inherited from interface com.graphql_java_generator.plugin.conf.GenerateClientCodeConfiguration
DEFAULT_GENERATE_DEPRECATED_REQUEST_RESPONSE
-
Fields inherited from interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
DEFAULT_COPY_RUNTIME_SOURCES, DEFAULT_SEPARATE_UTIL_CLASSES, DEFAULT_SOURCE_ENCODING, DEFAULT_SPRING_BEAN_SUFFIX, DEFAULT_TARGET_RESOURCE_FOLDER, DEFAULT_TARGET_SOURCE_FOLDER
-
Fields inherited from interface com.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
DEFAULT_GENERATE_BATCH_LOADER_ENVIRONMENT, DEFAULT_GENERATE_DATA_LOADER_FOR_LISTS, DEFAULT_GENERATE_JPA_ANNOTATION, DEFAULT_JAVA_TYPE_FOR_ID_TYPE, DEFAULT_SCAN_BASE_PACKAGES, DEFAULT_SCHEMA_PERSONALIZATION_FILE
-
Fields inherited from interface com.graphql_java_generator.plugin.conf.GraphQLConfiguration
DEFAULT_MODE
-
-
Constructor Summary
Constructors Constructor Description GraphQLMojo()
-
Method Summary
-
Methods inherited from class com.graphql_java_generator.mavenplugin.AbstractGraphQLMojo
getMode, isGenerateDeprecatedRequestResponse
-
Methods inherited from class com.graphql_java_generator.mavenplugin.AbstractGenerateServerCodeMojo
getJavaTypeForIDType, getPackaging, getScanBasePackages, getSchemaPersonalizationFile, isGenerateBatchLoaderEnvironment, isGenerateDataLoaderForLists, isGenerateJPAAnnotation
-
Methods inherited from class com.graphql_java_generator.mavenplugin.AbstractGenerateCodeCommonMojo
executePostExecutionTask, getCustomScalars, getPackageName, getSourceEncoding, getSpringBeanSuffix, getTargetClassFolder, getTargetFolder, getTargetResourceFolder, getTargetSourceFolder, isAddRelayConnections, isCopyRuntimeSources, isSeparateUtilityClasses
-
Methods inherited from class com.graphql_java_generator.mavenplugin.AbstractCommonMojo
execute, getEnumPrefix, getEnumSuffix, getInputPrefix, getInputSuffix, getInterfacePrefix, getInterfaceSuffix, getMaxTokens, getProjectDir, getSchemaFileFolder, getSchemaFilePattern, getTemplates, getTypePrefix, getTypeSuffix, getUnionPrefix, getUnionSuffix, isSkipGenerationIfSchemaHasNotChanged
-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.graphql_java_generator.plugin.conf.CommonConfiguration
getDefaultTargetSchemaFileName, getEnumPrefix, getEnumSuffix, getInputPrefix, getInputSuffix, getInterfacePrefix, getInterfaceSuffix, getMaxTokens, getProjectDir, getSchemaFileFolder, getSchemaFilePattern, getTemplates, getTypePrefix, getTypeSuffix, getUnionPrefix, getUnionSuffix, isAddRelayConnections, isSkipGenerationIfSchemaHasNotChanged, logCommonConfiguration
-
Methods inherited from interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
getCustomScalars, getPackageName, getSourceEncoding, getSpringAutoConfigurationPackage, getSpringBeanSuffix, getTargetClassFolder, getTargetResourceFolder, getTargetSourceFolder, isCopyRuntimeSources, isGenerateUtilityClasses, isSeparateUtilityClasses, logGenerateCodeCommonConfiguration
-
Methods inherited from interface com.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
getJavaTypeForIDType, getPackaging, getQuotedScanBasePackages, getScanBasePackages, getSchemaPersonalizationFile, isGenerateBatchLoaderEnvironment, isGenerateDataLoaderForLists, isGenerateJacksonAnnotations, isGenerateJPAAnnotation, logConfiguration, logGenerateServerCodeConfiguration
-
Methods inherited from interface com.graphql_java_generator.plugin.conf.GraphQLConfiguration
isGenerateJacksonAnnotations, logConfiguration
-
-