Skip to main content
Version: v2.x

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

KeyRequiredSchemaDescription
sourcetrueSourceNameName of the source database
stored_proceduretrueQueryNameName of the stored procedure
configurationtrueStoredProcedureConfigurationConfiguration for the Stored Procedure
argumentsfalseMapping from String to StoredProcedureArgumentConfiguration for each argument
returnstrueLogicalModelNameName 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

KeyRequiredSchemaDescription
sourcetrueSourceNameName of the source database
stored_proceduretrueQueryNameName of the stored procedure