Struggling to type partial objects from GraphQL queries, especially with an object that looks like this...
// TypeScript types
interface Foo {
bar: Bar
}
interface Bar {
a: number,
b: number
}
// GraphQL query
foo {
bar {
a
// 'b' property is missing
}
}
Trying to figure out how to properly type the response without violating the declaration of Foo
, since using Pick
on the Bar
property doesn't seem ideal. Any suggestions on how to handle complex objects like Foo
and Bar
in GraphQL results?