mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-19 05:21:47 +03:00
63291f6de8
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2603 GitOrigin-RevId: 32b3133f0bb1a9bf50e4db492bab1eabf5a9430c
187 lines
4.6 KiB
YAML
187 lines
4.6 KiB
YAML
- description: Try to add a POST rest endpoint with arguments in URL
|
|
url: /v1/query
|
|
status: 200
|
|
response:
|
|
message: success
|
|
query:
|
|
type: create_rest_endpoint
|
|
args:
|
|
url: with_args_url/:first_name/:last_name
|
|
name: with_args_url
|
|
methods:
|
|
- POST
|
|
definition:
|
|
query:
|
|
collection_name: test_collection
|
|
query_name: query_with_args
|
|
|
|
- description: Try to add a POST rest endpoint with default argument
|
|
url: /v1/query
|
|
status: 200
|
|
response:
|
|
message: success
|
|
query:
|
|
type: create_rest_endpoint
|
|
args:
|
|
url: with_default_arg
|
|
name: with_default_arg
|
|
methods:
|
|
- POST
|
|
definition:
|
|
query:
|
|
collection_name: test_collection
|
|
query_name: query_with_default_arg
|
|
|
|
- description: Try to add a POST rest mutation endpoint
|
|
url: /v1/query
|
|
status: 200
|
|
response:
|
|
message: success
|
|
query:
|
|
type: create_rest_endpoint
|
|
args:
|
|
url: mutation_with_args
|
|
name: mutation_with_args
|
|
methods:
|
|
- POST
|
|
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/mutation_with_args:
|
|
post:
|
|
summary: mutation_with_args
|
|
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
|
|
/api/rest/with_default_arg:
|
|
post:
|
|
summary: with_default_arg
|
|
description: >-
|
|
***
|
|
|
|
The GraphQl query for this endpoint is:
|
|
|
|
``` graphql
|
|
|
|
query ($first_name:String="Foo") { test_table(where: {first_name: { _eq:
|
|
$first_name } }) { first_name last_name } }
|
|
|
|
```
|
|
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:
|
|
default: Foo
|
|
type: string
|
|
in: query
|
|
name: first_name
|
|
'/api/rest/with_args_url/{first_name}/{last_name}':
|
|
post:
|
|
summary: with_args_url
|
|
description: >-
|
|
***
|
|
|
|
The GraphQl query for this endpoint is:
|
|
|
|
``` graphql
|
|
|
|
query ($first_name: String!, $last_name:String!) { test_table(where:
|
|
{first_name: { _eq: $first_name } last_name: { _eq: $last_name }}) {
|
|
first_name last_name } }
|
|
|
|
```
|
|
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: path
|
|
name: first_name
|
|
- schema:
|
|
type: string
|
|
in: path
|
|
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: with_args_url
|
|
|
|
- description: Try to remove the endpoint
|
|
url: /v1/query
|
|
status: 200
|
|
response:
|
|
message: success
|
|
query:
|
|
type: drop_rest_endpoint
|
|
args:
|
|
name: with_default_arg
|
|
|
|
- description: Try to remove the endpoint
|
|
url: /v1/query
|
|
status: 200
|
|
response:
|
|
message: success
|
|
query:
|
|
type: drop_rest_endpoint
|
|
args:
|
|
name: mutation_with_args
|