Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Command Line Tools for Slash GraphQL

Notifications You must be signed in to change notification settings

newsela/slash-graphql-cli

Repository files navigation

slash-graphql

Manage Slash GraphQL from the comfort of your command line!

Version Downloads/week License

Usage

$ npm install -g slash-graphql
$ slash-graphql COMMAND
running command...
$ slash-graphql (-v|--version|version)
slash-graphql/1.12.1 linux-x64 node-v10.19.0
$ slash-graphql --help [COMMAND]
USAGE
  $ slash-graphql COMMAND
...

Commands

slash-graphql deploy-backend NAME

Launch a new Backend

USAGE
  $ slash-graphql deploy-backend NAME

ARGUMENTS
  NAME  Backend Name

OPTIONS
  -q, --quiet                Quiet Output
  -r, --region=region        [default: us-west-2] Region
  -s, --subdomain=subdomain  Subdomain

ALIASES
  $ slash-graphql create-backend
  $ slash-graphql launch-backend

EXAMPLE
  $ slash-graphql deploy-backend "My New Backend"

See code: src/commands/deploy-backend.ts

slash-graphql destroy-backend ID

Destroy a Backend by id

USAGE
  $ slash-graphql destroy-backend ID

ARGUMENTS
  ID  Backend id

OPTIONS
  -q, --quiet    Quiet Output
  -y, --confirm  Skip Confirmation

EXAMPLE
  $ slash-graphql destroy-backend "0xid"

See code: src/commands/destroy-backend.ts

slash-graphql drop

Drop all data in your backend

USAGE
  $ slash-graphql drop

OPTIONS
  -F, --drop-fields=drop-fields  Drop types
  -T, --drop-types=drop-types    Drop types
  -d, --drop-data                Drop data and leave the schema
  -e, --endpoint=endpoint        Slash GraphQL Endpoint
  -l, --list-unused              List unused types and fields
  -q, --quiet                    Quiet Output
  -s, --drop-schema              Drop Schema along with the data
  -t, --token=token              Slash GraphQL Backend API Tokens
  -u, --drop-unused              Drops all unused types and fields
  -y, --confirm                  Skip Confirmation

EXAMPLE
  $ slash-graphql drop -e https://frozen-mango.cloud.dgraph.io/graphql -t <apiToken> [-l] [-d] [-s] [-T <types>] [-F 
  <fields>]

See code: src/commands/drop.ts

slash-graphql export-data OUTPUTDIR

Export data from your backend

USAGE
  $ slash-graphql export-data OUTPUTDIR

ARGUMENTS
  OUTPUTDIR  Output Directory

OPTIONS
  -e, --endpoint=endpoint  Slash GraphQL Endpoint
  -q, --quiet              Quiet Output
  -t, --token=token        Slash GraphQL Backend API Tokens

EXAMPLE
  $ slash-graphql export-data -e https://frozen-mango.cloud.dgraph.io/graphql -t <apiToken> ./output-directory

See code: src/commands/export-data.ts

slash-graphql get-schema [FILE]

Fetch the schema from your backend

USAGE
  $ slash-graphql get-schema [FILE]

ARGUMENTS
  FILE  [default: /dev/stdout] Output File

OPTIONS
  -e, --endpoint=endpoint  Slash GraphQL Endpoint
  -g, --generated-schema   Fetch the full schema generated by Slash GraphQL
  -q, --quiet              Quiet Output
  -t, --token=token        Slash GraphQL Backend API Tokens

EXAMPLES
  $ slash-graphql get-schema -e https://frozen-mango.cloud.dgraph.io/graphql -t <apiToken>
  $ slash-graphql get-schema -e 0x42
  $ slash-graphql get-schema -e https://frozen-mango.cloud.dgraph.io/graphql -t <apiToken> -g

See code: src/commands/get-schema.ts

slash-graphql help [COMMAND]

display help for slash-graphql

USAGE
  $ slash-graphql help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

slash-graphql import-data INPUT

Import your data back via live loader (requires docker)

USAGE
  $ slash-graphql import-data INPUT

ARGUMENTS
  INPUT  Input Directory

