You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using graphql-import together with a Prisma Service, a common situation that a developer finds herself in is copying over type names.
This happens when you just want to "forward" the underlying service types to the resulting application schema.
While the current explicit nature of graphql-import provides good readability and maintainability, it requires in certain cases a lot of boilerplate code.
To make it possible for developers to have quicker iterations on schemas, we should introduce an automatic import mechanism.
That means, that any type used in the resulting schema, that is not defined, will be searched in specified source files.
I like this very much. You could simplify the API even further and just pass multiple files to importSchema without telling what's the main file. It would be simply in the obligation to pass the files in the correct order.
For this to work I also imagine would be kind of easy and could eliminate the need for comment imports from the .graphql files themselves: Just read the file contents and join them together before parsing as graphql.
When using
graphql-import
together with a Prisma Service, a common situation that a developer finds herself in is copying over type names.This happens when you just want to "forward" the underlying service types to the resulting application schema.
While the current explicit nature of
graphql-import
provides good readability and maintainability, it requires in certain cases a lot of boilerplate code.To make it possible for developers to have quicker iterations on schemas, we should introduce an automatic import mechanism.
That means, that any type used in the resulting schema, that is not defined, will be searched in specified source files.
The API could look like this:
schema.graphql
./generated/source.graphql
Anyone interested working on this, please answer in this issue or join our public Graphcool slack!
The text was updated successfully, but these errors were encountered: