diff --git a/doc/md/tutorial-todo-gql-filter-input.md b/doc/md/tutorial-todo-gql-filter-input.md index 2cdf95ab4..38d46d931 100755 --- a/doc/md/tutorial-todo-gql-filter-input.md +++ b/doc/md/tutorial-todo-gql-filter-input.md @@ -311,6 +311,19 @@ We can use this new filtering as any other predicate: } ``` +### Usage of filter inputs as predicates + +The `Filter` option lets use the generated `WhereInput`s as regular repdicates on any type of query: + +```go +query := ent.Todo.Query() +query, err := input.Filter(query) +if err != nil { + return nil, err +} +return query.All(ctx) +``` + --- Well done! As you can see, by changing a few lines of code our application now exposes a type-safe GraphQL filters