Skip to content

feat: add persisted query ID context key and update related functiona…#8959

Merged
faisalwaseem merged 14 commits intodevfrom
feat-pqid-context
Mar 12, 2026
Merged

feat: add persisted query ID context key and update related functiona…#8959
faisalwaseem merged 14 commits intodevfrom
feat-pqid-context

Conversation

@faisalwaseem
Copy link
Copy Markdown
Contributor

@faisalwaseem faisalwaseem commented Mar 4, 2026

feat: add persisted query ID context key and update related functionality as requested by in https://apollographql.atlassian.net/browse/TSH-22140

  • Introduced a new context key for persisted query ID in the Apollo Router.
  • Updated the PersistedQueryLayer to store the persisted query ID in the request context.
  • Enhanced the Rhai engine to utilize the new persisted query ID context key.
  • Added tests to verify the correct storage and retrieval of the persisted query ID from the context.
  • Updated documentation to reflect the new context key for persisted queries.

Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • PR description explains the motivation for the change and relevant context for reviewing
  • PR description links appropriate GitHub/Jira tickets (creating when necessary)
  • Changeset is included for user-facing changes
  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Metrics and logs are added3 and documented
  • Tests added and passing4
    • Unit tests
    • Integration tests
    • Manual tests, as necessary

Exceptions

Note any exceptions here

Notes

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. A lot of (if not most) features benefit from built-in observability and debug-level logs. Please read this guidance on metrics best-practices.

  4. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

…lity as requested by in https://apollographql.atlassian.net/browse/TSH-22140

- Introduced a new context key for persisted query ID in the Apollo Router.
- Updated the PersistedQueryLayer to store the persisted query ID in the request context.
- Enhanced the Rhai engine to utilize the new persisted query ID context key.
- Added tests to verify the correct storage and retrieval of the persisted query ID from the context.
- Updated documentation to reflect the new context key for persisted queries.
@faisalwaseem faisalwaseem requested review from a team as code owners March 4, 2026 14:32
@apollo-librarian
Copy link
Copy Markdown
Contributor

apollo-librarian bot commented Mar 4, 2026

✅ Docs preview ready

The preview is ready to be viewed. View the preview

File Changes

0 new, 3 changed, 0 removed
* graphos/routing/(latest)/customization/rhai/reference.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/enabling-telemetry/selectors.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/enabling-telemetry/spans.mdx

Build ID: f12ccd697fb4273ba4ec7979
Build Logs: View logs

URL: https://www.apollographql.com/docs/deploy-preview/f12ccd697fb4273ba4ec7979


⚠️ AI Style Review — 1 Issue Found

Summary

This pull request updates the documentation style guide with two key revisions: the 'text-formatting' section now specifies that code font must be used for all symbols appearing in code, and the 'word-and-symbol-usage' section has been updated to require the use of 'ID' (without code font) when referring to generic identifiers.

Duration: 2904ms
Review Log: View detailed log

This review is AI-generated. Please use common sense when accepting these suggestions, as they may not always be accurate or appropriate for your specific context.

@github-actions

This comment has been minimized.

Comment thread apollo-router/src/services/layers/persisted_queries/mod.rs
faisalwaseem and others added 4 commits March 4, 2026 11:56
- Updated the context key from `PERSISTED_QUERY_ID` to `PERSISTED_QUERY_ID_KEY` in the Rhai engine and corresponding documentation.
- Ensured that all references to the persisted query ID context key are consistent across the codebase and documentation.
- Changed the import of the persisted query ID context key from `PERSISTED_QUERY_ID_KEY` to `PERSISTED_QUERY_ID` for consistency with recent updates.
…gine

- Updated the global variable reference for the persisted query ID context key from `PERSISTED_QUERY_ID_KEY` to `PERSISTED_QUERY_ID` to maintain consistency with recent changes.
Copy link
Copy Markdown
Contributor

@rohan-b99 rohan-b99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, I think we just need a changeset

Comment thread .changesets/feat_feat_pqid_context.md Outdated
Comment thread .changesets/feat_feat_pqid_context.md Outdated
Comment thread .changesets/feat_feat_pqid_context.md Outdated
Comment thread docs/source/routing/customization/rhai/reference.mdx Outdated
faisalwaseem and others added 5 commits March 10, 2026 13:35
Co-authored-by: rohan-b99 <43239788+rohan-b99@users.noreply.github.com>
Co-authored-by: rohan-b99 <43239788+rohan-b99@users.noreply.github.com>
Co-authored-by: rohan-b99 <43239788+rohan-b99@users.noreply.github.com>
Co-authored-by: rohan-b99 <43239788+rohan-b99@users.noreply.github.com>
@faisalwaseem faisalwaseem merged commit d0f43c1 into dev Mar 12, 2026
15 checks passed
@faisalwaseem faisalwaseem deleted the feat-pqid-context branch March 12, 2026 14:33
smyrick pushed a commit that referenced this pull request Mar 17, 2026
#8959)

Co-authored-by: Michelle Mabuyo <michelle@apollographql.com>
Co-authored-by: rohan-b99 <43239788+rohan-b99@users.noreply.github.com>
smyrick pushed a commit that referenced this pull request Mar 20, 2026
#8959)

Co-authored-by: Michelle Mabuyo <michelle@apollographql.com>
Co-authored-by: rohan-b99 <43239788+rohan-b99@users.noreply.github.com>
@abernix abernix mentioned this pull request Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants