-
-
Notifications
You must be signed in to change notification settings - Fork 51
feat: add validationSchemaExportType
to config w/ resolve deps
#389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
as const
@elijaholmos Thank you! |
@Code-Hex this is awesome! thank you so much for this hard work that will surely introduce much expandability in the future! |
export function EventInputSchema(): z.ZodObject<Properties<EventInput>> { | ||
return z.object<Properties<EventInput>>({ | ||
arguments: z.array(z.lazy(() => EventArgumentInputSchema())), | ||
export const EventInputSchema: z.ZodObject<Properties<EventInput>> = z.object({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason why this is no longer passing Properties<EventInput>
to z.object
?
I now get errors of the form
Type 'ZodObject<{ deviceName: ZodEffects<ZodAny, any, any>; filePath: ZodEffects<ZodAny, any, any>; }, "strip", ZodTypeAny, { deviceName?: any; filePath?: any; }, { ...; }>' is not assignable to type 'ZodObject<Required<{ deviceName: ZodType<string, any, string>; filePath: ZodType<string, any, string>; }>, UnknownKeysParam, ZodTypeAny, { ...; }, { ...; }>'.
Type '{ deviceName?: any; filePath?: any; }' is not assignable to type '{ deviceName: string; filePath: string; }'.
which are fixed if I provide the correct type to object
.
fix: #382 (comment)
I've added logic to graph the dependencies that GraphQL schemas have, and perform a topological sort based on that in order to resolve the dependencies. Normally, this sort is effective when there are no circular references, but I have made some modifications because users may generate code from schemas that have circular references.