Skip to content

Code-First: Multiple GraphQL Resolvers with Same Method Names but Different Field Names Cause Schema Error #3524

@vietthang

Description

@vietthang

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Multiple GraphQL Resolvers with Same Method Names but Different Field Names Cause Schema Error

Minimum reproduction code

https://github.com/vietthang/nestjs-graphql-issue-reproduce

Steps to reproduce

  1. npm install
  2. npm start
  3. The application throws the following error:
Error: User.lastName defined in resolvers, but not in schema

Expected behavior

The resolvers should be able to coexist since they resolve different fields (firstName and lastName) through the name property in their respective @ResolveField decorators.

Package version

13.0.4

Graphql version

graphql: 16.8.1
apollo-server-express: 3.13.0

NestJS version

11.0.12

Node.js version

20.18.1

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

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