Last active
May 19, 2018 23:26
-
-
Save dupski/42c5d40bd0a6261596a143ab71579def to your computer and use it in GitHub Desktop.
Create a GraphQL API in 5 minutes - API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ModelApiManager } from 'rev-api'; | |
// Register model classes with an API Manager | |
export const api = new ModelApiManager(modelManager); | |
api.register(User, { operations: ['read', 'create'] }) | |
api.register(Post, { operations: ['read', 'create', 'update', 'remove'] }) | |
api.register(Comment, { operations: ['read', 'create', 'update', 'remove'] }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment