Skip to content

Import Fails to Import Interface of Union's Types Across Multiple Files #5436

@tlivings

Description

@tlivings

Issue workflow progress

Progress of the issue based on the
Contributor Workflow

  • 1. The issue provides a reproduction available on Github, Stackblitz or CodeSandbox
  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

Describe the bug

Note: I am reporting a bug but have not been able to reproduce in an isolated fashion yet.
See https://github.com/tlivings/graphql-tools/tree/reproduce-5436 failing test.

Attempting to load schema using the GraphQLFileLoader and import statements.

Use case: A type's field is a union of types that implement interfaces.

Error: Unknown type "XXXX". Did you mean "XXXXXX", ...?
          at assertValidSDL (xxxx/node_modules/graphql/validation/validate.js:135:11)
          at buildASTSchema (xxxx/node_modules/graphql/utilities/buildASTSchema.js:44:34)
          at makeExecutableSchema (xxxx/node_modules/@graphql-tools/schema/cjs/makeExecutableSchema.js:73:47)
          at mergeSchemas (xxxx/node_modules/@graphql-tools/schema/cjs/merge-schemas.js:32:63)
          at getSchemaFromSources (xxxx/node_modules/@graphql-tools/load/cjs/schema.js:57:46)
          at loadSchema (xxxx/node_modules/@graphql-tools/load/cjs/schema.js:19:12)

To Reproduce Steps to reproduce the behavior:

See the failing test case for https://github.com/tlivings/graphql-tools/tree/reproduce-5436.

Expected behavior

Environment:

  • @graphql-tools/load: 7.8.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions