Apollo-server: undefined variables in args parameter in formatResponse function

Created on 6 Dec 2018  路  3Comments  路  Source: apollographql/apollo-server

server : apollo-server-koa v2.2.6

when i upgrade apollo-server-koa from 2.0.7 to 2.2.6 some variables in "args" parameter in "formatResponse" function got undefined
before i can get variables like "queryString", "variables", "operationName", etc..
now inside "args" i only found context

demo : https://codesandbox.io/s/pw4knpl0rj

Most helpful comment

can confirm apollo-server-express v2.3.1

All 3 comments

can confirm apollo-server-express v2.3.1

For anyone coming to this issue, you can use the 'graphql-middleware' package to do anything that you were doing in the formatResponse function.

https://github.com/apollographql/apollo-server/issues/1603#issuecomment-422035502

The args parameter in formatResponse exposed implementation details that aren't part of the new request pipeline. You should be able to use the willSendResponse hook in the plugin API to get access to the same information however.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stevezau picture stevezau  路  3Comments

leinue picture leinue  路  3Comments

jpcbarros picture jpcbarros  路  3Comments

Magneticmagnum picture Magneticmagnum  路  3Comments

veeramarni picture veeramarni  路  3Comments