mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-09-11 10:46:25 +03:00
Docs: Update variable query example to show multiple variables in one request
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10699 GitOrigin-RevId: c2f594e06a73116fc5f49c86c6155bb5c989b24e
This commit is contained in:
parent
d21d8277c8
commit
e0448db42c
@ -25,30 +25,31 @@ variables.
|
||||
**Example:** Fetch an author by their `author_id`:
|
||||
|
||||
<GraphiQLIDE
|
||||
query={`query getArticles($author_id: Int!) {
|
||||
bigquery_articles(
|
||||
where: { author_id: { _eq: $author_id } }
|
||||
query={`query getArticles($author_id: Int!, $title: String!) {
|
||||
articles(
|
||||
where: { author_id: { _eq: $author_id }, title: { _ilike: $title } }
|
||||
) {
|
||||
id
|
||||
title
|
||||
}
|
||||
}`}
|
||||
response={`{
|
||||
response={`{
|
||||
"data": {
|
||||
"bigquery_articles": [
|
||||
"articles": [
|
||||
{
|
||||
"id": "15",
|
||||
"id": 15,
|
||||
"title": "How to climb Mount Everest"
|
||||
},
|
||||
{
|
||||
"id": "6",
|
||||
"id": 6,
|
||||
"title": "How to be successful on broadway"
|
||||
}
|
||||
]
|
||||
}
|
||||
}`}
|
||||
variables={`{
|
||||
"author_id": 1
|
||||
variables={`{
|
||||
"author_id": 1,
|
||||
"title": "%How to%"
|
||||
}`}
|
||||
/>
|
||||
|
||||
|
@ -24,16 +24,13 @@ variables.
|
||||
**Example:** Fetch an author by their `author_id`:
|
||||
|
||||
<GraphiQLIDE
|
||||
query={`query getArticles($author_id: Int!) {
|
||||
query={`query getArticles($author_id: Int!, $title: String!) {
|
||||
articles(
|
||||
where: { author_id: { _eq: $author_id } }
|
||||
where: { author_id: { _eq: $author_id }, title: { _ilike: $title } }
|
||||
) {
|
||||
id
|
||||
title
|
||||
}
|
||||
}`}
|
||||
variables={`{
|
||||
"author_id": 1
|
||||
}`}
|
||||
response={`{
|
||||
"data": {
|
||||
@ -48,6 +45,10 @@ variables.
|
||||
}
|
||||
]
|
||||
}
|
||||
}`}
|
||||
variables={`{
|
||||
"author_id": 1,
|
||||
"title": "%How to%"
|
||||
}`}
|
||||
/>
|
||||
|
||||
|
@ -25,9 +25,9 @@ variables.
|
||||
**Example:** Fetch an author by their `author_id`:
|
||||
|
||||
<GraphiQLIDE
|
||||
query={`query getArticles($author_id: Int!) {
|
||||
query={`query getArticles($author_id: Int!, $title: String!) {
|
||||
articles(
|
||||
where: { author_id: { _eq: $author_id } }
|
||||
where: { author_id: { _eq: $author_id }, title: { _ilike: $title } }
|
||||
) {
|
||||
id
|
||||
title
|
||||
@ -48,7 +48,8 @@ response={`{
|
||||
}
|
||||
}`}
|
||||
variables={`{
|
||||
"author_id": 1
|
||||
"author_id": 1,
|
||||
"title": "%How to%"
|
||||
}`}
|
||||
/>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user