Introduction
Type definitions tell GraphQL what kinds of data you can ask for and what shape it has. They help make sure your queries get the right data.
When you want to describe the shape of data your API can send or receive.
When you need to define what fields an object has and their types.
When you want to create custom data types for your API.
When you want to specify what queries or mutations your API supports.
When you want to ensure clients and servers agree on data structure.