cosmo
cosmo copied to clipboard
Feature Request: Support for multiple schema files or glob patterns in 'schema_file'
Component(s)
No response
Is your feature request related to a problem? Please describe.
Currently, the schema_file configuration only accepts a path to a single file. In many projects, it is a common practice to modularize the GraphQL schema by splitting it into multiple .gql or .graphql files across different feature directories.
This limitation forces developers to implement a pre-processing step in their build pipeline (e.g., using cat or a script) to concatenate these files into a single schema file before composition can run. This adds complexity to the build process and reduces the clarity of the configuration.
Describe the solution you'd like
I suggest enhancing the configuration to support multiple schema sources in one of two ways:
- Support an array of file paths: This would allow developers to explicitly list all the schema files.
Example:
schema_files:
- ./features/users/read.gql
- ./features/users/create.gql
- ./features/users/delete.gql
- Support a glob pattern: This offers even more flexibility and automatically includes new schema files that match the pattern.
Example:
schema_glob: ./features/**/*.gql
Describe alternatives you've considered
No response
Additional context
No response