Is there a reason why ApolloGateway doesn't forward the operationName for its subgraphs requests?

Hello everybody!

We could observe on Apollo Studio reports from our monolith, that requests flowing though Apollo Gateway doesn’t carry the operationName sent by the client. Is there a reason for that?

Hello, good question! When a federated gateway receives an incoming operation, it generates a query plan that often executes multiple smaller operations across multiple subgraphs. It sounds like in your case, your gateway is currently in front of a single monolithic subgraph. The fact that the gateway is sending your monolith an operation with the exact same shape as the incoming operation is more of a special case in federation than it is the norm, so the gateway doesn’t retain the operation name.

However, it’s still possible to see full trace metrics for each operation associated with the proper operation name! The process is just slightly different for federated graphs. See “Enabling traces” under Federated trace data.