graphql-schema-linter: TypeDefs in split files error (i.e. merge-graphql-schemas)

"file1.gql"
type Query {
  items: [Item]
}
"file2.gql"
type Query {
  item: Item
}

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 1
  • Comments: 17 (7 by maintainers)

Most upvoted comments

I would say anecdotally that multi-file graphql schemas being merged are quite common.

@henriklundgren thanks for clarifying.

This is the first time I see this package (and this use case.)

I realize this isn’t ideal, but one solution could be to write a simple script that output’s the resulting schema and you can run graphql-schema-linter against it.

A more complete solution could be to make graphql-schema-linter aware of these types of schemas and having a command line option to have graphql-schema-linter run mergeTypes on the separate files. I’m a little less fond of adding these kind of specific things to the library, unless it is the norm.

In both cases, one problem will be associating back an error from the “merged schema” back to the original file.

Hope this helps!