0

we using postgraphile in our project,

  • there is a graphile worker job in the task folder called email.ts
  • now i have a function in plpgsql with the below structure.
create or replace function public.function()
returns public.xyz as $$
begin
if //condition// then
  if //condition// then
    //some logic
    return xyz
  else
    //logic
    select graphile_worker.add_job('email', json_build_object('subject', subject, 'email', email));
    return null
  end if;
   return null;
 end if;
end;
$$ language plpgsql strict security definer;

now when I hit the mutation, im getting - "message": "query has no destination for result data" error which I remove the graphile_worker.add_job, its doesn't thow any error

Pratheek Reddy
  • 103
  • 1
  • 8

1 Answers1

0

we need to change

select graphile_worker.add_job

to

perform graphile_worker.add_job
Pratheek Reddy
  • 103
  • 1
  • 8