When the Subgraph Check Extension is triggered, your registered endpoint receives a request with a JSON payload
containing information about the check. You can use this information to decide whether to discard the check or perform
any additional linting on your subgraphs.
If no option is enabled in the namespace configuration, no file
is generated and the url field will be undefined or not present in the request payload.
SubgraphCheckExtensionPayload
| Field | Type | Description |
|---|
actorId | string | The unique identifier of the actor that triggered the check. |
checkId | string | The unique identifier of the check. |
labels | LabelInfo[] | Contains the labels used to trigger the check. This field will not be present when subgraphs is defined. |
organization | OrganizationContext | Information about the organization that triggered the check. |
namespace | NamespaceContext | Information about the associated namespace. |
vcsContext | VCSContext | Details about the Version Control System (VCS) that triggered the check. This field is only included when the check is initiated from a VCS. |
affectedGraphs | AffectedGraphInfo[] | A list of all graphs affected by the check. |
subgraphs | SubgraphContext[] | A list of all subgraphs that triggered the check. This field is only included when the check is for an existing subgraph. |
url | string or undefined | The URL from which the bulk data file can be downloaded. |
You can access the URL provided in the url field for 5 minutes after the request arrives.
LabelInfo
Provides information about the labels used to trigger the check.
| Field | Type | Description |
|---|
| key | string | The key of the label. |
| name | string | The name of the label. |
OrganizationContext
Provides information about the organization that triggered the check.
| Field | Type | Description |
|---|
| id | string | The unique identifier of the organization. |
| slug | string | The slug of the organization. |
NamespaceContext
Provides information about the associated namespace.
| Field | Type | Description |
|---|
| id | string | The unique identifier of the namespace. |
| name | string | The display name of the namespace. |
VCSContext
Provides details about the Version Control System (VCS) that triggered the check. This field is only included when the check is initiated from a VCS.
| Field | Type | Description |
|---|
| author | string | The email address of the commit author. |
| commitSha | string | The SHA hash of the commit that triggered the check. |
| branch | string | The branch name associated with the commit. |
AffectedGraphInfo
Provides information about the graphs affected by the check.
| Field | Type | Description |
|---|
| id | string | The unique identifier of the graph. |
| name | string | The name of the graph. |
SubgraphContext
Provides information about the subgraphs that triggered the check. This field is only included when the check is for an existing subgraph.
| Field | Type | Description |
|---|
| id | string | The unique identifier of the subgraph. |
| name | string | The name of the subgraph. |
| isDeleted | boolean | Indicates whether the check was triggered by a deleted subgraph. |
TypeScript definition
interface LabelInfo {
key: string;
name: string;
}
interface OrganizationInfo {
id: string;
slug: string;
}
interface NamespaceInfo {
id: string;
name: string;
}
interface VCSContext {
author: string;
commitSha: string;
branch: string;
}
interface AffectedGraphInfo {
id: string;
name: string;
namespace: NamespaceInfo;
}
interface SubgraphInfo {
id: string;
name: string;
isDeleted: boolean;
}
interface SubgraphCheckExtensionPayload {
actorId: string;
checkId: string;
labels: LabelInfo[] | undefined;
organization: OrganizationInfo;
namespace: NamespaceInfo;
vcsContext: VCSContext | undefined;
affectedGraphs: AffectedGraphInfo[];
url: string;
subgraphs: SubgraphInfo[] | undefined;
}