How it works
When you have enabled the subgraph check extension for a namespace, everytime a check is performed against a graph that belongs to said namespace, we send a request to the configured endpoint with information about the and allow you to overwrite thelint issues or return an error which would fail
Configuration

Subgraph Check Extensions configuration
| Option | Description | |
|---|---|---|
| Endpoint | The URL to which each request is sent. This endpoint must be accessible from Cosmo. | |
| Secret Key | A value used to generate the request signature when sending data to the configured endpoint. This signature helps verify that the request originates from Cosmo and has not been altered. | |
| Include Composed SDL | When enabled, both the previous and current SDL (Schema Definition Language) versions are sent to your service. | |
| Include Lint Warnings and Errors | When enabled, all detected lint issues are sent to your service. These issues are evaluated using the Linter Rules. | |
| Include Graph Pruning Warnings and Errors | When enabled, all detected graph pruning issues are sent to your service. For more information, see Graph Pruning. | |
| Include Schema Changes | When enabled, details of schema changes are included in the data sent to your service. | |
| Include Affected Operations | When enabled, information about affected operations is included in the data sent to your service. | 
Verification
To ensure the payload data is coming from a trusted source and hasn’t been tampered with during transit, we employ HMAC signatures. When setting up the Subgraph Check Extension for a namespace, you can provide a secret key. This secret key is used to compute a signature that is sent along with each request. The header containing this signature isX-Cosmo-Signature-256.
Verification Example
To verify the request, you need to compute the HMAC signature on your server and compare it to the signature in theX-Cosmo-Signature-256 header.
Here’s an example in Node.js:
Handler Example
For this example we are usingfastify and tsx to run the local server on port 4000. Before running any check,
we need to configure the check extension to point to our local server and set the secret key. For this example, we are
using the following values:
- Endpoint: http://localhost:4000/check-schema
- Secret key: ...