Metadata API Reference: Stored Procedures
Introduction
Track/untrack Stored Procedures in the Hasura GraphQL Engine.
Supported from
Stored Procedures are supported from v2.26.0.
mssql_track_stored_procedure
mssql_track_stored_procedure
is used to add a Stored Procedure to the GraphQL schema.
Track a Stored Procedure as follows:
POST /v1/metadata HTTP/1.1
Content-Type: application/json
X-Hasura-Role: admin
{
"type": "mssql_track_stored_procedure",
"args": {
"source": <source-name>,
"stored_procedure": <name> | { "schema": <schema-name>, "name": <procedure-name> },
"configuration": {
"exposed_as": "query",
"custom_name": <custom-name>
},
"arguments": {
<name>: {
"type": "<type>",
"nullable": false | true,
"description": <string>
}
},
"returns": <logical-model-name>
}
}
Args syntax
Key | Required | Schema | Description |
---|---|---|---|
source | true | SourceName | Name of the source database |
stored_procedure | true | QueryName | Name of the stored procedure |
configuration | true | StoredProcedureConfiguration | Configuration for the Stored Procedure |
arguments | false | Mapping from String to StoredProcedureArgument | Configuration for each argument |
returns | true | LogicalModelName | Name of the logical model representing the resulting schema |
mssql_untrack_stored_procedure
mssql_untrack_stored_procedure
is used to remove a Stored Procedure from the GraphQL schema.
POST /v1/metadata HTTP/1.1
Content-Type: application/json
X-Hasura-Role: admin
{
"type": "mssql_untrack_stored_procedure",
"args": {
"source": "default",
"stored_procedure": "<name>"
}
}
Args syntax
Key | Required | Schema | Description |
---|---|---|---|
source | true | SourceName | Name of the source database |
stored_procedure | true | QueryName | Name of the stored procedure |