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

fix(GraphQL): Pass on HTTP request headers for subscriptions #7806

Merged
merged 5 commits into from
May 11, 2021

Conversation

abhimanyusinghgaur
Copy link
Contributor

@abhimanyusinghgaur abhimanyusinghgaur commented May 11, 2021

This PR passes the HTTP headers for a subscription request using the RequestHeader context key to the Subscribe call.
Earlier, the Header key in the context supported passing the headers to the Subscribe call, but that required one to send an init request for the subscription with the init payload being set to a JSON object representing the Header.
It is not possible in Dgraph cloud to modify the request payload, so we need to make this change.

Later, we should find one permanent fix for passing the HTTP headers for subscriptions. Also, our port of the graphql-transport-ws lib is far behind the source, so we should update that at some point.


This change is Reviewable

@github-actions github-actions bot added the area/graphql Issues related to GraphQL support on Dgraph. label May 11, 2021
@abhimanyusinghgaur abhimanyusinghgaur changed the title fix(GraphQL): return as soon as error is encountered fix(GraphQL): Pass on HTTP request headers for subscriptions May 11, 2021
@aman-bansal aman-bansal merged commit 042d35c into master May 11, 2021
@aman-bansal aman-bansal deleted the abhimanyu/missing-error branch May 11, 2021 15:51
aman-bansal added a commit that referenced this pull request May 11, 2021
* return as soon as error is encountered

* fix comment

* add more logs

* fixing the http request header to be set in the subscription

* fixing header type cast

Co-authored-by: aman-bansal <bansalaman2905@gmail.com>
aman-bansal added a commit that referenced this pull request May 11, 2021
…7807)

* return as soon as error is encountered

* fix comment

* add more logs

* fixing the http request header to be set in the subscription

* fixing header type cast

Co-authored-by: aman-bansal <bansalaman2905@gmail.com>

Co-authored-by: Abhimanyu Singh Gaur <12651351+abhimanyusinghgaur@users.noreply.github.com>
all-seeing-code pushed a commit that referenced this pull request Jan 4, 2023
…7807)

* return as soon as error is encountered

* fix comment

* add more logs

* fixing the http request header to be set in the subscription

* fixing header type cast

Co-authored-by: aman-bansal <bansalaman2905@gmail.com>

Co-authored-by: Abhimanyu Singh Gaur <12651351+abhimanyusinghgaur@users.noreply.github.com>
(cherry picked from commit dbd5744)
all-seeing-code added a commit that referenced this pull request Jan 5, 2023
…7807) (#8574)

Include headers from subscribe request and pass it along the downstream
for processing.

Co-authored-by: aman-bansal <bansalaman2905@gmail.com>

Co-authored-by: Abhimanyu Singh Gaur
<12651351+abhimanyusinghgaur@users.noreply.github.com>
(cherry picked from commit dbd5744)

Co-authored-by: aman bansal <bansalaman2905@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/graphql Issues related to GraphQL support on Dgraph.
Development

Successfully merging this pull request may close these issues.

2 participants