Hi, is there way to know which field is required i...
# orm-help
h
Hi, is there way to know which field is required in response of query in resolver function logic? So i can use projection in mongoose and get only those field.
r
You can use the
info
object on your resolver to get the required fields.
h
last argument right?
r
Yeah. Also have a look at this library that will make it easier to fetch the fields.
👀 1
h
is it compatible with graphql-yoga library?
r
Yeah it should be as it only uses the
info
object on your resolver.
h
Ok Thanks i will look.
💯 1