Class GenerateClientCodeTask
- All Implemented Interfaces:
com.graphql_java_generator.plugin.conf.CommonConfiguration,com.graphql_java_generator.plugin.conf.GenerateClientCodeConfiguration,com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration,java.lang.Comparable<org.gradle.api.Task>,org.gradle.api.internal.DynamicObjectAware,org.gradle.api.internal.TaskInternal,org.gradle.api.plugins.ExtensionAware,org.gradle.api.Task,org.gradle.util.Configurable<org.gradle.api.Task>
public class GenerateClientCodeTask extends GenerateCodeCommonTask implements com.graphql_java_generator.plugin.conf.GenerateClientCodeConfiguration
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
Note: The attribute have no default values: their default values is read from the
GenerateCodeCommonExtension, whose attributes can be either the default value, or a value set in the build
script.
-
Nested Class Summary
-
Field Summary
Fields inherited from class com.graphql_java_generator.gradleplugin.GenerateCodeCommonTask
targetResourceFolder, targetSourceFolderFields inherited from class com.graphql_java_generator.gradleplugin.CommonTask
extension, extensionClass, skipGenerationIfSchemaHasNotChangedFields inherited from interface com.graphql_java_generator.plugin.conf.CommonConfiguration
DEFAULT_ADD_RELAY_CONNECTIONS, DEFAULT_MAX_TOKENS, DEFAULT_PACKAGE_NAME, DEFAULT_SCHEMA_FILE_FOLDER, DEFAULT_SCHEMA_FILE_PATTERN, DEFAULT_SKIP_GENERATION_IF_SCHEMA_HAS_NOT_CHANGEDFields inherited from interface com.graphql_java_generator.plugin.conf.GenerateClientCodeConfiguration
DEFAULT_GENERATE_DEPRECATED_REQUEST_RESPONSE -
Constructor Summary
Constructors Constructor Description GenerateClientCodeTask() -
Method Summary
Modifier and Type Method Description voidexecute()protected GenerateClientCodeExtensiongetExtension()com.graphql_java_generator.plugin.conf.PluginModegetMode()booleanisGenerateDeprecatedRequestResponse()booleanisGenerateJacksonAnnotations()voidsetGenerateDeprecatedRequestResponse(boolean generateDeprecatedRequestResponse)Methods inherited from class com.graphql_java_generator.gradleplugin.GenerateCodeCommonTask
getCustomScalars, getPackageName, getSourceEncoding, getSpringAutoConfigurationPackage, getSpringBeanSuffix, getTargetClassFolder, getTargetResourceFolder, getTargetSourceFolder, isCopyRuntimeSources, isGenerateUtilityClasses, isSeparateUtilityClasses, registerGeneratedFolders, setCopyRuntimeSources, setCustomScalars, setPackageName, setSeparateUtilityClasses, setSourceEncoding, setSpringBeanSuffix, setTargetResourceFolder, setTargetSourceFolderMethods inherited from class com.graphql_java_generator.gradleplugin.CommonTask
addThisTaskAsADependencyToAnotherTask, configure, getDefaultTargetSchemaFileName, getFileValue, getMaxTokens, getProjectDir, getSchemaFileFolder, getSchemaFilePattern, getTemplates, getValue, isAddRelayConnections, isInitialized, isSkipGenerationIfSchemaHasNotChanged, logConfiguration, setAddRelayConnections, setInitialized, setParserOptions, setSchemaFileFolder, setSchemaFilePattern, setSkipGenerationIfSchemaHasNotChanged, setTemplatesMethods inherited from class org.gradle.api.internal.AbstractTask
appendParallelSafeAction, compareTo, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getIdentityPath, getImpliesSubProjects, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getRequiredServices, getServices, getSharedResources, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTaskIdentity, getTemporaryDir, getTemporaryDirFactory, getTimeout, hasProperty, hasTaskActions, injectIntoNewInstance, isEnabled, isHasCustomActions, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, replaceLogger, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, toString, usesServiceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.graphql_java_generator.plugin.conf.CommonConfiguration
getDefaultTargetSchemaFileName, getMaxTokens, getProjectDir, getSchemaFileFolder, getSchemaFilePattern, getTemplates, isAddRelayConnections, isSkipGenerationIfSchemaHasNotChanged, logCommonConfigurationMethods inherited from interface com.graphql_java_generator.plugin.conf.GenerateClientCodeConfiguration
logConfigurationMethods inherited from interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
getCustomScalars, getPackageName, getSourceEncoding, getSpringAutoConfigurationPackage, getSpringBeanSuffix, getTargetClassFolder, getTargetResourceFolder, getTargetSourceFolder, isCopyRuntimeSources, isGenerateUtilityClasses, isSeparateUtilityClasses, logGenerateCodeCommonConfiguration
-
Constructor Details
-
GenerateClientCodeTask
public GenerateClientCodeTask()
-
-
Method Details
-
execute
public void execute() throws java.io.IOException- Throws:
java.io.IOException
-
isGenerateDeprecatedRequestResponse
@Input public boolean isGenerateDeprecatedRequestResponse()- Specified by:
isGenerateDeprecatedRequestResponsein interfacecom.graphql_java_generator.plugin.conf.GenerateClientCodeConfiguration
-
setGenerateDeprecatedRequestResponse
public final void setGenerateDeprecatedRequestResponse(boolean generateDeprecatedRequestResponse) -
isGenerateJacksonAnnotations
@Internal public boolean isGenerateJacksonAnnotations()- Specified by:
isGenerateJacksonAnnotationsin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration- Specified by:
isGenerateJacksonAnnotationsin interfacecom.graphql_java_generator.plugin.conf.GenerateClientCodeConfiguration- Overrides:
isGenerateJacksonAnnotationsin classGenerateCodeCommonTask
-
getExtension
- Overrides:
getExtensionin classGenerateCodeCommonTask
-
getMode
@Input public com.graphql_java_generator.plugin.conf.PluginMode getMode()- Specified by:
getModein interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration- Overrides:
getModein classGenerateCodeCommonTask
-