openpanel/packages/nestjs-query/src/interfaces.ts
Stefan Pejcic 8595a9f4e5 back
2024-05-08 19:58:53 +02:00

10 lines
330 B
TypeScript

export type GetFieldsFromList<Q extends Record<string, any>> =
Q[keyof Q]["nodes"][0];
export type GetFields<Q extends Record<string, any>> = Q[keyof Q];
export type GetVariables<Q extends Record<"input", any>> =
Q["input"]["update"] extends object
? Q["input"]["update"]
: Q["input"][keyof Q["input"]];