mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 01:12:56 +03:00
02aef27a75
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2632 Co-authored-by: Lyndon Maydwell <92299+sordina@users.noreply.github.com> Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com> GitOrigin-RevId: 067e182effaed255ff047abeee309d65a9fb191c
351 lines
13 KiB
YAML
351 lines
13 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: This OpenAPI specification is automatically generated by Hasura.
|
|
paths:
|
|
/api/rest/multi_method_endpoint:
|
|
get:
|
|
summary: multi_method_endpoint
|
|
description: "***\nThe GraphQl query for this endpoint is:\n``` graphql\n\
|
|
mutation ($first_name: String!, $last_name: String!) { insert_test_table(\
|
|
\ objects: {first_name: $first_name, last_name: $last_name }) { returning\
|
|
\ { id } affected_rows } }\n```"
|
|
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
|
|
description: _"first_name" is required (enter it either in parameters or request body)_
|
|
- schema:
|
|
type: string
|
|
in: query
|
|
name: last_name
|
|
description: _"last_name" is required (enter it either in parameters or request body)_
|
|
requestBody:
|
|
required: false
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
first_name:
|
|
type: string
|
|
nullable: false
|
|
last_name:
|
|
type: string
|
|
nullable: false
|
|
description: Query parameters can also be provided in the request body
|
|
as a JSON object
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
properties:
|
|
insert_test_table:
|
|
type: object
|
|
properties:
|
|
returning:
|
|
items:
|
|
type: object
|
|
properties:
|
|
id:
|
|
pattern: '[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}'
|
|
title: uuid
|
|
type: string
|
|
type: array
|
|
nullable: false
|
|
affected_rows:
|
|
title: Int
|
|
type: integer
|
|
description: Responses for POST /api/rest/multi_method_endpoint
|
|
put:
|
|
summary: multi_method_endpoint
|
|
description: "***\nThe GraphQl query for this endpoint is:\n``` graphql\n\
|
|
mutation ($first_name: String!, $last_name: String!) { insert_test_table(\
|
|
\ objects: {first_name: $first_name, last_name: $last_name }) { returning\
|
|
\ { id } affected_rows } }\n```"
|
|
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
|
|
description: _"first_name" is required (enter it either in parameters or request body)_
|
|
- schema:
|
|
type: string
|
|
in: query
|
|
name: last_name
|
|
description: _"last_name" is required (enter it either in parameters or request body)_
|
|
requestBody:
|
|
required: false
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
first_name:
|
|
type: string
|
|
nullable: false
|
|
last_name:
|
|
type: string
|
|
nullable: false
|
|
description: Query parameters can also be provided in the request body
|
|
as a JSON object
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
properties:
|
|
insert_test_table:
|
|
type: object
|
|
properties:
|
|
returning:
|
|
items:
|
|
type: object
|
|
properties:
|
|
id:
|
|
pattern: '[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}'
|
|
title: uuid
|
|
type: string
|
|
type: array
|
|
nullable: false
|
|
affected_rows:
|
|
title: Int
|
|
type: integer
|
|
description: Responses for POST /api/rest/multi_method_endpoint
|
|
post:
|
|
summary: multi_method_endpoint
|
|
description: "***\nThe GraphQl query for this endpoint is:\n``` graphql\n\
|
|
mutation ($first_name: String!, $last_name: String!) { insert_test_table(\
|
|
\ objects: {first_name: $first_name, last_name: $last_name }) { returning\
|
|
\ { id } affected_rows } }\n```"
|
|
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
|
|
description: _"first_name" is required (enter it either in parameters or request body)_
|
|
- schema:
|
|
type: string
|
|
in: query
|
|
name: last_name
|
|
description: _"last_name" is required (enter it either in parameters or request body)_
|
|
requestBody:
|
|
required: false
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
first_name:
|
|
type: string
|
|
nullable: false
|
|
last_name:
|
|
type: string
|
|
nullable: false
|
|
description: Query parameters can also be provided in the request body
|
|
as a JSON object
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
properties:
|
|
insert_test_table:
|
|
type: object
|
|
properties:
|
|
returning:
|
|
items:
|
|
type: object
|
|
properties:
|
|
id:
|
|
pattern: '[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}'
|
|
title: uuid
|
|
type: string
|
|
type: array
|
|
nullable: false
|
|
affected_rows:
|
|
title: Int
|
|
type: integer
|
|
description: Responses for POST /api/rest/multi_method_endpoint
|
|
delete:
|
|
summary: multi_method_endpoint
|
|
description: "***\nThe GraphQl query for this endpoint is:\n``` graphql\n\
|
|
mutation ($first_name: String!, $last_name: String!) { insert_test_table(\
|
|
\ objects: {first_name: $first_name, last_name: $last_name }) { returning\
|
|
\ { id } affected_rows } }\n```"
|
|
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
|
|
description: _"first_name" is required (enter it either in parameters or request body)_
|
|
- schema:
|
|
type: string
|
|
in: query
|
|
name: last_name
|
|
description: _"last_name" is required (enter it either in parameters or request body)_
|
|
requestBody:
|
|
required: false
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
first_name:
|
|
type: string
|
|
nullable: false
|
|
last_name:
|
|
type: string
|
|
nullable: false
|
|
description: Query parameters can also be provided in the request body
|
|
as a JSON object
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
properties:
|
|
insert_test_table:
|
|
type: object
|
|
properties:
|
|
returning:
|
|
items:
|
|
type: object
|
|
properties:
|
|
id:
|
|
pattern: '[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}'
|
|
title: uuid
|
|
type: string
|
|
type: array
|
|
nullable: false
|
|
affected_rows:
|
|
title: Int
|
|
type: integer
|
|
description: Responses for POST /api/rest/multi_method_endpoint
|
|
patch:
|
|
summary: multi_method_endpoint
|
|
description: "***\nThe GraphQl query for this endpoint is:\n``` graphql\n\
|
|
mutation ($first_name: String!, $last_name: String!) { insert_test_table(\
|
|
\ objects: {first_name: $first_name, last_name: $last_name }) { returning\
|
|
\ { id } affected_rows } }\n```"
|
|
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
|
|
description: _"first_name" is required (enter it either in parameters or request body)_
|
|
- schema:
|
|
type: string
|
|
in: query
|
|
name: last_name
|
|
description: _"last_name" is required (enter it either in parameters or request body)_
|
|
requestBody:
|
|
required: false
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
first_name:
|
|
type: string
|
|
nullable: false
|
|
last_name:
|
|
type: string
|
|
nullable: false
|
|
description: Query parameters can also be provided in the request body
|
|
as a JSON object
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
properties:
|
|
insert_test_table:
|
|
type: object
|
|
properties:
|
|
returning:
|
|
items:
|
|
type: object
|
|
properties:
|
|
id:
|
|
pattern: '[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}'
|
|
title: uuid
|
|
type: string
|
|
type: array
|
|
nullable: false
|
|
affected_rows:
|
|
title: Int
|
|
type: integer
|
|
description: Responses for POST /api/rest/multi_method_endpoint
|
|
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
|