Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@graphcms/migration

Package Overview
Dependencies
Maintainers
5
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphcms/migration

SDK for GraphCMS migrations

  • 0.0.8
  • npm
  • Socket score

Version published
Weekly downloads
15
Maintainers
5
Weekly downloads
 
Created
Source

migration

GraphCMS Migration SDK.

Usage

// import migration library
const { newMigration, FieldType } = require("@graphcms/migration")

// create a new migration for an environment
// using auth token and environment endpoint url.
const migration = newMigration({authToken, endpoint})

// create model
const author = migration.createModel({
  apiId: "Author",
  apiIdPlural: "Authors",
  displayName: "Author"
})

// add fields
author.addSimpleField({
  apiId: "firstName",
  displayName: "First Name",
  type: FieldType.String
})
author.addSimpleField({
  apiId: "lastName",
  displayName: "Last Name",
  type: FieldType.String
});

// run migration
migration.run()

Docs

SDK docs is available at https://grapchms.com/docs/sdk.

The SDK is fully typed with Typescript and IDE intellisense is expected to work as desired.

FAQs

Package last updated on 03 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc