# How to Filter and Search using Variables in Apollo Client

DevFeed: [How to Filter and Search using Variables in Apollo Client](<https://devfeed.tech/articles/how-to-filter-and-search-using-variables-in-apollo-client-23375.md>)

Original publisher: [Read original article](<https://www.apollographql.com/blog/how-to-filter-and-search-using-variables-in-apollo-client>)

Author: Khalil Stemmler

Published: 2021-09-29T09:01:37Z

Content type: tutorial

Language: en

Sources: [Apollo Blog](<https://devfeed.tech/sources/apollo-blog.md>)

Topics: [apollo-client](<https://devfeed.tech/topics/apollo-client.md>), [GraphQL](<https://devfeed.tech/topics/graphql.md>), [React](<https://devfeed.tech/topics/react.md>), [API](<https://devfeed.tech/topics/api.md>), [Front end](<https://devfeed.tech/topics/frontend.md>), [Query (disambiguation)](<https://devfeed.tech/topics/query.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [apollo-client](<https://devfeed.tech/tags/apollo-client.md>), [code](<https://devfeed.tech/tags/code.md>), [filter](<https://devfeed.tech/tags/filter.md>), [frontend](<https://devfeed.tech/tags/frontend.md>), [graphql](<https://devfeed.tech/tags/graphql.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [react](<https://devfeed.tech/tags/react.md>), [search](<https://devfeed.tech/tags/search.md>)

## AI overview

A tutorial showing how to build search and filtering with variables in Apollo Client and React. It uses a GraphQL API that returns albums, covers the schema and API testing, and demonstrates querying, local search state, loading and error handling, and rendering results.

## Source excerpt

You know how to query data from Apollo Client using the hook, but what about searching and filtering it? How does that work? In this post, we'll walk through a tiny React and Apollo Client example demonstrating how to set up queries that let you search and filter using variables. Prerequisites Example: Querying and presenting a list of albums In this example, we'll use an API that returns a list of albums. The idea is that we'll start out with a page that presents an entire list of albums.