Skip to content

Can I have a common resolver for multiple interface implementations? #3725

@ggarnier

Description

@ggarnier

I have a schema like this:

interface Result {
    title: String!
    description: String! @goField(forceResolver: true)
}

type Book implements Result {
    title: String!
    description: String! @goField(forceResolver: true)
    author: String!
    # ... other fields
}

type Article implements Result {
    title: String!
    description: String! @goField(forceResolver: true)
    section: String!
    # ... other fields
}

When I run the generator, it generates bookResolver and articleResolver, each one with its description field resolver. Is there a way I can generate a common resultResolver for them?

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions