Skip to content

Just a POC of a versioning system based on graphcool-framework

Notifications You must be signed in to change notification settings

fabien0102/gcf-versioning-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graphcool versioning POC

Just a little POC to add a versioning system with graphcool.

The trick is to add a beforeOperation hook that save the last state into a separate collection.

Getting started

  1. clone the repo
  2. gcf deploy
  3. gcf playground

Classic use case

Create a user

mutation {
  createUser( name: "fabien0102") {
    id
  }
}

Create a post

mutation {
  createPost(title: "test", authorId: "cjclxr2wg006b0102d50flrwn") {
    id
    title
  }
}

Update a post

mutation {
  updatePost(id: "cjclxs4vw006h0102por7sy81", title: "po po po") {
    id
    title
  }
}

Get the generated history

{
  allPosts {
    id
    author {
      id
    }
    title
    history {author {id} title}
  }
  
}

About

Just a POC of a versioning system based on graphcool-framework

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published