Skip to content

feat: add support for post requests for SSE - #1122

Merged
berngp merged 1 commit into
Netflix:masterfrom
Ancient-Dragon:feature/sse-post-subscriptions
Jul 2, 2022
Merged

feat: add support for post requests for SSE#1122
berngp merged 1 commit into
Netflix:masterfrom
Ancient-Dragon:feature/sse-post-subscriptions

Conversation

@Ancient-Dragon

Copy link
Copy Markdown
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
Copy Markdown
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

@berngp berngp left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

berngp commented Jul 2, 2022

Copy link
Copy Markdown
Contributor

@Ancient-Dragon next few days.

@Ancient-Dragon

Copy link
Copy Markdown
Contributor Author

Great many thanks!

@berngp

berngp commented Jul 2, 2022

Copy link
Copy Markdown
Contributor

Release v5.0.5 should be out soon.

@srinivasankavitha

Copy link
Copy Markdown
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
Copy Markdown
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