This repository was archived by the owner on Jan 10, 2025. It is now read-only.
[graphql-config-utilities] Support multiple schema
definitions (+ globs)
#2367
Labels
Overview
graphql-config
updated their spec for theschema
field (since v3? v4?) to allow multiple files and globs.Our current model within
graphql-config-utilities
assumes a single schema file.Motivation
On Shop app, we're using
graphql-typescript-definitions
to generate the types from schema files. We use multiple schema files, so currently we have to run a script to merge our schema files. I was investigating skipping this skip and keeping multiple schemas when I ran into this problem.I currently have a pretty simple patch as a workaround for multiple files, but haven't extended it to globs. It works, but it's a pretty large patch, so I'd rather it were fixed upstream.
One alternative might be ditching
graphql-config-utilities
from withingraphql-typescript-definitions
, and just usinggraphql-config
directly to do the config parsing. Superficially they have a fairly comparable API surface, so this shouldn't be too hard.Similarly, we could just keep
graphql-config-utilities
as a thin wrapper aroundgraphql-config
, adding a couple of functions as enhancements if we're using it frequently across packages. This shouldn't impact existing packages, and reduces our code to maintain.(Or maybe both? We can put
graphql-config-utilities
into a deprecated state, but update it for any current consumers)I can carve out some time for a PR if you have an opinions on the best direction to go here.
Thoughts?
Checklist
The text was updated successfully, but these errors were encountered: