router icon indicating copy to clipboard operation
router copied to clipboard

docs: add `apollo_operation_id`

Open abernix opened this issue 2 years ago • 0 comments

In #3586, @o0Ignition0o introduced the apollo_operation_id — a user-accessible attribute that can be fetched from the context and used to build a durable link to the Operation page in Studio. This is useful for emitting into logs or, e.g., as an attribute on trace spans for debugging purposes. We may make this available in more places in the future!

Using two other pieces of information from the graph reference (the your-graph@current option that you run your Router with), this new apollo_operation_id value can be used to generate the full URL using the following convention:

https://studio.apollographql.com/graph/{{your_graph_id}}/variant/{{your_graph_variant}}/operations?query={{apollo_operation_id}}

Where:

  • {{your_graph_id}} (This is the part to the left of the @ sign in your "graph reference" (i.e., the your-graph part of your-graph@current)
  • {{your_graph_variant}} (This is the part to the right of the @ sign in your "graph reference" (i.e., the current part of your-graph@current)
  • {{apollo_operation_id}} this is the value read from the context's apollo_operation_id property.

No curly braces should be present in the actual URL. 😄

abernix avatar Sep 11 '23 20:09 abernix