Skip to content

In test environment, Error: Schema must contain uniquely named types but contains multiple types #3595

@zfanta

Description

@zfanta

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Minimum reproduction code has two packages apps/api and packages/prisma. packages/prisma use prisma-nestjs-graphql.
Test environment uses vitest. In test environment, all tests fail with Error: Schema must contain uniquely named types but contains multiple types named "LocalDate".

Minimum reproduction code

https://github.com/zfanta/nest-graphql-error

Steps to reproduce

  1. pnpm i
  2. pnpm run dev:api (fine)
  3. pnpm run test (error)

Expected behavior

No schema error in test environment

Package version

13.0.2

Graphql version

graphql: 16.10.0
@apollo/server: 4.11.3

NestJS version

11.0.7

Node.js version

22.14.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

pnpm: 10.4.1

In test environment, !typeSet.has(namedType) is true. in dev environment !typeSet.has(namedType) is false

Image Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions