payload-functions
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-beta.5 • Public • Published

payload-functions

This package is still very early in development, and the API is not yet stable.

yarn add payload-functions

Usage

import { $Context, Json5, Text } from 'payload-fields'

export default $: $Context => ({
  Nodes: {
    name: Text,
    subjectOf: [ $.Edges.subject ],
    objectOf: [ $.Edges.object ],
    data: Json5,
  },
  Edges: {
    name: ({ subject, predicate, object }) => `${subject.name} ${predicate} ${object.name}`,
    subject: $.Edges.subject,
    predicate: Text,
    object: $.Edges.object,
    data: Json5,
  },
})

Readme

Keywords

none

Package Sidebar

Install

npm i payload-functions

Weekly Downloads

0

Version

0.0.1-beta.5

License

MIT

Unpacked Size

43.2 kB

Total Files

48

Last publish

Collaborators

  • nathanclevenger