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:
Sean Park-Ross 2024-02-27 19:28:05 +00:00 committed by hasura-bot
parent d21d8277c8
commit e0448db42c
3 changed files with 20 additions and 17 deletions

View File

@ -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%"
}`}
/>

View File

@ -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%"
}`}
/>

View File

@ -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%"
}`}
/>