Skip to content

[FEAT] don't generate resolvers for fields handled by the parent #332

Description

@laytong

When I have a series of types that implement a parent interface. I only want the field resolver to generate for the parent by default.

i.e.

interface Animal {
    id: ID!
    name: String!
    sound: String!
  }

  type Dog implements Animal {
    id: ID!
    name: String!
    sound: String!
    breed: String!
  }

  type Cat implements Animal {
    id: ID!
    name: String!
    sound: String!
    color: String!
  }

  type Query {
    animals: [Animal!]!
  }

when I generate the resolvers. I want to have a top level resolver for say sound defined on Animal
but i get empty resolvers generated for Cat and Dog and if i delete them they will just be regenerated everytime I regen for new changes.

Am i missing an existing setting or feature to handle this?

this would be exclusive to interface and implements relationships

Describe alternatives you've considered
At the moment i have to rewrite the logic in the child resolver every time.

Additional context
I am also making use of Mappers if that has any impact?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions