1.0.11 • Published 10 months ago

@brick-cms/cli v1.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months 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

10 months ago

1.0.10

10 months ago

1.0.9

11 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago