这是indexloc提供的服务,不要输入任何密码
Skip to content

Mutation Result Get Postgres Query Error when returning null linked field #3754

@jcmoore0

Description

@jcmoore0

Team - I am getting a mutation failure.
v.1.1.0-beta.2 not sure if in previous builds

Problem: Mutation is failing due to null type cast.

Browser Response:

{"errors":[{"extensions":{"path":"$","code":"unexpected"},"message":"postgres query error"}]}

Postgres Error:

SQL Error [42883]: ERROR: operator does not exist: text = integer
  Hint: No operator matches the given name and argument types. You might need to add explicit type casts.

Root Cause:

with "public_test__mutation_result_alias" as (
select * from (
values (('false')::boolean,
null,     <--  this needs to be cast as an integer  (e.g. null::integer)  for joining template_id = id  below
...
select
	json_build_object('affected_rows', 
...
            (select * from "public"."test_template" where ((("_0_root.base"."template_id") = ("id")) and

Additional Comments:
This is a outer join to a related table (integer to integer) with no foreign keys.
If the value of the id is not null, the response is ok.

Thanks!
John

Metadata

Metadata

Assignees

No one assigned

    Labels

    c/serverRelated to serverk/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions