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

Can't access link properties on computed backlinks #929

Open
nathanburgess opened this issue Mar 29, 2024 · 0 comments
Open

Can't access link properties on computed backlinks #929

nathanburgess opened this issue Mar 29, 2024 · 0 comments
Labels
bug upstream:edgedb Issue produced by changes to EdgeDB/EdgeQL

Comments

@nathanburgess
Copy link

Code

const query = e.params(
  {
    parentId: e.uuid,
  },
  (params) =>
    e.select(e.Child, (child) => ({
      filter_single: e.op(params.parentId, "in", child.parents.id),
      parents: (parent) => ({
        "@prop": true,
        filter_single: e.op(parent.id, "=", params.parentId),
      }),
    })),
);

Schema

module default {
  type Child {
    multi link parents := .<children[is xlb::Parent];
  }

  type Parent {
    mutli link children: Child {
      prop: str;
    }
  }
}

Generated EdgeQL

This query causes the builder to throw an error, it's not possible to call .toEdgeQL

Error or desired behavior

  ../packages/datalayer/edgedb/edgeql-js/select.ts (1209:12) @ resolveShapeElementError: link property '@prop' does not exist on link projects
 at resolveShapeElement (webpack-internal:///(rsc)/../../packages/datalayer/edgedb/edgeql-js/select.ts:501:19)
 at resolveShape (webpack-internal:///(rsc)/../../packages/datalayer/edgedb/edgeql-js/select.ts:439:26)
 at resolveShapeElement (webpack-internal:///(rsc)/../../packages/datalayer/edgedb/edgeql-js/select.ts:470:75)
 at resolveShape (webpack-internal:///(rsc)/../../packages/datalayer/edgedb/edgeql-js/select.ts:439:26)
 at Object.select (webpack-internal:///(rsc)/../../packages/datalayer/edgedb/edgeql-js/select.ts:399:47)
 at eval (webpack-internal:///(rsc)/./src/app/sandbox/page.tsx:26:77)
 at Object.params (webpack-internal:///(rsc)/../../packages/datalayer/edgedb/edgeql-js/params.ts:37:22)
 at eval (webpack-internal:///(rsc)/./src/app/sandbox/page.tsx:24:78)
 }
   1207 |     const linkProp = (scope as any)[key];
   1208 |     if (!linkProp) {
 > 1209 |       throw new Error(
        |            ^
   1210 |         (scope as any).__parent__
   1211 |           ? `link property '${key}' does not exist on link ${
   1212 |               (scope as any).__parent__.linkName

Versions (please complete the following information):

  • OS: MacOS Sonoma 14.3
  • EdgeDB version (e.g. 2.0): 4.5+641a8f3
  • EdgeDB CLI version (e.g. 2.0): 4.1.0+a8fe4d7
  • edgedb-js version (e.g. 0.20.10;): 1.4.1
  • @edgedb/generate version (e.g. 0.0.7;): 0.4.1
  • TypeScript version: 5.2.2
  • Node/Deno version: 20.9.0
@scotttrinh scotttrinh added bug upstream:edgedb Issue produced by changes to EdgeDB/EdgeQL labels Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug upstream:edgedb Issue produced by changes to EdgeDB/EdgeQL
Projects
None yet
Development

No branches or pull requests

2 participants