extend type for local schema not working.
See original GitHub issueDescribe the bug
Using the extend
keyword to extend QueryRoot or MutationRoot types is not working. Instead we have to ‘redefine’ the MutationRoot and QueryRoot which in turn will be merged by gql-gen
. This doesn’t play ball with the autocomplete of IntelliJ GraphQL plugin.
We’re getting a simple there have been errors in your document.
To Reproduce Steps to reproduce the behavior:
- Use the following schema files:
schema.graphqls
schema {
query: QueryRoot
}
type Commander {
name: String
rank: Float
}
type QueryRoot {
commander: Commander
}
schema.local.graphqls
type Welcome {
hello: String!
}
extend type QueryRoot {
welcome: Welcome
}
- Use the following document:
query getWelcomeGreet {
welcome {
hello
}
}
- Run gql-gen with the following codegen.yml:
schema:
- 'src/app/**/*.graphqls'
documents:
- 'src/**/*.graphql'
config: {}
generates:
src/app/graphql/queries.ts:
config: {}
plugins:
- 'typescript-common'
- 'typescript-client'
- 'typescript-apollo-angular'
watch: true
overwrite: true
require: []
Expected behavior Expected a successful merged schema with correctly generated types.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (2 by maintainers)
Top Results From Across the Web
How do you extend types in GraphQL? - Stack Overflow
Starting with the June2018 stable version of the GraphQL spec, an Object type can extend another Object type: Object type extensions are ...
Read more >Client-side schema - Apollo GraphQL Docs
Extend your schema with client-specific fields. You can optionally provide a client-side schema to Apollo Client that defines local-only types and fields. You ......
Read more >Client Schema Extensions | Relay
The Relay Compiler fully supports client-side extensions of the schema, which allows you to define local fields and types.
Read more >Extending the GraphQL schema - FastStore
Prepare files. · Create type definitions. · Create resolvers. · Get FastStore API schema. · Merge executable schemas. · Integrate with the GraphQL...
Read more >Documentation: 15: CREATE EXTENSION - PostgreSQL
CREATE EXTENSION loads a new extension into the current database. There must not be an extension of the same name already loaded. Loading...
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 FreeTop 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
Top GitHub Comments
Extension node support is added in this version of epoxy; but before we merge it could you try this canary version to make sure it is working
0.15.0-alpha.f8615088
For import syntax, I’ll check that.
@louisrli can you please try to update to latest?