Illustration of a microphone

Calls with Kent C. Dodds.

You call, I'll answer.

Listen to the podcasts here
Phone sitting on a stool

What's this all about?

The goal of the Call Kent Podcast is to get my answers to your questions. You record your brief question (120 seconds or less) right from your browser. Then I listen to it later and give my response, and through the magic of technology (ffmpeg), our question and answer are stitched together and published to the podcast feed.

I look forward to hearing from you!

Record your call

Calls with Kent C. Dodds — 122 episodes

118.How do you deal with partial types?
04:25
Keywords

partial-types, types, api

Tweet this
Description

Fully typed apps are the correct approach. Let's say your API backend returns a 'full' type (of a Workshop type with 8 fields for example), and, secondly, a list of Workshops but this time only with a 'name' field. In the frontend, you have a 'full view', a 'list of workshops view' (showing only the name of each) and a 'preview view' of a Workshop which uses 3 of its 8 fields. How do you describe these types in the app and at the interfaces between the frontend and backend?

How do you deal with partial types?

Looking for more content?

Have a look at these articles.

See the full blog