Firestore API schema

hierarchical.nosql.graphqls

To authenticate API requests, you’ll need an API token. Learn how to generate an access token.

See usage examples in the cloudbeaver-graphql-examples repository.

You can try queries in the built-in GraphQL console, available on your server at https://your-server-address/api/gql/console. This tool lets you test requests directly from your browser.

For a live example, see the demo GraphQL console.

API Endpoints
https://your-server-address/api/gql

Queries

_types

Description

This schema currently exposes only mutations.

Response

Returns [_PageTypes]

Example

Query
query _types {
  _types {
    ... on SubCollectionInfo {
      ...SubCollectionInfoFragment
    }
  }
}
Response
{"data": {"_types": [SubCollectionInfo]}}

Mutations

asyncReadDataFromChildEntity

Description

Creates an async task to read data from a child entity in Firestore

Response

Returns an AsyncTaskInfo!

Arguments
Name Description
projectId - ID
connectionId - ID!
contextId - ID!
path - ID
resultId - ID
filter - SQLDataFilter
dataFormat - ResultDataFormat

Example

Query
mutation asyncReadDataFromChildEntity(
  $projectId: ID,
  $connectionId: ID!,
  $contextId: ID!,
  $path: ID,
  $resultId: ID,
  $filter: SQLDataFilter,
  $dataFormat: ResultDataFormat
) {
  asyncReadDataFromChildEntity(
    projectId: $projectId,
    connectionId: $connectionId,
    contextId: $contextId,
    path: $path,
    resultId: $resultId,
    filter: $filter,
    dataFormat: $dataFormat
  ) {
    id
    name
    running
    status
    error {
      ...ServerErrorFragment
    }
    taskResult
  }
}
Variables
{
  "projectId": "<id>",
  "connectionId": "<id>",
  "contextId": "<id>",
  "path": "<id>",
  "resultId": "<id>",
  "filter": SQLDataFilter,
  "dataFormat": "resultset"
}
Response
{
  "data": {
    "asyncReadDataFromChildEntity": {
      "id": "<string>",
      "name": "<string>",
      "running": "<boolean>",
      "status": "<string>",
      "error": ServerError,
      "taskResult": "<object>"
    }
  }
}

getChildrenCollections

Description

Returns a list of subcollections for the given collection in Firestore

Response

Returns [SubCollectionInfo!]!

Arguments
Name Description
projectId - ID
connectionId - ID
contextId - ID!
resultsId - ID!
row - SQLResultRowMetaDataInput!

Example

Query
mutation getChildrenCollections(
  $projectId: ID,
  $connectionId: ID,
  $contextId: ID!,
  $resultsId: ID!,
  $row: SQLResultRowMetaDataInput!
) {
  getChildrenCollections(
    projectId: $projectId,
    connectionId: $connectionId,
    contextId: $contextId,
    resultsId: $resultsId,
    row: $row
  ) {
    icon
    name
    path
  }
}
Variables
{
  "projectId": "<id>",
  "connectionId": "<id>",
  "contextId": "<id>",
  "resultsId": "<id>",
  "row": SQLResultRowMetaDataInput
}
Response
{
  "data": {
    "getChildrenCollections": [
      {"icon": "<string>", "name": "<string>", "path": "<string>"}
    ]
  }
}

Types

AsyncTaskInfo

Description

Async types

Fields
Field Name Description
id - String! Task unique identifier
name - String Async task name
running - Boolean! Indicates if the task is currently running
status - String Current status of the async task
error - ServerError Error information if the task failed
taskResult - Object Task result. Can be some kind of identifier to obtain real result using another API function
Example
{
  "id": "<string>",
  "name": "<string>",
  "running": "<boolean>",
  "status": "<string>",
  "error": ServerError,
  "taskResult": "<object>"
}

Boolean

Description

The Boolean scalar type represents true or false.

Example
"<boolean>"

Float

Description

The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.

Example
"<float>"

ID

Description

The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.

Example
"<id>"

Int

Description

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Example
"<int>"

Object

Description

Any object (JSON)

Example
"<object>"

ResultDataFormat

Values
Enum Value Description

resultset

document

graph

timeseries

Example
"resultset"

SQLDataFilter

Fields
Input Field Description
offset - Float Row offset. We use Float because offset may be bigger than 32 bit.
limit - Int
constraints - [SQLDataFilterConstraint]
anyConstraint - Boolean When true constraints are combined with OR instead of AND
where - String
orderBy - String
Example
{
  "offset": "<float>",
  "limit": "<int>",
  "constraints": [SQLDataFilterConstraint],
  "anyConstraint": "<boolean>",
  "where": "<string>",
  "orderBy": "<string>"
}

SQLDataFilterConstraint

Fields
Input Field Description
attributeName - String Either attributeName or attributePosition must be specified
attributePosition - Int
orderPosition - Int
orderAsc - Boolean
criteria - String
operator - String
value - Object
Example
{
  "attributeName": "<string>",
  "attributePosition": "<int>",
  "orderPosition": "<int>",
  "orderAsc": "<boolean>",
  "criteria": "<string>",
  "operator": "<string>",
  "value": "<object>"
}

SQLResultRowMetaDataInput

Fields
Input Field Description
data - [Object]
metaData - Object!
Example
{"data": ["<object>"], "metaData": "<object>"}

ServerError

Description

Various server errors descriptor

Fields
Field Name Description
message - String Error message text
errorCode - String Retrieves the vendor-specific error code
errorType - String Type/category of the error
stackTrace - String Stack trace for debugging
causedBy - ServerError Nested error that caused this error (recursive)
Example
{
  "message": "<string>",
  "errorCode": "<string>",
  "errorType": "<string>",
  "stackTrace": "<string>",
  "causedBy": ServerError
}

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example
"<string>"

SubCollectionInfo

Fields
Field Name Description
icon - String! The icon path for the subcollection
name - String! The name of the subcollection
path - String! The path to the subcollection
Example
{"icon": "<string>", "name": "<string>", "path": "<string>"}

_PageTypes

Types
Union Types

SubCollectionInfo

Example
SubCollectionInfo