schemaFiles

abstract val schemaFiles: ConfigurableFileCollection

The schema files in either ".json" introspection schemas or ".sdl|.graphqls" SDL schemas.

Most of the time, schemaFiles contains a main schema and an optional separate file for client extensions. You may set any number of files and the compiler will merge them. The merge order is:

  • main schema file first (the main schema file is the file that contains the schema definition or the Query type)

  • lexicographic order of the filename for other schema files

If not set or empty, the plugin collects all "*.json|sdl|graphqls" files in the srcDir roots.

Example:

schemaFiles.from("src/main/graphql/schema.graphqls", "src/main/graphql/extra.graphqls")