vercel-labs / next-fetch

Intuitive data fetching for Next.js
https://next-fetch-pi.vercel.app/
589 stars 14 forks source link

Add type helpers for queries/mutations #25

Closed gt-codes closed 2 years ago

gt-codes commented 2 years ago

Problem

There isn't a convenient way to get the types of inputs/outputs for queries/mutations.

Currently, I can get the output of a query like so:

CleanShot 2022-09-02 at 15 45 46@2x

I'm not sure how to get the input.

Solution Description

I like how tRPC has type helpers. Maybe we can achieve something similar. Here's a reference to tRPC's Inference Helpers