GraphQLSwift / Graphiti

The Swift GraphQL Schema framework for macOS and Linux
MIT License
531 stars 67 forks source link

Subscription #22

Closed Nodepad closed 3 years ago

Nodepad commented 6 years ago

Are there any way to create subscription in Graphiti/GraphQL? I have found method subscription() in SchemaBuilder but could not understand how to do actual data notification.

paulofaria commented 6 years ago

Hello, sorry for the delay. We don't provide support for subscriptions. Did you go further with this attempt?

Nodepad commented 6 years ago

I've tried to find a publish/subscribe Swift library for subscription implementation, but there is not much such staff, especially built on top of Apple NIO. Do you have ideas what library should be used?

NeedleInAJayStack commented 3 years ago

Hey, I'd like to implement subscriptions into this repo and the GraphQLSwift/GraphQL repo. I'm planning to use RxSwift to provide the event streams, similar to how the Java GraphQL implementation does it.

A few questions for the maintainers:

  1. Do you forsee any significant architectural changes that will have to happen to implement the subscription event streaming into the resolvers?
  2. Do you see any large roadblocks?

Thanks!

NeedleInAJayStack commented 3 years ago

I've submitted a pull request to add subscription support: https://github.com/GraphQLSwift/Graphiti/pull/52

Thanks!

NeedleInAJayStack commented 3 years ago

Hey @paulofaria, I think with my pull requests merged, we can close this issue. Thanks!!

paulofaria commented 3 years ago

@NeedleInAJayStack thank you!