Get query fields #1358
Replies: 1 comment
-
|
Puedes acceder a los campos consultados a través del objeto Muchos usuarios utilizan Es importante tener en cuenta que Nexus no abstrae este proceso, ya que forma parte de la ejecución de GraphQL, no de Nexus específicamente. Por lo tanto, no te estás perdiendo ninguna función auxiliar oculta de Nexus. El enfoque estándar consiste en leer los campos de |
Beta Was this translation helpful? Give feedback.
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