upload-graphql-schema
Upload and import a GraphQL schema file to the GraphQL API.
Description
The upload-graphql-schema
command uploads and imports the given
GraphQL schema file to the GraphQL API.
Use the optional --mode
parameter to set the schema import mode.
If you don’t pass any options at the command line, Fauna uses the options in
the fauna-shell
configuration file.
Arguments
Argument | Description |
---|---|
GRAPHQL_FILE_PATH |
The path to the GraphQL schema file that you want to upload to the
GraphQL API. The file name must have the |
Options
Option | Description |
---|---|
|
Optional Fauna server domain, that is, the hostname where
Fauna is running. Defaults to |
|
Optional name of the endpoint to use for the command. |
|
Optional connection port. Defaults to 8443. |
|
Optional connection scheme. Must be one of |
|
Optional secret to use. A secret authenticates your connection to Fauna, and connects you to a database. |
|
Optional connection timeout, an integer number of milliseconds.
When the interval has elapsed, The default is zero, which means that |
|
The hostname of the GraphQL API to connect to. |
|
The port of the GraphQL API to connect to. |
|
The schema import mode to use. Must be one of: - - - The default mode is |
Examples
The following example imports a schema file in the current directory:
$ fauna upload-graphql-schema ./schema.gql
UPLOADING SCHEMA (mode=merge): ./schema.gql
RESPONSE:
Schema imported successfully.
Use the following HTTP header to connect to the FaunaDB GraphQL API:
{ "Authorization": "Bearer fnAEMRODcCACANIiSnji7-BEalUcbAufrmGrgN8m" }
The following example imports the same schema file as the previous example,
this time using the replace
schema import mode:
$ fauna upload-graphql-schema ./schema.gql --mode=replace
UPLOADING SCHEMA (mode=replace): ./schema.gql
RESPONSE:
Schema imported successfully.
Use the following HTTP header to connect to the FaunaDB GraphQL API:
{ "Authorization": "Bearer fnAEMRODcCACANIiSnji7-BEalUcbAufrmGrgN8m" }
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!