Typegoose and Type-GraphQL name confliction #1128
Unanswered
arashi-dev
asked this question in
Q&A
Replies: 1 comment 4 replies
-
You need to return |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello.
I have a problem with
FieldResolver
. It looks like type-graphql doesn't callFieldResolver
whenever the parent query (likefindProduct
) returns an object which have a property with the same name ofFieldResolver
.Sorry for my poor english.
This is my simplified code:
And the simplified product ObjectType:
and this is the error I get:
"Cannot return null for non-nullable field Color.hex."
So I changed the type-graphql colors property name to
colors2
while the typegoose colors property name was stillcolors
and it was fixed 🎉Looks like type-graphql ignores
colors FieldResolver
becausefindProduct
already has acolors
property.What do you suggest? should I have separated names or there is a cleaner way?
Beta Was this translation helpful? Give feedback.
All reactions