Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using the "extend" keyword only, types aren't automatically imported #589

Open
antogyn opened this issue May 12, 2020 · 0 comments
Open

Comments

@antogyn
Copy link

antogyn commented May 12, 2020

Hey,

When using extend with a type, if it isn't anywhere in the schema without extend, input and return types used in its fields and the type itself aren't in the final schema unless explicitly imported.

This is a problem in federated services which sometimes only extend certain types.

# query.graphql
extend type Query {
  test: Test
}

type Test {
  ok: Boolean
}
# schema.graphql

# import Query from "query.graphql"

schema after importing schema.graphql (Test is absent):

extend type Query {
  test: Test!
}

Adding type Query { anyField: AnyType } anywhere produces a valid schema, but also drops the extend keyword

Other import methods:

# import Query.* from "query.graphql"

Same result

# import "query.graphql"
# import * from "query.graphql"

The Query type is not present at all (so in the exemple, it throws because it's an empty schema)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant