コンテンツにスキップ

引数の組み合わせ

単一のリストクエリで複数の引数を使用できます。

以下の例では、firstNameemailなどのフィールドとリレーションを含むstudentsというテーブルがあります。

リクエスト

query MyQuery1 {
students(
filter: {
isActive: {
equals: true
}
},
first: 3
) {
items {
id
firstName
email
}
}
}

レスポンス

{
"data": {
"students": {
"items": [
{
"id": "287cff0a-345b-4cca-9e9a-75a2161238fd",
"firstName": "James",
"email": "james.smith@example.com"
},
{
"id": "97fb89ac-e0ad-44f5-b671-24a1b751287c",
"firstName": "John",
"email": "john.williams@example.com"
},
{
"id": "429cf99f-4481-49c4-adb4-605731b20eb2",
"firstName": "Mary",
"email": "mary.brown@example.com"
}
]
}
}
}