Filtering

You already can list all links, but another feature of Hackernews is to search them, by URL or description. In GraphQL, this concept is the same as mutations: you pass an argument to the links field, used by the resolver to filter the results.

Filtering Links

To test it, just pass the search argument to the query:

pass the search argument to the query

Unlock the next chapter
What would happen if you ran the last query without the search parameter?
The application would break
The search parameter is mandatory
All the Links would be returned
Just the first Link would be returned