cope-client-utils

CRUD utilities and types for the COPE platform

Usage no npm install needed!

<script type="module">
  import copeClientUtils from 'https://cdn.skypack.dev/cope-client-utils';
</script>

README

COPE Client Utils

JavaScript utilities for using the COPE CMS

Getting Started

Installation

npm i cope-client-utils

Configuration

import { configureWith } from "cope-client-utils"
import aws_exports from "./aws-exports"

configureWith(aws_exports)

Using the Utilities

Most of the utilities are for sending CRUD operations to the graphql API

Nodes

import { node, API } from "cope-client-utils"

const node = async ({ id, status, type, createdAt, owner, updatedAt }: API.CreateNodeInput) => {
    const new_node = await node.create({ id, status, type, createdAt, owner, updatedAt })
    return new_node
}