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

Resolver return type requires unnecessary properties #2665

mastilver opened this issue Oct 2, 2019 · 2 comments


Copy link

commented Oct 2, 2019

Describe the bug


I'm not sure if it's even possible
A resolver type requires me to add property to an object when it's being handle by another resolver
For example I have

  • a user resolver that only send firstName and lastName
  • a fullName resolver on the User object

the user resolver type still requires me to return fullName

To Reproduce

Expected behavior

The type for the user resolver not to include fullName
The only way I can see this issue resolved is by looking at the resolvers object by I might be missing something and it's already possible?

Thank you


This comment has been minimized.

Copy link

commented Oct 2, 2019

So, your entity type has firstName and lastName. You should define a type like below,,

export interface UserEntity {
   firstName: string;
   lastName: string;

then use mappers field inside codegen.yml;

    User: ./user-entity#UserEntity

User type belongs to GraphQL Schema but UserEntity is something else you returned from db or other data source.

@ardatan ardatan closed this Oct 2, 2019
@ardatan ardatan added the question label Oct 2, 2019

This comment has been minimized.

Copy link

commented Oct 2, 2019

Thank you for the quick answer! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.