Connecting to GraphQL
TerminusDB hosts a GraphQL endpoint at:
For instance, with a data product named
admin/people, and a locally installed TerminusDB, you can query it at:
For TerminuX (TO BE RELEASED) you can use the following URL:
ORGis your organization, and
DATA_PRODUCTis the name of your data product.
Since TerminusDB requires authentication to access data products, you will need to use the authentication method that has been configured for your server.
For example, if you would like to connect to
admin/peoplewith the apollo client to download the associated GraphQL schema, simply use:
npx apollo client:download-schema --endpoint=http://127.0.0.1:6363/api/graphql/admin/people schema.graphql --header='Authorization: Basic YWRtaW46cm9vdA=='
In TerminusX you can use an API key with the following header.
For instance, with the apollo client, you can download your schema as follows:
npx apollo client:download-schema --endpoint=https://cloud.terminusdb.com/TEAM/api/graphql/TEAM/people schema.graphql --header="Authorization: Token $(cat ~/my_token_file)"
my_token_filecontains an API token for TerminusX.
TerminusDB ships with a GraphiQL graphical GraphQL query interface and schema browser. This is a quick way to get acquainted with GraphQL in TerminusDB.
You can reach this browser at:
You will also need to set your Authorization header in the Header dialog box at the bottom center.
For instance, in the default install, as:
"Authorization": "Basic YWRtaW46cm9vdA=="