TypeDefs in split files error (i.e. merge-graphql-schemas)
See original GitHub issue"file1.gql"
type Query {
items: [Item]
}
"file2.gql"
type Query {
item: Item
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:17 (7 by maintainers)
Top Results From Across the Web
Modularizing your GraphQL schema code
To organize your code, you'll want to split up your schema types and the associated resolvers into multiple files.
Read more >How to split type definitions and resolvers into separate files in ...
Type Definitions. The ApolloServer constructor can accept an array instead of just the one DocumentNode object. So you can do something like ...
Read more >Making a typedef accessible in multiple files
The issue i'm running into is that the compiler throws an error when it gets to the function prototypes in my *.h files...
Read more >Data Process shape: Split or combine flat files
Splitting flat files. You can split flat files by line or by profile. Split By Line — Splits each line (record) into a...
Read more >typedef specifier - cppreference.com
Typically, the typedef specifier appears at the start of the declaration, ... error: storage-class-specifier cannot appear in a typedef declaration ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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 havegraphql-schema-linter
runmergeTypes
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!