Class GenerateClientCodeMojo
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.AbstractGenerateClientCodeMojo
com.graphql_java_generator.mavenplugin.GenerateClientCodeMojo
- All Implemented Interfaces:
CommonConfiguration
,GenerateClientCodeConfiguration
,GenerateCodeCommonConfiguration
,org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="generateClientCode",
defaultPhase=GENERATE_SOURCES,
requiresProject=true,
threadSafe=true)
@ThreadSafe
public class GenerateClientCodeMojo
extends AbstractGenerateClientCodeMojo
The generateClientCode Maven goal (and Gradle task) generates the java code from one or more GraphQL schemas. It allows to work in Java with graphQL, in a schema first approach.
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 these methods. 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.You'll find more info in the tutorials: take a look at the Maven client tutorial or the Gradle client tutorial
- Author:
- etienne-sf
-
Nested Class Summary
-
Field Summary
Fields inherited from class com.graphql_java_generator.mavenplugin.AbstractCommonMojo
buildContext, ctx, enumPrefix, enumSuffix, inputPrefix, inputSuffix, interfacePrefix, interfaceSuffix, jsonGraphqlSchemaFilename, maxTokens, projectHelper, springConfigurationClass, typePrefix, typeSuffix, unionPrefix, unionSuffix
Fields inherited from interface com.graphql_java_generator.plugin.conf.CommonConfiguration
DEFAULT_ADD_RELAY_CONNECTIONS, DEFAULT_JSON_GRAPHQL_SCHEMA_FILE, DEFAULT_MAX_TOKENS, DEFAULT_PACKAGE_NAME, DEFAULT_PREFIX, DEFAULT_SCHEMA_FILE_FOLDER, DEFAULT_SCHEMA_FILE_PATTERN, DEFAULT_SCHEMA_SUB_FOLDER, 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_QUERY_MUTATION_EXECUTION_PROTOCOL, DEFAULT_SCHEMA_PERSONALIZATION_FILE, DEFAULT_SEPARATE_UTIL_CLASSES, DEFAULT_SOURCE_ENCODING, DEFAULT_SPRING_BEAN_SUFFIX, DEFAULT_TARGET_RESOURCE_FOLDER, DEFAULT_TARGET_SOURCE_FOLDER, DEFAULT_USE_JAKARTA_EE9
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
-
Method Summary
Methods inherited from class com.graphql_java_generator.mavenplugin.AbstractGenerateClientCodeMojo
getMode, isGenerateDeprecatedRequestResponse
Methods inherited from class com.graphql_java_generator.mavenplugin.AbstractGenerateCodeCommonMojo
executePostExecutionTask, getCustomScalars, getPackageName, getQueryMutationExecutionProtocol, getSchemaPersonalizationFile, getSourceEncoding, getSpringBeanSuffix, getTargetClassFolder, getTargetFolder, getTargetResourceFolder, getTargetSourceFolder, isAddRelayConnections, isCopyRuntimeSources, isSeparateUtilityClasses, isUseJakartaEE9
Methods inherited from class com.graphql_java_generator.mavenplugin.AbstractCommonMojo
execute, getEnumPrefix, getEnumSuffix, getInputPrefix, getInputSuffix, getInterfacePrefix, getInterfaceSuffix, getJsonGraphqlSchemaFilename, 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, getJsonGraphqlSchemaFilename, getMaxTokens, getProjectDir, getSchemaFileFolder, getSchemaFilePattern, getTargetSchemaSubFolder, getTemplates, getTypePrefix, getTypeSuffix, getUnionPrefix, getUnionSuffix, isAddRelayConnections, isSkipGenerationIfSchemaHasNotChanged, logCommonConfiguration
Methods inherited from interface com.graphql_java_generator.plugin.conf.GenerateClientCodeConfiguration
isGenerateJacksonAnnotations, logConfiguration
Methods inherited from interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
getCustomScalars, getPackageName, getQueryMutationExecutionProtocol, getSchemaPersonalizationFile, getSourceEncoding, getSpringAutoConfigurationPackage, getSpringBeanSuffix, getTargetClassFolder, getTargetResourceFolder, getTargetSourceFolder, isCopyRuntimeSources, isGenerateUtilityClasses, isSeparateUtilityClasses, isUseJakartaEE9, logGenerateCodeCommonConfiguration
-
Constructor Details
-
GenerateClientCodeMojo
protected GenerateClientCodeMojo()
-