From ef15159f9676120f61aa0ea9d8860e1a88468f76 Mon Sep 17 00:00:00 2001 From: Abu Sakib Date: Mon, 22 Mar 2021 18:48:43 +0600 Subject: [PATCH] Docs (GraphQL): Add documentation for has filter on list of fields --- content/graphql/queries/search-filtering.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/content/graphql/queries/search-filtering.md b/content/graphql/queries/search-filtering.md index 373f9057..d9d6f4db 100644 --- a/content/graphql/queries/search-filtering.md +++ b/content/graphql/queries/search-filtering.md @@ -254,13 +254,14 @@ field using the `has` keyword. The `has` keyword can only check whether a field returns a non-null value, not for specific field values. For example, your schema might define a `Student` type that has basic -information about each student; such as their ID number, age, and name: +information about each student; such as their ID number, age, name, and email address: ```graphql type Student { tid: ID! age: Int! name: String + email: String } ``` @@ -273,3 +274,15 @@ queryStudent(filter: { has : name } ){ name } ``` +You can also specify a list of fields, like the following: + +```graphql +queryStudent(filter: { has : [name, email] } ){ + tid + age + name + email +} +``` + +This would return `Student` objects where both `name` and `email` fields are non-null. \ No newline at end of file