-
Notifications
You must be signed in to change notification settings - Fork 65
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
Handle >2 union members in links #669
Conversation
@@ -158,93 +158,15 @@ export const getStringRepresentation: ( | |||
export const generateObjectTypes = (params: GeneratorParams) => { | |||
const { dir, types } = params; | |||
|
|||
// const plainTypesCode = dir.getPath("types"); |
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.
Yeah, I'm just killing all this commented out code: it's already drifting pretty far, so I don't think it makes much sense to keep it.
continue; | ||
} | ||
|
||
const isUnionType = Boolean(type.union_of?.length); | ||
const isIntersectionType = Boolean(type.intersection_of?.length); | ||
|
||
if (isIntersectionType) { | ||
if (isIntersectionType || isUnionType) { |
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.
Here's the actual fix: we just skip generating any type if it's actually a union instead of a separate type.
8222337
to
31e25af
Compare
@@ -274,7 +274,7 @@ SELECT (SELECT __param__test)` | |||
tuple: args, | |||
}); | |||
|
|||
assert.deepEqual(Object.values(complexResult.tuple), Object.values(args)); | |||
assert.deepEqual(complexResult.tuple, args); |
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.
This changed for no good reason, but our macos tests were failing with a test timeout until I did this update. 🫠
31e25af
to
c4fcad3
Compare
f6836cc
to
da6e8dc
Compare
21d9100
to
2c91512
Compare
We do not need to generate a separate object type for a type that is a union of other types since we will have already generated the individual types and the use of that type within another type will be handled by the declaration of the consumer of the union.
TODO: