Skip to content

GraphQL schema/codegen fails: “Schema must contain uniquely named types … multiple types named Bool” #4611

@usama-liaqat

Description

@usama-liaqat

Describe the bug

I’m using GraphQL Code Generator against a GraphQL endpoint backed by MongooseIM (URL below). Codegen fails while loading the schema with:

Schema must contain uniquely named types but contains multiple types named "Bool".

This prevents generating TS types.

Steps to reproduce

  1. Configure GraphQL Code Generator to load schema from the endpoint(s) below.
  2. Run graphql-codegen.

Example config:

schema:
  - <uri>
generates:
  ./src/__graphql__/generated/min-types.ts:
    plugins:
      - typescript
Generate to ./src/__graphql__/generated/min-types.ts
✖ Failed to load schema from https://stage-api.nsuna.com/query,https://stage-mim.nsuna.com/api/graphql:
  Schema must contain uniquely named types but contains multiple types named "Bool".
  Error: Schema must contain uniquely named types but contains multiple types named "Bool".
  at new GraphQLSchema (.../node_modules/graphql/type/schema.js:219:15)
  at Object.mapSchema (.../node_modules/@graphql-tools/utils/cjs/mapSchema.js:15:12)
  at createWrappingSchema (.../node_modules/@graphql-tools/wrap/dist/index.cjs:87:16)
  at wrapSchema2 (.../node_modules/@graphql-tools/wrap/dist/index.cjs:82:18)
  at memoized (.../node_modules/@graphql-tools/utils/cjs/memoize.js:15:30)
  at UrlLoader.load (.../node_modules/@graphql-tools/url-loader/cjs/index.js:219:51)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions