Skip to content

Latest commit

 

History

History
62 lines (50 loc) · 935 Bytes

File metadata and controls

62 lines (50 loc) · 935 Bytes

Subkit GraphQL subscriptions API + PouchDB example

Live example

Note: This GraphQL-Subscriptions example uses the Server-Side-Events as HTTP Transport.

How to use locally

Install it and run:

npm install
npm run dev

Make GraphQL API Queries

query loadAllTodos {
  todos {
    id
    rev
    text
    isCompleted
  }
}

mutation addTodo {
  upsertTodo(input: {text: "hello world!"}) {
    id
    rev
    text
    isCompleted
  }
}

mutation removeTodo {
  deleteTodo(input: {id: "", rev: ""}) {
    id
    rev
    text
    isCompleted
  }
}

subscription onTodoChanged {
  onTodoChanged {
    id
    rev
    text
    isCompleted
  }
}

Deploy it to the cloud with DropStack

npm i -g dropstack-cli
dropstack login
dropstack deploy