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:
const typeDefs = importSchema('schema.graphql', ['./generated/source.graphql'])
schema.graphql
type A {
# test 1
first: String
second: Float
b: B
}
./generated/source.graphql
type B {
hello: String!
}
Anyone interested working on this, please answer in this issue or join our public Graphcool slack!