Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integration-tests/lts/dbschema/default.esdl
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ module default {
property c -> bool;
}
type Z {
link xy -> W | X | Y;
multi link xy -> W | X | Y;
}

# Unicode handling
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/lts/interfaces.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export interface test_Profile extends BaseObject {
c?: string | null;
}
interface test_Z extends BaseObject {
xy?: W | X | Y | null;
xy?: (W | X | Y)[];
}
interface test_User extends BaseObject {
username: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/generate/src/edgeql-js/generateInterfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ export const generateInterfaces = (params: GenerateInterfacesParams) => {
Boolean(targetType.union_of?.length);

if (isUnion) {
return targetType.union_of
return `(${targetType.union_of
.map(({ id }) => types.get(id))
.map((member) => getTypeName(member.name))
.join(" | ");
.join(" | ")})`;
} else if (isLink) {
return getTypeName(targetType.name);
} else {
Expand Down
Loading