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

BUG: Hasura v1.4alpha volatile functions not showing in the GraphQL Schema #6503

@leoalves

Description

@leoalves

When tracking a volatile function, the function is not showing in the GraphQL schema.

Hasura version: v1.4.0-alpha.1, deployed to Heroku.
https://bug-volatile-function-hasura.herokuapp.com/console

Steps to reproduce:

  1. create table
CREATE TABLE article
(
    id    serial primary key,
    title        TEXT not null,
    content      TEXT not null
);
  1. create function
CREATE OR REPLACE FUNCTION public.add_article(title text, content text)
 RETURNS SETOF article
 LANGUAGE plpgsql
AS $function$
DECLARE inserted_article_id integer;
BEGIN
  IF LENGTH(content) < 10 THEN
    INSERT into article (title, content) values (title, content) RETURNING id INTO inserted_article_id;
  ELSE
    RAISE EXCEPTION 'article is too large';
  END IF;
  RETURN QUERY SELECT * from article where id = inserted_article_id;
END;
$function$
  1. In the data tab track the table
  2. In the data tab track the function as a mutation

add_article does not show in the GraphQL schema.

I tried with and without the x-hasura-admin-secret in the server flags
Different functions
Adding permission to the role user and trying the role applied as user.

I wasn't able to make it work at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    k/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions