Giter Site home page Giter Site logo

Comments (3)

jackfischer avatar jackfischer commented on May 29, 2024

This is probably an issue of the query builder generating an incorrect query, so would probably file this against the respective query builder repo

from edgedb.

corbinday avatar corbinday commented on May 29, 2024

@jackfischer Rewriting the query a little more naturally, I discovered that it seems to be a problem with the std:: prefix on the inner assert_single

If I do the following it still fails with QueryError: invalid reference to link property in top level shape:

WITH
  relationships := <json>$relationships
SELECT (FOR item IN json_array_unpack(relationships)
UNION (
  assert_single((
  UPDATE SurveyModule
  FILTER .prismaID = <int32>(item["moduleId"])
  SET {
    questions += (
      std::assert_single(( # 👈
      SELECT detached Question {
        @displayOrder := <std::int16>(item["questionDisplayOrder"])
      }
      FILTER .prismaID = <int32>(item["questionId"])))
    )
  }))
))

However, if I remove the std:: prefix, the query works:

WITH
  relationships := <json>$relationships
SELECT (FOR item IN json_array_unpack(relationships)
UNION (
  assert_single((
  UPDATE SurveyModule
  FILTER .prismaID = <int32>(item["moduleId"])
  SET {
    questions += (
      assert_single(( # 👈
      SELECT detached Question {
        @displayOrder := <std::int16>(item["questionDisplayOrder"])
      }
      FILTER .prismaID = <int32>(item["questionId"])))
    )
  }))
))

Does that still seem like a query builder issue to you? If so, I'll go file it on the Typescirpt repo.

Thanks for your help.

from edgedb.

corbinday avatar corbinday commented on May 29, 2024

In fact, simpler queries like the following are also giving me the same error because of the std:: prefix.

update SurveyModule
filter .prismaID = <int32>3
set {
  questions += (
    std::assert_single(
      (
        select detached Question {
        @displayOrder := <int16>3
      }
      filter .id = <uuid>"badeaec0-ae44-11ee-a055-5bf3e38d49ce"
    )))
}

from edgedb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.