Modern React Template - v0.0.10
    Preparing search index...

    Function fetchPosts

    • Fetch all posts

      Example query function demonstrating validated fetching of array data.

      Returns Promise<unknown>

      Promise resolving to array of validated post data

      If the API request fails

      If response validation fails

      const posts = await fetchPosts();
      posts.forEach(post => {
      console.log(post.title, post.content);
      });