redink-schema

0.0.3 • Public • Published

redink-schema

Simple class for building Redink schemas.

import schema, { hasMany, hasOne, belongsTo } from 'redink-schema';

const user = schema('user', {
  attributes: {
    name: true,
    email: true,
  },
  relationships: {
    blogs: hasMany('blog', 'author'),
  },
});

const blog = schema('blog', {
  attributes: {
    title: true,
    content: true,
    createdOn: true,
  },
  relationships: {
    author: belongsTo('user', 'blogs'),
  },
});

Readme

Keywords

none

Package Sidebar

Install

npm i redink-schema

Weekly Downloads

2

Version

0.0.3

License

MIT

Last publish

Collaborators

  • dcslack