mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-19 21:41:44 +03:00
63291f6de8
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2603 GitOrigin-RevId: 32b3133f0bb1a9bf50e4db492bab1eabf5a9430c
202 lines
5.4 KiB
YAML
202 lines
5.4 KiB
YAML
- 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: {}
|
|
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
|
|
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: {}
|
|
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
|
|
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: {}
|
|
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
|
|
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: {}
|
|
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
|
|
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: {}
|
|
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
|
|
components: {}
|
|
|
|
- description: Try to remove the endpoint
|
|
url: /v1/query
|
|
status: 200
|
|
response:
|
|
message: success
|
|
query:
|
|
type: drop_rest_endpoint
|
|
args:
|
|
name: multi_method_endpoint
|