Slide 34
Slide 34 text
const ALL_PEOPLE_QUERY = gql`
query All_People_Query {
allPeople {
people {
id
name
}
}
}
`;
interface Data {
allPeople: {
people: Array<{ id: string; name: string }>;
};
};
interface Variables {
first: number;
};
const AllPeopleComponent =
query={ALL_PEOPLE_QUERY}>
{({ loading, error, data }) => { ... }}
www.apollographql.com/docs/react/recipes/static-typing/