Open francescjaume opened 6 years ago
Hey @francescjaume, do you have more information about this example? Like what is you AdminQuery
and AdminMutation
type in your schema, or what you are trying to achieve, so we can be able to help
Hi @lpalmes, we just need resolve admin in type Query and in type Mutation too. But Go raises us that we have same function (Admin) duplicated.
Our first solution is enable two diferent root resolvers like this:
func (r* MutationResolver) Admin() *AdminMutationResolver {
return &AdminMutationResolver{}
}
func (r* QueryResolver) Admin() *AdminQueryResolver {
return &AdminQueryResolver{}
}
We fork this aproach and it works good. Maybe you have some easier solution.
Yep, the problem is that root resolvers, like the ones inside Mutation, Subscription or Query object are bound to have name collisions, given that they all resolved by func (r *Resolver)
, i think what you are doing is good and a sensible solution, in my schema at least, i try to use verbs for mutation (eg: updateUser
), and subjects for queries (users: [User]!
), and i will take into account this solution if i ever need it, thanks!
Hi!!
I have a question. I don't know how can I implements this schema:
Here the resolvers functions:
Thanks for all!!