-
Notifications
You must be signed in to change notification settings - Fork 5
Gradle GraphQL Schema Location
dermakov edited this page Jul 31, 2021
·
2 revisions
Kobby uses GraphQL schema to generate Kotlin DSL client. By default, Kobby looks for all files with extension graphqls
in src/main/resources directory and all its subdirectories. You can change this behaviour by means of schema
section in kobby plugin extension.
You can specify schema files location explicitly by means of files property:
kobby {
schema {
files = files(
"src/main/resources/my/package/name/query.graphqls",
"src/main/resources/my/package/name/mutation.graphqls",
"src/main/resources/my/package/name/subscription.graphqls"
)
}
}The files property is of
type FileCollection, so you can use
the rich Gradle File API to configure it.
If the files property is not explicitly specified, Kobby will look for schema files in the project files. You can use
the scan section to customize your search parameters:
kobby {
schema {
scan {
// Root directory to scan schema files
dir = "src/main/resources" // String
// ANT style include patterns to scan schema files
includes = listOf("**/*.graphqls") // Iterable<String>
// ANT style exclude patterns to scan schema files
excludes = null // Iterable<String>
}
}
}-
diris the root directory to scan. By default, issrc/main/resources. -
includesis the list of ANT style patterns for including matching files. By default, islistOf("**/*.graphqls"). -
excludesis the list of ANT style patterns to exclude matching files. By default, is empty.