mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-17 20:41:49 +03:00
fb902d4209
* Support tracking SQL functions as mutations. Closes #1514 Co-authored-by: Brandon Simmons <brandon.m.simmons@gmail.com> Co-authored-by: Brandon Simmons <brandon@hasura.io> GITHUB_PR_NUMBER: 6160 GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6160 * Update docs/graphql/core/api-reference/schema-metadata-api/custom-functions.rst Co-authored-by: Marion Schleifer <marion@hasura.io> * Update docs/graphql/core/schema/custom-functions.rst Co-authored-by: Marion Schleifer <marion@hasura.io> * Update docs/graphql/core/schema/custom-functions.rst Co-authored-by: Marion Schleifer <marion@hasura.io> * Update docs/graphql/core/schema/custom-functions.rst Co-authored-by: Brandon Simmons <brandon@hasura.io> Co-authored-by: Brandon Simmons <brandon.m.simmons@gmail.com> Co-authored-by: Marion Schleifer <marion@hasura.io> GitOrigin-RevId: 8fd39258641ecace6e3e9930e497b1655ad35080
53 lines
1.1 KiB
YAML
53 lines
1.1 KiB
YAML
- description: Volatile function as query (check)
|
|
url: /v1/graphql
|
|
status: 200
|
|
query:
|
|
query: |
|
|
query {
|
|
volatile_func1 {
|
|
name
|
|
}
|
|
}
|
|
response:
|
|
data:
|
|
volatile_func1:
|
|
- name: Starke Blake
|
|
- name: Bellamy Blake
|
|
- name: Dora Black
|
|
|
|
- description: Volatile function as query (ensure not in mutation)
|
|
url: /v1/graphql
|
|
status: 200
|
|
query:
|
|
query: |
|
|
mutation {
|
|
volatile_func1 {
|
|
name
|
|
}
|
|
}
|
|
response:
|
|
errors:
|
|
- extensions:
|
|
path: $.selectionSet.volatile_func1
|
|
code: validation-failed
|
|
message: "field \"volatile_func1\" not found in type: 'mutation_root'"
|
|
|
|
# In the future we may want to return an informational warning in these cases,
|
|
# as this is a footgun
|
|
- description: Volatile function as query (check)
|
|
url: /v1/graphql
|
|
status: 200
|
|
query:
|
|
query: |
|
|
mutation {
|
|
volatile_func2 {
|
|
name
|
|
}
|
|
}
|
|
response:
|
|
data:
|
|
volatile_func2:
|
|
- name: Starke Blake
|
|
- name: Bellamy Blake
|
|
- name: Dora Black
|