question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:open
  • Created 5 years ago
  • Reactions:1
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
mshwerycommented, May 4, 2020

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

1reaction
cjoudreycommented, Sep 3, 2018

@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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found