1.0.11 • Published 2 years ago

@brick-cms/cli v1.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Brick CLI

This is the command line interface for working with Brick Schemas on brick-cms.com

Installation

yarn add -D @brick-cms/cli

Getting Started

If you've just installed the CLI, you'll also want to head over to brickcms.io/signup and create an account. You can then create an API key from within your organization settings.

From there, you can take the following steps to get started:

  1. Initialize the CLI in your project
yarn brick init
  1. Add some types to your brick.graphqls schema file (or use a template):
interface Brick {
  id: String!
}

type Post implements Brick {
  id: String!
  title: String!
  # ...
}

type Query {
  posts: [Post!]!
}
  1. Run Codegen with your favorite GraphQL client like urql, or Apollo
# brick-codegen.yml
overwrite: true
schema: "https://api.brick-cms.com/my-organization"
generates:
  src/bricktypes.ts:
    plugins:
      - "typescript"
      - "typescript-operations"
    config:
      nonOptionalTypename: true
      useImplementingTypes: true
// package.json
{
  "scripts": {
    "brick codegen": "graphql-codegen --config brick-codegen.yml"
  }
}
yarn brick codegen
  1. Fetch your content!
query GetPosts {
  posts {
    title
  }
}

Documentation

For further reading, check out brick-cms.com/docs

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago