Class GenerateGraphQLSchemaTask
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
com.graphql_java_generator.gradleplugin.CommonTask
com.graphql_java_generator.gradleplugin.GenerateGraphQLSchemaTask
- All Implemented Interfaces:
com.graphql_java_generator.plugin.conf.CommonConfiguration,com.graphql_java_generator.plugin.conf.GenerateGraphQLSchemaConfiguration,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 GenerateGraphQLSchemaTask extends CommonTask implements com.graphql_java_generator.plugin.conf.GenerateGraphQLSchemaConfiguration
The generateGraphQLSchema goal generates GraphQL schema, based on the source GraphQL schemas, and possibly containing additional stuff, like the Relay connection objects.
It can be used to:- Generate several GraphQL schema files into one file, for instance with additional schema files that would use the extend GraphQL keyword
- Reformat the schema file
- Generate the GraphQL schema with the Relay Connection stuff (Node interface, XxxEdge and XxxConnection types), thanks to the addRelayConnections plugin parameter.
This goal is, by default, attached to the Initialize maven phase, to be sure that the GraphQL schema are generated before the code generation would need it, if relevant.
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.CommonTask
extension, extensionClass, skipGenerationIfSchemaHasNotChangedFields inherited from interface com.graphql_java_generator.plugin.conf.CommonConfiguration
DEFAULT_ADD_RELAY_CONNECTIONS, DEFAULT_PACKAGE_NAME, DEFAULT_SCHEMA_FILE_FOLDER, DEFAULT_SCHEMA_FILE_PATTERN, DEFAULT_SKIP_GENERATION_IF_SCHEMA_HAS_NOT_CHANGED -
Constructor Summary
Constructors Constructor Description GenerateGraphQLSchemaTask() -
Method Summary
Modifier and Type Method Description voidexecute()protected GenerateGraphQLSchemaExtensiongetExtension()java.lang.StringgetResourceEncoding()java.io.FilegetTargetFolder()java.lang.StringgetTargetSchemaFileName()voidregisterGeneratedFolders()This method registers to Gradle the source and resources folders in which files are generated, if anyjava.lang.StringsetResourceEncoding(java.lang.String resourceEncoding)voidsetTargetFolder(java.lang.String targetFolder)voidsetTargetSchemaFileName(java.lang.String targetSchemaFileName)Methods inherited from class com.graphql_java_generator.gradleplugin.CommonTask
configure, getDefaultTargetSchemaFileName, getFileValue, getProjectDir, getSchemaFileFolder, getSchemaFilePattern, getTemplates, getValue, isAddRelayConnections, isSkipGenerationIfSchemaHasNotChanged, logConfiguration, setAddRelayConnections, 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, wait
-
Constructor Details
-
GenerateGraphQLSchemaTask
public GenerateGraphQLSchemaTask()
-
-
Method Details
-
execute
public void execute() throws java.io.IOException- Throws:
java.io.IOException
-
getResourceEncoding
@Input public java.lang.String getResourceEncoding()- Specified by:
getResourceEncodingin interfacecom.graphql_java_generator.plugin.conf.GenerateGraphQLSchemaConfiguration
-
setResourceEncoding
public java.lang.String setResourceEncoding(java.lang.String resourceEncoding) -
getTargetFolder
@InputDirectory public java.io.File getTargetFolder()- Specified by:
getTargetFolderin interfacecom.graphql_java_generator.plugin.conf.GenerateGraphQLSchemaConfiguration
-
setTargetFolder
public void setTargetFolder(java.lang.String targetFolder) -
getTargetSchemaFileName
@Input public java.lang.String getTargetSchemaFileName()- Specified by:
getTargetSchemaFileNamein interfacecom.graphql_java_generator.plugin.conf.GenerateGraphQLSchemaConfiguration
-
setTargetSchemaFileName
public void setTargetSchemaFileName(java.lang.String targetSchemaFileName) -
getExtension
- Overrides:
getExtensionin classCommonTask
-
registerGeneratedFolders
public void registerGeneratedFolders()Description copied from class:CommonTaskThis method registers to Gradle the source and resources folders in which files are generated, if any- Overrides:
registerGeneratedFoldersin classCommonTask
-