Postgraphile: Subscriptions example

Created on 11 May 2016  路  3Comments  路  Source: graphile/postgraphile

Where can I find a sample implementation of subscriptions?
In the GraphQL blog it is too much theoretical... at least for my preparation.

Cheers.

All 3 comments

Hey @giacomorebonato

Subscriptions are still in the very early stages, and you're right - there isn't a lot of documentation around them.

I suppose you'd like to use them as a real-time API? There's a few steps necessary to achieve that:

  • trigger a NOTIFY command in postgres on INSERT/UPDATE/DELETE
  • attach some kind of listener (e.g. pg-pubsub or pgsql-listen-exchange (via RabbitMQ))
  • create a Websocket server that handles subscriptions and updates

As you can see, that goes over and above the scope of this project. If you decide to go down that route, I'd be curious as to what your experiences are.

You can also follow https://github.com/facebook/graphql/pull/109 which is the unmerged spec to the GraphQL language supporting subscriptions 馃槉

Was this page helpful?
0 / 5 - 0 ratings

Related issues

outsidenote picture outsidenote  路  4Comments

angelosarto picture angelosarto  路  3Comments

5argon picture 5argon  路  4Comments

tonyhschu picture tonyhschu  路  3Comments

calebmer picture calebmer  路  3Comments