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

Support Extensions in Response #334

Merged
merged 2 commits into from
Sep 17, 2018
Merged

Conversation

mathewbyrne
Copy link
Contributor

@mathewbyrne mathewbyrne commented Sep 7, 2018

The GraphQL spec allows for an extensions key to be provided in responses to allow the server to extend responses however they see fit.

This change adds support for this key in responses, and allows code with access to the RequestContext to add values to this map using the RegisterExtension method. The intended usage is for a RequestMiddleware to register a value once, either at the start of a request and pass the value around, or at the end of a request. An error will be returned if a key is registered twice.

The current primary use-case for this is Apollo Tracing (#219) — which this PR will assist with.

@mathewbyrne mathewbyrne merged commit 2bd1cc2 into master Sep 17, 2018
@vektah vektah deleted the support-response-extensions branch October 3, 2018 00:32
cgxxv pushed a commit to cgxxv/gqlgen that referenced this pull request Mar 25, 2022
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.

1 participant