ERD queries schema

service.erd.graphqls

This API is available in Enterprise and AWS editions only.

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

generateEntityDiagram

use generateEntityDiagramExtended (24.1.1)
Description

Returns ERD diagram information for the specified object node IDs.

Response

Returns an Object

Arguments
Name Description
objectNodeIds - [ID!]!

Example

Query
query generateEntityDiagram($objectNodeIds: [ID!]!) {
  generateEntityDiagram(objectNodeIds: $objectNodeIds)
}
Variables
{"objectNodeIds": "<id>"}
Response
{
  "data": {
    "generateEntityDiagram": "<object>"
  }
}

generateEntityDiagramExtended

Description

Returns ERD diagram information for the specified object node IDs.

Response

Returns an ERDDiagramInfo!

Arguments
Name Description
objectNodeIds - [ID!]!

Example

Query
query generateEntityDiagramExtended($objectNodeIds: [ID!]!) {
  generateEntityDiagramExtended(objectNodeIds: $objectNodeIds) {
    entities {
      ...ERDEntityInfoFragment
    }
    associations {
      ...ERDAssociationInfoFragment
    }
    data {
      ...ERDDiagramDataFragment
    }
  }
}
Variables
{"objectNodeIds": "<id>"}
Response
{
  "data": {
    "generateEntityDiagramExtended": {
      "entities": [ERDEntityInfo],
      "associations": [ERDAssociationInfo],
      "data": ERDDiagramData
    }
  }
}

Mutations

fakeFunction

Response

Returns an Object

Example

Query
mutation fakeFunction {
  fakeFunction
}
Response
{"data": {"fakeFunction": "<object>"}}

Types

Boolean

Description

The Boolean scalar type represents true or false.

Example
"<boolean>"

ERDAssociationInfo

Description

Information about an association between entities in the ERD diagram.

Fields
Field Name Description
name - String! Name of the association.
fqn - String Fully qualified name of the association.
type - String! Association type, such as 'fk' (foreign key), 'pk' (primary key) etc.
primaryEntity - Int Returns the index of the primary (source) entity if specified.
foreignEntity - Int Returns the index of the foreign (target) entity if specified.
primaryAttributes - [String!]! List of primary attributes in the association.
foreignAttributes - [String!]! List of foreign attributes in the association.
Example
{
  "name": "<string>",
  "fqn": "<string>",
  "type": "<string>",
  "primaryEntity": "<int>",
  "foreignEntity": "<int>",
  "primaryAttributes": ["<string>"],
  "foreignAttributes": ["<string>"]
}

ERDDiagramData

Fields
Field Name Description
icons - [String!]! List of icon paths used in the ERD diagram.
Example
{"icons": ["<string>"]}

ERDDiagramInfo

Description

Information about an ERD diagram, including entities, associations, and diagram data.

Fields
Field Name Description
entities - [ERDEntityInfo!]! Entities in the ERD diagram.
associations - [ERDAssociationInfo!] Associations between entities in the ERD diagram.
data - ERDDiagramData! Diagram data, including icons and other metadata.
Example
{
  "entities": [ERDEntityInfo],
  "associations": [ERDAssociationInfo],
  "data": ERDDiagramData
}

ERDEntityAttributeInfo

Description

Information about an entity attribute in the ERD diagram (columns from table).

Fields
Field Name Description
name - String! Name of the attribute.
alias - String Alias of the attribute if it has one.
dataKind - String Data type of the attribute.
typeName - String Type name of the attribute.
optional - Boolean Indicates if the attribute is optional.
iconIndex - Int Returns the icon index for the attribute from the ERD diagram data.
fullTypeName - String Fully qualified type name of the attribute.
defaultValue - String Default value of the attribute.
description - String Description of the attribute.
checked - Boolean! Indicates if the attribute is checked.
inPrimaryKey - Boolean Indicates if the attribute is in a primary key.
inForeignKey - Boolean Indicates if the attribute is in a foreign key.
Example
{
  "name": "<string>",
  "alias": "<string>",
  "dataKind": "<string>",
  "typeName": "<string>",
  "optional": "<boolean>",
  "iconIndex": "<int>",
  "fullTypeName": "<string>",
  "defaultValue": "<string>",
  "description": "<string>",
  "checked": "<boolean>",
  "inPrimaryKey": "<boolean>",
  "inForeignKey": "<boolean>"
}

ERDEntityInfo

Fields
Field Name Description
id - Int! Unique identifier of the entity.
name - String! Display name of the entity.
alias - String Alias of the entity if it has one.
fqn - String Fully qualified name of the entity, including its namespace.
nodeId - ID ID of the node in the ERD diagram.
nodeUri - ID URI of the node in the ERD diagram.
attributes - [ERDEntityAttributeInfo!]! List of attributes for the entity.
Example
{
  "id": "<int>",
  "name": "<string>",
  "alias": "<string>",
  "fqn": "<string>",
  "nodeId": "<id>",
  "nodeUri": "<id>",
  "attributes": [ERDEntityAttributeInfo]
}

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>"

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>"