GraphQL API
GraphQL is a query language for APIs and a runtime for executing those queries. Unlike REST, GraphQL allows clients to specify exactly the data they need in a single request, avoiding over-fetching or under-fetching. It uses a strongly typed schema and supports nested, related queries—making it ideal for efficient frontend-backend interactions.
SC-Graph currently supports several GraphQL schemas, which are described in detail here.
The GraphQL schemas currently supported by SC-graph are described here.
Execute a GraphQL query
GET /{dataset}/graphql
Execute a GraphQL query against the schema associated with the specified dataset.
Parameters
dataset
(string, required, in path): The underlying dataset (i.e. knowledge) to apply requests against.query
(string, required): The GraphQL query string.operationName
(string, optional): Name of the operation to execute (optional).variables
(string, optional): JSON-encoded variables for the query (optional).extensions
(string, optional): Extensions for the GraphQL request (optional).
Responses
- 200 OK: Successful response containing query results.
- 400 Bad Request: Error response for invalid GraphQL requests, adhering to the GraphQL error specification.
Execute a GraphQL query against the Dataset schema (POST)
POST /{dataset}/graphql
Parameters
dataset
(string, required, in path): The underlying dataset (i.e. Graph) to apply requests against.
Request Body (application/json
)
- GraphQL request payload.
query
(string, required)operationName
(string, optional)variables
(object, optional)extensions
(object, optional)
Responses
- 200 OK: Successful response containing query results.
- 400 Bad Request: Error response for invalid GraphQL requests, adhering to the GraphQL error specification.
Execute a GraphQL query against the Traversal schema
GET /{dataset}/traversal/graphql
Parameters
dataset
(string, required, in path): The underlying dataset (i.e. Graph) to apply requests against.query
(string, required): The GraphQL query string.operationName
(string, optional): Name of the operation to execute (optional).variables
(string, optional): JSON-encoded variables for the query (optional).extensions
(string, optional): Extensions for the GraphQL request (optional).
Responses
- 200 OK: Successful response containing query results.
- 400 Bad Request: Error response for invalid GraphQL requests, adhering to the GraphQL error specification.
Execute a GraphQL query against the Traversal schema (POST)
POST /{dataset}/traversal/graphql
Parameters
dataset
(string, required, in path): The underlying dataset (i.e. Graph) to apply requests against.
Request Body (application/json
)
- GraphQL request payload.
query
(string, required)operationName
(string, optional)variables
(object, optional)extensions
(object, optional)
Responses
- 200 OK: Successful response containing query results.
- 400 Bad Request: Error response for invalid GraphQL requests, adhering to the GraphQL error specification.
Validate a GraphQL query against the Dataset schema
GET /{dataset}/validate
Parameters
dataset
(string, required, in path): The underlying dataset (i.e. Graph) to apply requests against.query
(string, required): The GraphQL query string.operationName
(string, optional): Name of the operation to execute (optional).variables
(string, optional): JSON-encoded variables for the query (optional).extensions
(string, optional): Extensions for the GraphQL request (optional).
Responses
- 200 OK: Successful response containing query results.
- 400 Bad Request: Error response for invalid GraphQL requests, adhering to the GraphQL error specification.
Validate a GraphQL query against the Dataset schema (POST)
POST /{dataset}/validate
Parameters
dataset
(string, required, in path): The underlying dataset (i.e. Graph) to apply requests against.
Request Body (application/json
)
- GraphQL request payload.
query
(string, required)operationName
(string, optional)variables
(object, optional)extensions
(object, optional)
Responses
- 200 OK: Successful response containing query results.
- 400 Bad Request: Error response for invalid GraphQL requests, adhering to the GraphQL error specification.
Validate a GraphQL query against the Traversal schema
GET /{dataset}/traversal/validate
Parameters
dataset
(string, required, in path): The underlying dataset (i.e. Graph) to apply requests against.query
(string, required): The GraphQL query string.operationName
(string, optional): Name of the operation to execute (optional).variables
(string, optional): JSON-encoded variables for the query (optional).extensions
(string, optional): Extensions for the GraphQL request (optional).
Responses
- 200 OK: Successful response containing query results.
- 400 Bad Request: Error response for invalid GraphQL requests, adhering to the GraphQL error specification.
Validate a GraphQL query against the Traversal schema (POST)
POST /{dataset}/traversal/validate
Parameters
dataset
(string, required, in path): The underlying dataset (i.e. Graph) to apply requests against.
Request Body (application/json
)
- GraphQL request payload.
query
(string, required)operationName
(string, optional)variables
(object, optional)extensions
(object, optional)
Responses
- 200 OK: Successful response containing query results.
- 400 Bad Request: Error response for invalid GraphQL requests, adhering to the GraphQL error specification.
Execute a GraphQL query against the Telicent schema
GET /{dataset}/telicent/graphql
Parameters
dataset
(string, required, in path): The underlying dataset (i.e. Graph) to apply requests against.query
(string, required): The GraphQL query string.operationName
(string, optional): Name of the operation to execute (optional).variables
(string, optional): JSON-encoded variables for the query (optional).extensions
(string, optional): Extensions for the GraphQL request (optional).
Responses
- 200 OK: Successful response containing query results.
- 400 Bad Request: Error response for invalid GraphQL requests, adhering to the GraphQL error specification.
Execute a GraphQL query against the Telicent schema (POST)
POST /{dataset}/telicent/graphql
Parameters
dataset
(string, required, in path): The underlying dataset (i.e. Graph) to apply requests against.
Request Body (application/json
)
- GraphQL request payload.
query
(string, required)operationName
(string, optional)variables
(object, optional)extensions
(object, optional)
Responses
- 200 OK: Successful response containing query results.
- 400 Bad Request: Error response for invalid GraphQL requests, adhering to the GraphQL error specification.
Validate a GraphQL query against the Telicent schema
GET /{dataset}/telicent/validate
Parameters
dataset
(string, required, in path): The underlying dataset (i.e. Graph) to apply requests against.query
(string, required): The GraphQL query string.operationName
(string, optional): Name of the operation to execute (optional).variables
(string, optional): JSON-encoded variables for the query (optional).extensions
(string, optional): Extensions for the GraphQL request (optional).
Responses
- 200 OK: Successful response containing query results.
- 400 Bad Request: Error response for invalid GraphQL requests, adhering to the GraphQL error specification.
Validate a GraphQL query against the Telicent schema (POST)
POST /{dataset}/telicent/validate
Parameters
dataset
(string, required, in path): The underlying dataset (i.e. Graph) to apply requests against.
Request Body (application/json
)
- GraphQL request payload.
query
(string, required)operationName
(string, optional)variables
(object, optional)extensions
(object, optional)
Responses
- 200 OK: Successful response containing query results.
- 400 Bad Request: Error response for invalid GraphQL requests, adhering to the GraphQL error specification.