2021-10-06 10:15:14 +03:00
|
|
|
- description: Try to add a rest endpoint with multiple methods
|
|
|
|
url: /v1/query
|
|
|
|
status: 200
|
|
|
|
response:
|
|
|
|
message: success
|
|
|
|
query:
|
|
|
|
type: create_rest_endpoint
|
|
|
|
args:
|
|
|
|
url: multi_method_endpoint
|
|
|
|
name: multi_method_endpoint
|
|
|
|
methods:
|
|
|
|
- GET
|
|
|
|
- POST
|
|
|
|
- PUT
|
|
|
|
- DELETE
|
|
|
|
- PATCH
|
|
|
|
definition:
|
|
|
|
query:
|
|
|
|
collection_name: test_collection
|
|
|
|
query_name: mutation_with_args
|
|
|
|
|
|
|
|
|
|
|
|
- description: Call openapi json endpoint
|
|
|
|
url: /api/swagger/json
|
|
|
|
method: GET
|
|
|
|
status: 200
|
|
|
|
query:
|
|
|
|
response:
|
|
|
|
openapi: 3.0.0
|
|
|
|
info:
|
|
|
|
version: ''
|
|
|
|
title: Rest Endpoints
|
|
|
|
description: These OpenAPI specifications are automatically generated by Hasura.
|
|
|
|
paths:
|
|
|
|
/api/rest/multi_method_endpoint:
|
|
|
|
get:
|
|
|
|
summary: multi_method_endpoint
|
|
|
|
description: >-
|
|
|
|
***
|
|
|
|
|
|
|
|
The GraphQl query for this endpoint is:
|
|
|
|
|
|
|
|
``` graphql
|
|
|
|
|
|
|
|
mutation ($first_name: String!, $last_name: String!) {
|
|
|
|
insert_test_table( objects: {first_name: $first_name, last_name:
|
|
|
|
$last_name }) { returning { id } affected_rows } }
|
|
|
|
|
|
|
|
```
|
|
|
|
responses: {}
|
2021-10-14 13:31:21 +03:00
|
|
|
parameters:
|
|
|
|
- schema:
|
|
|
|
type: string
|
|
|
|
in: header
|
|
|
|
name: x-hasura-admin-secret
|
|
|
|
description: >-
|
|
|
|
Your x-hasura-admin-secret will be used for authentication of the API
|
|
|
|
request.
|
|
|
|
- schema:
|
|
|
|
type: string
|
|
|
|
in: query
|
|
|
|
name: first_name
|
|
|
|
- schema:
|
|
|
|
type: string
|
|
|
|
in: query
|
|
|
|
name: last_name
|
2021-10-06 10:15:14 +03:00
|
|
|
put:
|
|
|
|
summary: multi_method_endpoint
|
|
|
|
description: >-
|
|
|
|
***
|
|
|
|
|
|
|
|
The GraphQl query for this endpoint is:
|
|
|
|
|
|
|
|
``` graphql
|
|
|
|
|
|
|
|
mutation ($first_name: String!, $last_name: String!) {
|
|
|
|
insert_test_table( objects: {first_name: $first_name, last_name:
|
|
|
|
$last_name }) { returning { id } affected_rows } }
|
|
|
|
|
|
|
|
```
|
|
|
|
responses: {}
|
2021-10-14 13:31:21 +03:00
|
|
|
parameters:
|
|
|
|
- schema:
|
|
|
|
type: string
|
|
|
|
in: header
|
|
|
|
name: x-hasura-admin-secret
|
|
|
|
description: >-
|
|
|
|
Your x-hasura-admin-secret will be used for authentication of the API
|
|
|
|
request.
|
|
|
|
- schema:
|
|
|
|
type: string
|
|
|
|
in: query
|
|
|
|
name: first_name
|
|
|
|
- schema:
|
|
|
|
type: string
|
|
|
|
in: query
|
|
|
|
name: last_name
|
2021-10-06 10:15:14 +03:00
|
|
|
post:
|
|
|
|
summary: multi_method_endpoint
|
|
|
|
description: >-
|
|
|
|
***
|
|
|
|
|
|
|
|
The GraphQl query for this endpoint is:
|
|
|
|
|
|
|
|
``` graphql
|
|
|
|
|
|
|
|
mutation ($first_name: String!, $last_name: String!) {
|
|
|
|
insert_test_table( objects: {first_name: $first_name, last_name:
|
|
|
|
$last_name }) { returning { id } affected_rows } }
|
|
|
|
|
|
|
|
```
|
|
|
|
responses: {}
|
2021-10-14 13:31:21 +03:00
|
|
|
parameters:
|
|
|
|
- schema:
|
|
|
|
type: string
|
|
|
|
in: header
|
|
|
|
name: x-hasura-admin-secret
|
|
|
|
description: >-
|
|
|
|
Your x-hasura-admin-secret will be used for authentication of the API
|
|
|
|
request.
|
|
|
|
- schema:
|
|
|
|
type: string
|
|
|
|
in: query
|
|
|
|
name: first_name
|
|
|
|
- schema:
|
|
|
|
type: string
|
|
|
|
in: query
|
|
|
|
name: last_name
|
2021-10-06 10:15:14 +03:00
|
|
|
delete:
|
|
|
|
summary: multi_method_endpoint
|
|
|
|
description: >-
|
|
|
|
***
|
|
|
|
|
|
|
|
The GraphQl query for this endpoint is:
|
|
|
|
|
|
|
|
``` graphql
|
|
|
|
|
|
|
|
mutation ($first_name: String!, $last_name: String!) {
|
|
|
|
insert_test_table( objects: {first_name: $first_name, last_name:
|
|
|
|
$last_name }) { returning { id } affected_rows } }
|
|
|
|
|
|
|
|
```
|
|
|
|
responses: {}
|
2021-10-14 13:31:21 +03:00
|
|
|
parameters:
|
|
|
|
- schema:
|
|
|
|
type: string
|
|
|
|
in: header
|
|
|
|
name: x-hasura-admin-secret
|
|
|
|
description: >-
|
|
|
|
Your x-hasura-admin-secret will be used for authentication of the API
|
|
|
|
request.
|
|
|
|
- schema:
|
|
|
|
type: string
|
|
|
|
in: query
|
|
|
|
name: first_name
|
|
|
|
- schema:
|
|
|
|
type: string
|
|
|
|
in: query
|
|
|
|
name: last_name
|
2021-10-06 10:15:14 +03:00
|
|
|
patch:
|
|
|
|
summary: multi_method_endpoint
|
|
|
|
description: >-
|
|
|
|
***
|
|
|
|
|
|
|
|
The GraphQl query for this endpoint is:
|
|
|
|
|
|
|
|
``` graphql
|
|
|
|
|
|
|
|
mutation ($first_name: String!, $last_name: String!) {
|
|
|
|
insert_test_table( objects: {first_name: $first_name, last_name:
|
|
|
|
$last_name }) { returning { id } affected_rows } }
|
|
|
|
|
|
|
|
```
|
|
|
|
responses: {}
|
2021-10-14 13:31:21 +03:00
|
|
|
parameters:
|
|
|
|
- schema:
|
|
|
|
type: string
|
|
|
|
in: header
|
|
|
|
name: x-hasura-admin-secret
|
|
|
|
description: >-
|
|
|
|
Your x-hasura-admin-secret will be used for authentication of the API
|
|
|
|
request.
|
|
|
|
- schema:
|
|
|
|
type: string
|
|
|
|
in: query
|
|
|
|
name: first_name
|
|
|
|
- schema:
|
|
|
|
type: string
|
|
|
|
in: query
|
|
|
|
name: last_name
|
2021-10-06 10:15:14 +03:00
|
|
|
components: {}
|
|
|
|
|
|
|
|
- description: Try to remove the endpoint
|
|
|
|
url: /v1/query
|
|
|
|
status: 200
|
|
|
|
response:
|
|
|
|
message: success
|
|
|
|
query:
|
|
|
|
type: drop_rest_endpoint
|
|
|
|
args:
|
2021-10-14 13:31:21 +03:00
|
|
|
name: multi_method_endpoint
|