Skip to content

Support Persisted Operations on the JavaScript GraphqlClientIntegration SDK #18499

Closed

Description

@TBeeren

Problem Statement

Problem

The graphqlClientIntegration currently only extracts operation information from the query field in GraphQL requests. This means persisted operations aren't tracked - a common production optimization where clients send only operationName and a hash instead of the full query string.

Current behavior:
✅ Request with query: Creates span with operation name
❌ Request with persisted operation (no query field): No span created or missing operation details
Example persisted operation request:

{
  "operationName": "GetUser",
  "variables": { "id": "123" },
  "extensions": {
    "persistedQuery": {
      "version": 1,
      "sha256Hash": "abc123..."
    }
  }
}

Use Case

We're using this in production at a large e-commerce platform with 100+ frontend developers. Persisted operations reduce payload size and improve security. This change gives us both benefits.

Solution Brainstorm

Solution

  1. Detect persisted operations: Check for operationName when query is missing
  2. Create descriptive span names: Use "persisted {operationName}" format
  3. Add operation attribute: Store operation name without the full query body
  4. Maintain backward compatibility: Normal query-based requests work exactly as before

Changes:

  • Extract operation name from request body when query field is absent
  • Add span attribute for operation name on persisted queries
  • Update span description to indicate persisted operations

Additional Context

No response

Priority

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Activity

  1. linear commented on Dec 15, 2025

    @linear
  2. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Dec 15, 2025
  3. andreiborza commented on Dec 15, 2025

    @andreiborza
    Member

    Hi @TBeeren, thanks for filing this.

    This sounds reasonable to me, I'll give it a go.

  4. self-assigned this
    on Dec 15, 2025
  5. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Dec 15, 2025
  6. TBeeren commented on Dec 15, 2025

    @TBeeren
    ContributorAuthor

    Hi @andreiborza, awesome! I actually already created a patch for our internal systems. I can share it on here so you can use it aswel to base an MR/PR on. Or, go with this one 😄

  7. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Dec 15, 2025
  8. andreiborza commented on Dec 15, 2025

    @andreiborza
    Member

    @TBeeren cool, if you want you could also contribute this as a PR and I can review it and take over testing for example. Let me know :)

  9. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Dec 15, 2025
  10. TBeeren commented on Dec 15, 2025

    @TBeeren
    ContributorAuthor

    @andreiborza Awesome, here you go:
    #18505

    I'll also do some integration testing within our apps based on this version/ source.

  11. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Dec 15, 2025
  12. andreiborza commented on Dec 15, 2025

    @andreiborza
    Member

    @TBeeren this'll probably go out tomorrow fyi.

  13. added a commit that references this issue on Dec 15, 2025
    d1b86bd
  14. added a commit that references this issue on Dec 15, 2025
    6bc9ee5
  15. TBeeren commented on Dec 16, 2025

    @TBeeren
    ContributorAuthor

    @andreiborza That's amazing! I'm blown away by the speed and pro-activeness on this. I'll keep an eye and make sure to be the first one installing the update when it's there 😉 Big kudos to you and the team, really happy with this.

  16. github-actions commented on Dec 16, 2025

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #18505, which was included in the 10.31.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions