Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'extensions' to request #976

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open

Conversation

benjie
Copy link
Member

@benjie benjie commented Aug 1, 2022

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 to graphql(): https://github.com/graphql/graphql-js/blob/699ec58547c34bfeef866a2a4458615d39b16964/src/graphql.ts#L20-L68 . Nor does express-graphql look at extensions on a request as far as I can tell.

@netlify
Copy link

netlify bot commented Aug 1, 2022

Deploy Preview for graphql-spec-draft ready!

Name Link
🔨 Latest commit 5cd2861
🔍 Latest deploy log https://app.netlify.com/sites/graphql-spec-draft/deploys/66106d44817d680008700dde
😎 Deploy Preview https://deploy-preview-976--graphql-spec-draft.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

yaacovCR and others added 21 commits September 1, 2022 12:38
Co-authored-by: Roman Ivantsov <roman.ivantsov@microsoft.com>
Co-authored-by: Benjie Gillam <benjie@jemjie.com>
Co-authored-by: Roman Ivantsov <roman.ivantsov@microsoft.com>
…pe (graphql#974)

* Fix: implementing field type is either exact match or covariant type

* Match language in IsValidImplimentation

Co-authored-by: Roman Ivantsov <roman.ivantsov@microsoft.com>
Co-authored-by: Lee Byron <lee@leebyron.com>
…non-repeatable directives (graphql#975)

* Fixed the explanatory text for algorithm checking uniqueness of non-repeatable directives

* lint

* lint fixes

Co-authored-by: Roman Ivantsov <roman.ivantsov@microsoft.com>
Co-authored-by: Lee Byron <lee@leebyron.com>
field merging - field TYPES must not differ

Co-authored-by: Roman Ivantsov <roman.ivantsov@microsoft.com>
Co-authored-by: Benjie <benjie@jemjie.com>
Co-authored-by: Lee Byron <lee@leebyron.com>
This does a few things to simplify testing and CI:

* `npm test` locally will now include format checking, which previously
  it did not. This means if you run `npm test` locally you can be fairly
  sure that CI will pass.
* Broke out CI jobs to run all test sub-steps in parallel. This should
  make it a little easier to understand why a PR failed CI.
* Remove the dedicated prettier workflow (in favor of the one in
  test/CI)
* Updates prettier and action versions
Co-authored-by: Benjie Gillam <benjie@jemjie.com>
Clarify that a schema definition must be present (and not omitted) if a default root type name happens to be used by a type which is not a root type.

Also adds an editorial change to introduce term definitions for the immediate concepts involved.

Co-authored-by: Lee Byron <lee@leebyron.com>
…raphql#1009)

Adds how to contribute custom scalar specs, links to spec templates, and adds examples following the launch of https://scalars.graphql.org

Co-authored-by: Benjie <benjie@jemjie.com>
Co-authored-by: Benjie <benjie@jemjie.com>
Co-authored-by: Roman Ivantsov <roman.ivantsov@microsoft.com>
@benjie benjie added the 💭 Strawman (RFC 0) RFC Stage 0 (See CONTRIBUTING.md) label Mar 7, 2024
* Consistent punctuation in algorithms

* Clarify style guide

* Boolean formatting

* Add a format check to CI
@benjie
Copy link
Member Author

benjie commented Mar 7, 2024

Conclusion from the latest working group meeting is that we should be more explicit about all of the things in request. This was also one of the options laid out by Lee back in 2022:

https://github.com/graphql/graphql-wg/blob/623a7bc464406509e0cf41c847e4e4322d577764/notes/2022/2022-09-01.md?plain=1#L146-L148

Lee: Benjie seems like you have two options: 1) extension may exist, be aware
of it 2) improve section and do a better job of defininging the input to an
execution.

@benjie benjie added 💡 Proposal (RFC 1) RFC Stage 1 (See CONTRIBUTING.md) and removed 💭 Strawman (RFC 0) RFC Stage 0 (See CONTRIBUTING.md) labels Mar 7, 2024
@benjie
Copy link
Member Author

benjie commented Mar 7, 2024

(It was agreed that this was something that we probably should have in the spec though. Although not explicitly stated as such, I've moved it to RFC1.)

benjie and others added 5 commits March 20, 2024 11:44
* Be strict about error paths

* Update spec/Section 7 -- Response.md

Co-authored-by: Benjie <benjie@jemjie.com>

* format

---------

Co-authored-by: Benjie <benjie@jemjie.com>
…es (graphql#1032)

* Define selection set

* Consistent casing of 'selection set'

* Convert an example to a mutation operation

* Add operation name and variables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 Proposal (RFC 1) RFC Stage 1 (See CONTRIBUTING.md)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants