Get query fields #1358
Unanswered
colotiline
asked this question in
General
Replies: 0 comments
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.
-
Hello.
I'm trying to wire up Nexus with MongoDB.
Mongo has a feature named projection (https://docs.mongodb.com/manual/reference/method/db.collection.find/#definition) which will return only required fields, so I won't waste CPU, RAM, I/O due data manipulation.
It looks obviously for me that I want to get queried fields in a resolver (Nexus) and use them in a projection (Mongo).
But I can't find queried fields.
I've looked in a resolver arguments, docs and now reading Nexus source code.
Where I can take queried fields in a resolver?
I'm understanding that I can parse request and put field in a resolver context or write a plugin, but maybe I'm missing something.
Beta Was this translation helpful? Give feedback.
All reactions