I am just fiddling around trying to understand, thus my types are not exact.
@Resolver()
export class ProductsResolver {
@Query(() => [Product])
async products() {
return [{
id: 55,
name: 'Moonshine',
storeSupplies: {
London: 25,
Berlin: 0,
Monaco: 3,
},
}];
}
}
If I request data with query bellow
{
products{
id,
name,
}
}
I want async carriers() to receive ['id', 'name']. I want to skip getting of storeSupplies as it might be an expensive SQL call.
I am new to GraphQL, I might have missed something obvious, or even whole patterns. Thanks in advance.