Finding a blog post with Query for Expo and React Native
In this section, we will learn how to search for posts with a search bar and a simple GraphQL Query. Query looks for specific records in the database with GraphQL. Let's get started:
- Open the
App.tsx
file and add the followingfindPosts
code anywhere above thereturn
code block:const findPosts = async (title: string): Promise<any> => { try { console.log("finding posts:", title); const postData: any = await API.graphql( graphqlOperation(queries.listPosts, { filter: { title: { contains: title, &...