Closed brainrepo closed 1 year ago
Why would you need to pass an array of executable schemas?
Why would you need to pass an array of executable schemas?
It can be useful if you decide to split in modules your GraphQL application. In my previous project (pretty big) we divided the GraphQL api in domains/modules and each module was responsible of just few types and resolvers.
understood, makes sense
In Mercurius' schema option, we can pass schemas as either a string or an executable schema.
If we pass them as a string, we can also pass an array of schemas in the string type, in which case Mercurius will merge them.
However, if we pass them as an executable schema, we can only pass one. Currently, there is no check to prevent the passing of an array of executable schemas. If we pass two executable schemas, we get an error.
Possible solutions:
https://github.com/mercurius-js/mercurius/blob/b6ac05724b7715ba90d8686aa8218fc8de10ffd1/index.js#L148-L171