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

    Function fetchUserById

    • Fetch user by ID

      Example query function demonstrating validated fetching with UUID validation.

      Parameters

      • userId: string

        UUID string of the user to fetch

      Returns Promise<unknown>

      Promise resolving to validated user data

      If userId is not a valid UUID format

      If the API request fails

      If response validation fails

      const user = await fetchUserById('550e8400-e29b-41d4-a716-446655440000');
      console.log(user.name, user.email);