在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):deweyjose/graphqlcodegen开源软件地址(OpenSource Url):https://github.com/deweyjose/graphqlcodegen开源编程语言(OpenSource Language):Java 100.0%开源软件介绍(OpenSource Introduction):This is port of the netflix codegen plugin for Gradle. Found here. COPIED FROM NETFLIX DOCUMENTATION. The DGS Code Generation plugin generates code for basic types and example data fetchers based on the your Domain Graph Service's graphql schema file during the project's build process. The plugin requires the path to schema files and the package name to use to generate the file. If no schema path is specified, it will look under src/resources/schema for any files with .graphqls extension. plugin generates code for basic types and example data fetchers based on the your Domain Graph Service's graphql schema file during the project's build process. The plugin requires the path to schema files and the package name to use to generate the file. If no schema path is specified, it will look under src/resources/schema for any files with .graphqls extension. Example Repohttps://github.com/deweyjose/graphqlcodegen-example OptionsOptions are configured in the skip
Example <skip>true</skip> Or # mvn ... -Ddgs.codegen.skip=true schemaPaths
Example <schemaPaths>
<param>src/main/resources/schema/schema.graphqls1</param>
<param>src/main/resources/schema/schema.graphqls2</param>
</schemaPaths> packageName
Example <packageName>com.acme.se.generated</packageName> typeMapping
Example <typeMapping>
<Date>java.time.LocalDateTime</Date>
</typeMapping> subPackageNameClient
Example <subPackageNameClient>client</subPackageNameClient> subPackageNameDatafetchers
Example <subPackageNameDatafetchers>datafetchers</subPackageNameDatafetchers> subPackageNameTypes
Example <subPackageNameTypes>types</subPackageNameTypes> generateBoxedTypes
Example <generateBoxedTypes>false</generateBoxedTypes> generateClient
Example <generateClient>false</generateClient> generateInterfaces
Example <generateInterfaces>false</generateInterfaces> outputDir
Example: <outputDir>${project.build.directory}/generated-sources</outputDir> exampleOutputDir
Example: <outputDir>${project.build.directory}/generated-examples</outputDir> includeQueries
Example <includeQueries>
<param>QueryFieldName1</param>
<param>QueryFieldName2</param>
</includeQueries> includeMutations
Example <includeMutations>
<param>MutationFieldName1</param>
<param>MutationFieldName1</param>
</includeMutations> skipEntityQueries
Example <skipEntityQueries>false</skipEntityQueries> shortProjectionNames
Example <shortProjectionNames>false</shortProjectionNames> generateDataTypes
Example <generateDataTypes>false</generateDataTypes> maxProjectionDepth
Example <maxProjectionDepth>10</maxProjectionDepth> language
Example <language>kotlin</language> omitNullInputFields
Example <omitNullInputFields>false</omitNullInputFields> kotlinAllFieldsOptional
Example <kotlinAllFieldsOptional>false</kotlinAllFieldsOptional> snakeCaseConstantNames
Example <snakeCaseConstantNames>false</snakeCaseConstantNames> writeToFiles
Example <writeToFiles>false</writeToFiles> includeSubscriptions
Example <includeSubscriptions>
<param>Subscriptions1</param>
<param>Subscriptions2</param>
</includeSubscriptions> generateInterfaceSetters
Example <generateInterfaceSetters>false</generateInterfaceSetters> UsageAdd the following to your pom files build/plugins section. <plugin>
<groupId>io.github.deweyjose</groupId>
<artifactId>graphqlcodegen-maven-plugin</artifactId>
<version>1.18</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<schemaPaths>
<param>src/main/resources/schema/schema.graphqls</param>
</schemaPaths>
<packageName>com.acme.[your_project].generated</packageName>
</configuration>
</plugin> You'll also need to add the generates-sources folder to the classpath: <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources</source>
</sources>
</configuration>
</execution>
</executions>
</plugin> Generated OutputCOPIED FROM NETFLIX DOCUMENTATION. The generated types are available as part of the packageName.types package under build/generated. These are automatically added to your project's sources. The generated example data fetchers are available under build/generated-examples. Note that these are NOT added to your project's sources and serve mainly as a basic boilerplate code requiring further customization. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论