99designs/gqlgen
View on GitHubCan I have a common resolver for multiple interface implementations?
Open
#3,725 opened on Jun 6, 2025
help wanted
Repository metrics
- Stars
- (10,737 stars)
- PR merge metrics
- (PR metrics pending)
Description
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?