Skip to content
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

feat: add validationSchemaExportType to config w/ resolve deps #389

Merged
merged 10 commits into from
Jun 8, 2023

Conversation

Code-Hex
Copy link
Owner

@Code-Hex Code-Hex commented Jun 8, 2023

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.

@Code-Hex
Copy link
Owner Author

Code-Hex commented Jun 8, 2023

@elijaholmos Thank you!

@Code-Hex Code-Hex merged commit ee78cf3 into main Jun 8, 2023
@Code-Hex Code-Hex deleted the add/sort-deps branch June 8, 2023 10:15
@Code-Hex
Copy link
Owner Author

Code-Hex commented Jun 8, 2023

#164

@elijaholmos
Copy link
Contributor

@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({

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants