When returning a response to a subscription document, only the transformed data from the remote schema is returned.
This is a problem when the remote schema populates the websocket connection and channel subscription information in the extensions field of the response. I ran into this when attempting to merge a remote AWS AppSync schema into my Apollo Server lambda implementation. The way AWS AppSync implements subscriptions is via their IoT MQTT services. That is, when a request for a subscription comes in, as part of the response, it includes all the information _(such as the wss url, credentials, and channel metadata) in the extensions field in the response. AWS then provides a [SubscriptionHandshakeLink](
https://github.com/awslabs/aws-mobile-appsync-sdk-js/blob/master/packages/aws-appsync/src/link/subscription-handshake-link.ts) in their AppSync SDK that uses this information to extablish the websocket connection.
Without the extensions field being passed back up in the response, the client never receives the connection information.
This issue affects not only subscriptions, but also things like errors
https://github.com/graphql-binding/graphql-binding/issues/173
extensions field is missing when executing GraphQL operations like in https://github.com/graphql-binding/graphql-binding package which also uses delegateToSchema. As a result some sensitive information like Apollo error codes and other parameters stored in extensions are not retrieved when the operation is executed.
See implementation in #969 using a link.
Most helpful comment
This issue affects not only subscriptions, but also things like errors
https://github.com/graphql-binding/graphql-binding/issues/173
extensionsfield is missing when executing GraphQL operations like in https://github.com/graphql-binding/graphql-binding package which also usesdelegateToSchema. As a result some sensitive information like Apollo error codes and other parameters stored inextensionsare not retrieved when the operation is executed.