Add 'extensions' to request
At a glance​
- Identifier: #976
- Stage: RFC2: Draft
- Champion: @benjie
- PR: Add 'extensions' to request
Timeline​
- Added to 2025-01-09 WG agenda
- 3 commits pushed on 2024-12-12:
- Reword by @benjie
- Reword again by @benjie
- Reword once more by @benjie
- Added to 2024-12-05 WG agenda
- Mentioned in 2024-12 WG notes
- Added to 2024-07-18 WG agenda
- Mentioned in 2024-07 WG notes
- 2 commits pushed on 2024-04-04:
- Added to 2024-04-04 WG agenda
- Mentioned in 2024-04 WG notes
- Commit pushed: Be more explicit about the data that makes up a GraphQL request on 2024-03-27 by @benjie
- Commit pushed: ID must always serialize as String would (#1086) on 2024-03-20 by @benjie
- 2 commits pushed on 2024-03-07:
- Added to 2024-03-07 WG agenda
- Mentioned in 2024-03 WG notes
- Commit pushed: Fix punctuation in some algorithms (#1067) on 2023-12-14 by @yaacovCR
- Commit pushed: Fix heading level for Required Arguments validation rule (#1055) on 2023-11-10 by @goto-bus-stop
- Commit pushed: Add explicit definition for BlockString (#1042) on 2023-09-08 by @benjie
- Commit pushed: Remove "subscriptions is a significant change" sentence (#983) on 2023-07-08 by @rivantsov
- Commit pushed: Clarify that selection sets cannot be empty (#1025) on 2023-05-19 by @benjie
- Commit pushed: Add links to contributed custom scalar specs at scalars.graphql.org (… on 2023-02-11 by @dondonz
- Commit pushed: Fix ambiguity around when schema definition may be omitted (#987) on 2023-02-09 by @benjie
- Commit pushed: add explanation about argument name uniqueness. (#891) on 2023-02-02 by @dugenkui03
- Commit pushed: Fix operator precedence in test:format (#1008) on 2023-01-13 by @yaacovCR
- 4 commits pushed on 2023-01-12:
- Commit pushed: Add a style guide to the specification (#1003) on 2023-01-06 by @benjie
- 4 commits pushed on 2023-01-05:
- Commit pushed: Provide explicit ref to Value Completion section (#982) on 2022-12-08 by @rivantsov
- Commit pushed: Changed 'must NOT BE' to 'must not be' (#980) on 2022-12-07 by @rivantsov
- Commit pushed: separate out IsSubType from IsValidImplementationFieldType (#977) on 2022-09-01 by @yaacovCR
- Added to 2022-09-01 WG agenda
- Mentioned in 2022-09-01 WG notes
- Added to 2022-08-04 WG agenda
- Mentioned in 2022-08-04 WG notes
- Spec PR created on 2022-08-01 by benjie
- Commit pushed: Add 'extensions' to request on 2022-08-01 by @benjie
It's common in the ecosystem to use
extensions
on a GraphQL request to share additional information with the server; for example Apollo Persisted Queries uses it to indicate the hash of the document to execute.Currently the GraphQL Spec specifies an "extensions" field on Response but not on Request; I'm trying to determine if this is a purely transport-level concern (i.e. should be specified in GraphQL-over-HTTP, etc), or if it should be specified in the spec proper. IMO the spec should have at least a note indicating the use of the "extensions" field.
The specification of the format of a request is somewhat fuzzier than the format of a response; this is not unexpected because GraphQL is so flexible in how it is consumed, and persisted operations/etc should be spec compliant without having to be specified therein. So the request doesn't really speak of specific keys, more here's the information we need to execute, and "extensions" is not amongst that information. Nonetheless, standardising extensions as a key for expansion would be beneficial to the community.
It's worth noting that GraphQL.js does not include
extensions
amongst the arguments tographql()
: https://github.com/graphql/graphql-js/blob/699ec58547c34bfeef866a2a4458615d39b16964/src/graphql.ts#L20-L68 . Nor does express-graphql look atextensions
on a request as far as I can tell.