Fetch user by ID
Example query function demonstrating validated fetching with UUID validation.
UUID string of the user to fetch
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); Copy
const user = await fetchUserById('550e8400-e29b-41d4-a716-446655440000');console.log(user.name, user.email);
Fetch user by ID
Example query function demonstrating validated fetching with UUID validation.