com.mediative.sangria.codegen.sbt
Generate API code based on a GraphQL schema and queries.
This plugin must be explicitly enabled. To enable it add the following line to your .sbt file:
.sbt
enablePlugins(SangriaCodegenPlugin)
By default, the plugin reads *.graphql files from the resources directory and generates a single Scala source files in the managed source directory.
*.graphql
See the example project.
Keys are defined in SangriaCodegenPlugin.autoImport.
sangriaCodegenSchema
sangriaCodegenQueries
resourceDirectories in sangriaCodegen
includeFilter in sangriaCodegen
"*.graphql"
excludeFilter in sangriaCodegen
HiddenFileFilter
name in sangriaCodegen
sangriaCodegenSchema in Compile := sourceDirectory.value / "graphql" / "schema.graphql" sangriaCodegenQueries in Compile += sourceDirectory.value / "graphql" / "api.graphql"
Generate API code based on a GraphQL schema and queries.
Usage
This plugin must be explicitly enabled. To enable it add the following line to your
.sbtfile:By default, the plugin reads
*.graphqlfiles from the resources directory and generates a single Scala source files in the managed source directory.See the example project.
Configuration
Keys are defined in SangriaCodegenPlugin.autoImport.
sangriaCodegenSchema: The GraphQL schema file. *sangriaCodegenQueries: GraphQL query documents. Defaults to*.graphqlfiles found inside which are found inside the resources directory.resourceDirectories in sangriaCodegen: The resource directories in which to search for GraphQL query documents.includeFilter in sangriaCodegen: Filter which query documents to include. Defaults to"*.graphql".excludeFilter in sangriaCodegen: Filter out query documents. Defaults toHiddenFileFilter.name in sangriaCodegen: Name of the enclosing object.