Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs (GraphQL): Add documentation for has filter on list of fields #134

Merged
merged 1 commit into from
Mar 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion content/graphql/queries/search-filtering.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
```

Expand All @@ -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.