Skip to main content
Version: 0.8.x

CLI: graphql:* commands

The group of CLI graphql:* commands makes it possible to generate GraphQL Schemas from compiled Composites and run a local GraphQL HTTP server

Command List

Usage

composedb graphql:execute

Execute a GraphQL query or mutation

USAGE
$ composedb graphql:execute QUERY [VARS] [-c <value>] [-k <value>]
[--runtimeDefinitionPath <value>]

ARGUMENTS
QUERY GraphQL query or mutation
VARS variables as JSON to provide to a mutation. A "did" variable is always added
that is the DID from the environment.

FLAGS
-c, --ceramic-url=<value> Ceramic API URL
-k, --did-private-key=<value> DID private key
--runtimeDefinitionPath=<value> path to runtime-composite definition json file

composedb graphql:schema

Load the runtime graphql schema for the composite with given runtime definition

You can use this command to see the ComposeDB GraphQL Execution Schema for your composite.

You will be using this schema in your app to perform Queries and Mutations.

USAGE
$ composedb graphql:schema PATH

ARGUMENTS
PATH a path to a runtime representation of a composite encoded as JSON

OPTIONS
-o, --output a path to a file where the schema should be saved

composedb graphql:server

Launch a GraphQL server supporting the runtime schema of the composite with given runtime definition

You can use this command to launch a local GraphQL HTTP server that will be able to process queries and mutations against your Composite's GraphQL Execution Schema

USAGE
$ composedb graphql:server PATH

ARGUMENTS
PATH a path to a runtime representation of a composite encoded as JSON

OPTIONS
-c, --ceramic-url Ceramic API URL
-k, --did-private-key DID Private Key that should be used to authenticate the queries and mutations (you can generate a fresh private key using composedb did:generate-private-key)
--readonly a boolean indicating whether the server should load the schema without mutations
--port the port that the server should listen on
--graphiql a boolean indicating whether the GraphiQL IDE should be available when opening the server's url in the browser. See https://github.com/graphql/graphiql for more info on GraphiQL