Schema/Metadata API Reference: RESTified GraphQL Endpoints¶
Table of contents
Introduction¶
Add/Remove a RESTified GraphQL endpoint to Hasura GraphQL engine.
create_rest_endpoint¶
create_rest_endpoint
is used to associate a URL template with a query.
An example request as follows:
POST /v1/query HTTP/1.1
Content-Type: application/json
X-Hasura-Role: admin
{
"type": "create_rest_endpoint",
"args": {
"name": "example-name",
"url": "example",
"methods": ["POST","PUT","PATCH"],
"definition": {
"query": {
"query_name": "example_mutation",
"collection_name": "test_collection"
}
},
"comment": "some optional comment"
}
}
Key | Required | Schema | Description |
---|---|---|---|
name | true | Text | A unique identifier for the endpoint |
url | true | EndpointUrl | URL of the REST endpoint |
methods | true | EndpointMethods | Non-Empty case sensitive list of supported HTTP Methods |
definition | true | EndpointDefinition | Definition for the REST endpoint |
comment | false | Text | comment |
drop_rest_endpoint¶
drop_rest_endpoint
is used to delete an existing RESTified GraphQL Endpoint.
An example request as follows:
POST /v1/query HTTP/1.1
Content-Type: application/json
X-Hasura-Role: admin
{
"type": "drop_rest_endpoint",
"args": {
"url": "my simple rest endpoint"
}
}
Key | Required | Schema | Description |
---|---|---|---|
url | true | EndpointUrl | URL of the RESTified endpoint |
Was this page helpful?
Thank you for your feedback!