Can I get the full objectType within a middleware? #1115
-
I am adding a middleware that I would like to use the full response from a mutation. The middleware looks like the example:
The data returned from Example objectType:
Current result in the middleware:
Can I get the fully resolved object from the middleware? I am trying to get it filled out with the connected log like it returns normally:
edit: I read through the Backing Types section of the docs and understand what is going on behind the scenes but don't quite understand at what point the full backing type data is put together. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
For posterity, I was able to do this by overriding the https://github.com/graphql-nexus/nexus/blob/master/src/runtime/server/utils.ts#L44 I found the full result is spit out in https://github.com/graphql-nexus/nexus/blob/master/src/runtime/server/handler-graphql.ts#L69 |
Beta Was this translation helpful? Give feedback.
For posterity, I was able to do this by overriding the
res.end
function that is called here:https://github.com/graphql-nexus/nexus/blob/master/src/runtime/server/utils.ts#L44
I found the full result is spit out in
handler-graphql
here which then callsres.end
:https://github.com/graphql-nexus/nexus/blob/master/src/runtime/server/handler-graphql.ts#L69