Hi guys
It was kind of difficult to explain my question in the title but I'll try to elaborate a bit more.
When I use GraphQL Codegen to generate TypeScript types for my operations, the return values of said operations are never just 1 type but a collection of <Pick >'s.
To illustrate:

The problem is that, when you have a query that returns a list of values, like for example a list of Posts, there is no way to reference the type of an item in that list since it is not stored separately. It is just that list of <Pick>'s as seen in the screenshot.
Is there a way to alter my codegen setup to make this work? I had no problems getting this result while using Apollo Codegen but I really would love it if I could just use GraphQL Codegen for everything going forward.
Or maybe there is a typescript feature that would let me reference the type of one array element?
Thanks for the help!
I'm not sure if codegen provides an option to generate these types, but you should be able to get what you need with
type TechnicianJob = JobsForTechnicianQuery['jobsForTechnician']['nodes'][0];
[0] extracts the type of the first array element. You can specify any index here, as all elements in a TypeScript array have the same type.
You can use preResolveTypes: true to resolve the primitives. For the subtypes you may want to create Fragments since those also get typed explicitly.
I'm closing this issue now. You can use @pachuka 's solution to get rid of Picks in your output. Feel free to open a new one if you have another issue.
Most helpful comment
You can use preResolveTypes: true to resolve the primitives. For the subtypes you may want to create Fragments since those also get typed explicitly.