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.

extend type for local schema not working.

See original GitHub issue

Describe 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:

  1. 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
}
  1. Use the following document:
query getWelcomeGreet {
  welcome {
    hello
  }
}
  1. 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ardatancommented, Nov 26, 2018

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.

0reactions
dotansimhacommented, Mar 8, 2020

@louisrli can you please try to update to latest?

Read more comments on GitHub >

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

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