It works by using generic types. ```ts const genericFetch = <T>(url: string, schema: z.ZodSchema<T>) => { return fetch(url) .then((res) => res.json()) .then((result) => schema.parse(result)); }; ```