OPTIONS
  -e, --endpoint=endpoint  Slash GraphQL Endpoint
  -q, --quiet              Quiet Output
  -t, --token=token        Slash GraphQL Backend API Tokens
  -y, --confirm            Skip Confirmation

EXAMPLE
  $ slash-graphql import-data -e https://frozen-mango.cloud.dgraph.io/graphql -t <apiToken> ./import-directory

See code: src/commands/import-data.ts

slash-graphql list-backends

List your backends

USAGE
  $ slash-graphql list-backends

OPTIONS
  -q, --quiet             Quiet Output
  -x, --extended          show extra columns
  --columns=columns       only show provided columns (comma-separated)
  --csv                   output is csv format [alias: --output=csv]
  --filter=filter         filter property by partial string matching, ex: name=foo
  --no-header             hide table header from output
  --no-truncate           do not truncate output to fit screen
  --output=csv|json|yaml  output in a more machine friendly format
  --sort=sort             property to sort by (prepend '-' for descending)

EXAMPLES
  $ slash-graphql list-backends
  $ slash-graphql list-backends --csv

See code: src/commands/list-backends.ts

slash-graphql login

Login to Slash GraphQL. Calling this function will keep you logged in for 24 hours, and you will not need to pass access tokens for any backends that you own

USAGE
  $ slash-graphql login

OPTIONS
  -q, --quiet  Quiet Output

EXAMPLE
  $ slash-graphql login

See code: src/commands/login.ts

slash-graphql logout

Logout of Slash GraphQL Command Line

USAGE
  $ slash-graphql logout

OPTIONS
  -a, --all    Log out of all command line clients
  -q, --quiet  Quiet Output

EXAMPLES
  $ slash-graphql logout
  $ slash-graphql logout -a

See code: src/commands/logout.ts

slash-graphql restore-backend

Restore into a backend by source backend ID

USAGE
  $ slash-graphql restore-backend

OPTIONS
  -e, --endpoint=endpoint  Slash GraphQL Endpoint
  -q, --quiet              Quiet Output
  -s, --source=source      (required) Source backend ID or url to get the data to be restored
  -t, --token=token        Slash GraphQL Backend API Tokens
  -y, --confirm            Skip Confirmation

EXAMPLE
  $ slash-graphql restore-backend -e https://clone.cloud.dgraph.io/graphql -t <apiToken> --source <source backend id or 
  url>

See code: src/commands/restore-backend.ts

slash-graphql restore-backend-status RESTOREID

Retrieve the status of a restore operation

USAGE
  $ slash-graphql restore-backend-status RESTOREID

ARGUMENTS
  RESTOREID  Restore ID

OPTIONS
  -e, --endpoint=endpoint  Slash GraphQL Endpoint
  -q, --quiet              Quiet Output
  -t, --token=token        Slash GraphQL Backend API Tokens

EXAMPLE
  $ slash-graphql restore-backend-status -e https://clone.cloud.dgraph.io/graphql -t <apiToken> "restoreID"

See code: src/commands/restore-backend-status.ts

slash-graphql update [CHANNEL]

update the slash-graphql CLI

USAGE
  $ slash-graphql update [CHANNEL]

See code: @oclif/plugin-update

slash-graphql update-backend ID

Update Backend

USAGE
  $ slash-graphql update-backend ID

ARGUMENTS
  ID  Backend UID

OPTIONS
  -n, --name=name  Name
  -q, --quiet      Quiet Output
  -y, --confirm    Skip Confirmation

EXAMPLE
  $ slash-graphql update-backend -n "New Name" 0xid

See code: src/commands/update-backend.ts

slash-graphql update-schema [FILE]

Update the schema in your backend

USAGE
  $ slash-graphql update-schema [FILE]

ARGUMENTS
  FILE  [default: /dev/stdin] Input File

OPTIONS
  -e, --endpoint=endpoint  Slash GraphQL Endpoint
  -q, --quiet              Quiet Output
  -t, --token=token        Slash GraphQL Backend API Tokens

EXAMPLE
  $ slash-graphql update-schema -e https://frozen-mango.cloud.dgraph.io/graphql -t <apiToken> schema-file.graphql

See code: src/commands/update-schema.ts

About

Command Line Tools for Slash GraphQL

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 99.6%
  • Other 0.4%