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

feat: add support for post requests for SSE #1122

Merged

Conversation

Ancient-Dragon
Copy link
Contributor

Pull request checklist

  • Please read our contributor guide
  • Consider creating a discussion on the discussion forum
    first
  • Make sure the PR doesn't introduce backward compatibility issues
  • Make sure to have sufficient test cases - hopefully because this is just changing the request handler I am ok. Let me know if another test is needed although I may need some help. (I tested locally using the graphql-sse library and can provide proof if needed.

Pull Request type

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Changes in this PR

Change existing sse subscriptions to be a get request handler and move common code into a new method then add a post request handler which calls the same code.

Describe the new behavior from this PR, and why it's needed
Issue #236 - the ask was to add documentation but it looks like the feature isn't properly supported. I've added support for post requests (which will probably be the most common usecase)

Alternatives considered

Describe alternative implementation you have considered

@Ancient-Dragon
Copy link
Contributor Author

Result using this in altair (with subscriptions using sse):
Screenshot 2022-06-28 at 18 32 26
Screenshot 2022-06-28 at 18 31 36

Copy link
Contributor

@berngp berngp left a comment

Choose a reason for hiding this comment

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

Thank you for the pr!

@Ancient-Dragon
Copy link
Contributor Author

Thanks for approving, when do you think this'll be merged and released? I was hoping to use in our project fairly soon.

@berngp berngp merged commit f3eadcc into Netflix:master Jul 2, 2022
@berngp
Copy link
Contributor

berngp commented Jul 2, 2022

@Ancient-Dragon next few days.

@Ancient-Dragon
Copy link
Contributor Author

Great many thanks!

@berngp
Copy link
Contributor

berngp commented Jul 2, 2022

Release v5.0.5 should be out soon.

@srinivasankavitha
Copy link
Contributor

@Ancient-Dragon - thanks very much for your contribution. Would you also be able to update the documentation if you have time? It would greatly help us. If not, no worries, we will take care of it.

@Ancient-Dragon
Copy link
Contributor Author

Hi @srinivasankavitha I have created the PR here: Netflix/dgs#100

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.

3 participants