Is is possible to convey extensions from a subgraph?

We have a gqlgen subgraph running behind the nodejs apollo federated server (@apollo/gateway@2.3.2; @apollo/server@4.4.0). We’d like to offer some semi-structured data for certain queries in the extensions portion of the response. It works fine when we hit the subgraph server directly but apollo is apparently discarding the extensions data.

Is it possible to configure apollo to convey these data? I have reviewed the obvious integration points and haven’t found such an option yet, alas.

Yes, I was able to do this by adding it to the GraphqlContext object. Was able to append the response that i received from my subgraph to the GraphqlContext.

Then I added a plugin for “willSendResponse” that checks for the data in the GraphqlContext and add that to the response.extensions object.

Make sure to wire that plugin to your graphql server as well.