upload-graphql-schema
Summary
Uploads and imports the specified GraphQL schema file to the GraphQL API.
fauna upload-graphql-schema GRAPHQL_FILE_PATH
Description
The upload-graphql-schema
command uploads and imports the specified
GraphQL schema file to the GraphQL API.
Use the optional --mode
parameter to specify the
schema import mode.
If you don’t pass any options at the command line, Fauna uses the
options specified 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 filename must have either the |
Options
Option | Description |
---|---|
|
Optional - The Fauna server domain, that is, the hostname where
Fauna is running. Defaults to |
|
Optional - The name of the endpoint to use for the command. |
|
Optional - The connection port. Defaults to 8443. |
|
Optional - The connection scheme. Must be one of |
|
Optional - The secret to use. A secret authenticates your connection to Fauna, and connects you to a specific database. |
|
Optional - The connection timeout, an integer number of milliseconds.
When the specified period has elapsed, The default is zero, which means that |
|
Optional - The hostname of the GraphQL API to connect to. |
|
Optional - The port of the GraphQL API to connect to. |
|
Optional - 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!