As you have seen in earlier chapters, queries and mutations can take input via arguments. Since arguments have no inherent semantics attached, and mean whatever you define them to mean, you can easily implement common features like filtering by simply designating arguments to be used for this purpose.
You’ll now apply this idea to add filtering to the already defined allLinks
query.
Start by add a new argument to its schema definition
Remember that this exact approach is just an example. You might as well implement filtering using any other format.
Create the corresponding data-class
The logic needs to allow filtering
Finally, update Query
to add the new argument to the top-level method:
Cool! Check it out in GraphiQL!