Skip to content

Instantly share code, notes, and snippets.

View kurumai's full-sized avatar

Noboru Kurumai kurumai

View GitHub Profile
@kurumai
kurumai / Event-stream based GraphQL subscriptions.md
Created September 5, 2017 10:05 — forked from OlegIlyenko/Event-stream based GraphQL subscriptions.md
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

@kurumai
kurumai / graphql_sample.gql
Created September 4, 2017 06:27
GraphQL sample
# try at GitHub GraphQL explorer (https://developer.github.com/v4/explorer/)
{
search(query: "Fujitsu K5", type: REPOSITORY, first: 5) {
repositoryCount
edges {
node {
... on Repository {
name,
url,