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 createSourceEventStream? #74

Closed
mattkrick opened this issue Feb 11, 2020 · 7 comments · Fixed by #115
Closed

Support createSourceEventStream? #74

mattkrick opened this issue Feb 11, 2020 · 7 comments · Fixed by #115

Comments

@mattkrick
Copy link

Wonderful package, lots to learn from, thank you for open sourcing it!

Any plans to support createSourceEventStream for subscriptions? Any tips on how I'd go about PRing it?

@ruiaraujo
Copy link
Collaborator

We dont have a use case but I took a look at the spec and the graphql-js implementation and it doesn't seem too difficult.

My advice is start with an iterative approach where we use createSourceEventStream from graphql-js and implement just the subscribe function. It is different enough that warrants its own top level entry for compilation like it is a separate execution function.

Later the createSourceEventStream can also be reimplemented. We took the same approach to variable parsing which were introduced much later.

We definitely welcome PRs and will help you go along. TDD is a good approach and copy pasting tests from graphql-js is acceptable. Our license already reflects the policy.

@hoangvvo
Copy link
Contributor

hoangvvo commented Sep 3, 2020

For anyone wondering, I'm experimenting with subscription in my fork at https://github.com/hoangvvo/graphql-jit (PR)

It is currently passing all tests from https://github.com/graphql/graphql-js/blob/master/src/subscription/subscribe.js excepts one weird one at resolves to an error for source event stream resolver errors (I verified the the error object has the same shape but it fails to compare for some reason :/) (maybe @ruiaraujo can help me with this if possible)

There is one deep import at graphql/subscription/mapAsyncIterator but it should be easily reimplemented.

I'm using it in production right now (via @benzene/ws) and do not see any problem yet.

Will make a PR to this repo if it seems ok.

@ruiaraujo
Copy link
Collaborator

Opening a PR would be nice. ❤️

@RichardWright
Copy link

@hoangvvo How's the pr coming? Would love to give this a go via the main package.

@hoangvvo
Copy link
Contributor

@RichardWright Hey, sorry I could not find the time for this lately, but hopefully I can find some this weekend to work on it!

@RichardWright
Copy link

@hoangvvo is there anything anyone can do to help?

@hoangvvo
Copy link
Contributor

@RichardWright You can help reviewing this PR #115. Thanks!

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 a pull request may close this issue.

4 participants