openpanel/packages/nestjs-query/src/interfaces.ts
Stefan Pejcic 09f9f9502d packages
2024-11-07 19:03:37 +01:00

10 lines
318 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"]];