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'),
  },
});

Dependencies (0)

    Dev Dependencies (15)

    Package Sidebar

    Install

    npm i redink-schema

    Weekly Downloads

    0

    Version

    0.0.3

    License

    MIT

    Last publish

    Collaborators

    • dcslack