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

Allow overlapping keys in polymorphic queries #723

Closed
scotttrinh opened this issue Aug 24, 2023 · 1 comment
Closed

Allow overlapping keys in polymorphic queries #723

scotttrinh opened this issue Aug 24, 2023 · 1 comment
Labels

Comments

@scotttrinh
Copy link
Collaborator

Currently if two subtypes contain the same keys, using the e.is function cannot generate the proper EdgeQL query.

Example:

Schema:

abstract type A {
  a: str;
}

type B extending A {
  b: int;
}

type C extending A {
  b: str;
}

EdgeQL:

select A {
  a,
  [is B].b,
  [is C].b
}

Query Builder:

e.select(e.A, () => ({
  a: true,
  ...e.is(e.B, { b: true }),
  ...e.is(e.C, { b: true }),
}));

In the Query Builder case, you end up overriding the e.B property with e.C rather than having both of them end up in the final query data structure.

@scotttrinh scotttrinh added the bug label Aug 24, 2023
@jaclarke
Copy link
Member

Duplicate of #630

@jaclarke jaclarke marked this as a duplicate of #630 Aug 24, 2023
@scotttrinh scotttrinh closed this as not planned Won't fix, can't repro, duplicate, stale Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants