Configuring the Aura CLI
This is the documentation of the GraphQL Library version 7. For the long-term support (LTS) version 5, refer to GraphQL Library version 5 LTS. |
GraphQL for Neo4j AuraDB is managed using the Aura Console or the beta commands of the Aura CLI. For the latter there are installation and configuration steps to be taken before you can use it.
Obtain Aura API credentials
The Aura CLI communicates with Neo4j AuraDB platform via an API. To use the API, a set of credentials is required. To get the credentials, follow these steps depending on which version of the console you are using.
-
Log in to the Neo4j Aura Console.
-
Navigate to the top right and select your account name, then API keys from the dropdown menu.
-
The menu shows existing API keys if you already have any.
-
Use Create, then enter a a name for the API key and confirm with Create.
-
The client ID and client secret are displayed. Be sure to record or save these as the client secret will not be shown again.
Install the Aura CLI
-
Navigate to https://github.com/neo4j/aura-cli/releases/tag/v1.1.0 in your browser.
Use Aura CLI version 1.1.0 or higher for managing your GraphQL APIs.
-
Download the compressed file that matches your system. Make a note of the folder where the file is located.
-
After the file has been downloaded, extract the contents.
-
Open a command prompt and move to the location where you extracted the files.
-
Complete the installation by moving the aura-cli executable file into the file path.
-
Mac/Linux users:
sudo mv aura-cli /usr/local/bin
-
Windows users:
move aura-cli c:\windows\system32
-
-
At the command prompt, type:
aura-cli -v
-
You should see this:
aura version v1.1.0
If you are using a Mac, you may receive a warning from Apple that aura-cli could not be verified. If this happens, navigate to System Settings, then Privacy & Security on the left, and scroll down on the right. Select Open Anyway. This should not happen again. The aura-cli has been through the Apple certification process but it can take time to trickle down through the Apple ecosystem. |
Configure the Aura CLI
Configure the Aura CLI with the Aura API client ID and client secret you obtained in Obtain Aura API credentials.
-
On the command line, execute the following:
aura-cli credential add --name <YOUR_LABEL> --client-id <YOUR_CLIENT_ID> --client-secret <YOUR_CLIENT_SECRET>
-
To verify that the credentials are working, list your Aura instances:
aura-cli instance list
Enable the beta commands
Set the configuration option to make available the beta commands to use GraphQL for Neo4j AuraDB with the Aura CLI.
-
On the command line, execute the following:
aura-cli config set beta-enabled true
-
Check if the commands are listed:
aura-cli data-api graphql
-
You should see this:
Allows you to programmatically provision and manage your GraphQL APIs Usage: aura-cli data-api graphql [command] Available Commands: auth-provider Allows you to programmatically manage Authentication providers for a specific GraphQL Data API cors-policy Allows you to manage the Cross-Origin Resource Sharing (CORS) policy for a specific GraphQL Data API create Creates a new GraphQL Data API delete Delete a GraphQL Data API get Get details of a GraphQL Data API list Returns a list of GraphQL Data APIs pause Pause a GraphQL Data API resume Resume a GraphQL Data API update Edit a GraphQL Data API Flags: -h, --help help for graphql Global Flags: --auth-url string --base-url string --output string Use "aura-cli data-api graphql [command] --help" for more information about a command.