Closed tasoskakour closed 2 years ago
I think it is better to write your resolver manually without using unclear wrappers and resolvers.
The resolver will be a custom one, and I'm fine by it, I already made it work. However I have trouble with setting the resolver type by recomposing the RootTC (I don't want to write it by hand because it kinda miss the purpose of this library).
If you change the type internals (some field inside it) it must have another name. So you need clone type with a new name, modify it and use it in your resolver.
Hey all!
My Schema:
What I want to achieve?
I want to create a mutation, let's call it
getCommentById
where I need to fetch a particular comment by comment._id and return a that comment. So the return type of the resolver must beComment
(non plural).The resolver will be a custom one, and I'm fine by it, I already made it work. However I have trouble with setting the resolver
type
by recomposing the RootTC (I don't want to write it by hand because it kinda miss the purpose of this library).Technically what I want to do is to get
posts.comments
field fromRootSchema
andmakeItNonPlural
without modifying the initial RootTC object.My Code:
Any help is appreciated! :-)