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

Computed fields: Function name dropdown does not show the available functions for selection #6769

gregoryforel opened this issue Apr 9, 2021 · 2 comments
a/data c/console Related to console support/needs-more-info Needs more details/info/repro instructions


Copy link

I'm trying to add a computed field with Hasura cloud v2.0.0-cloud.2.

I've already added some custom functions, but none are available for selection in the Function name dropdown.

My functions:

Empty list of functions:

Thank you!

@rikinsk rikinsk added c/console Related to console k/bug Something isn't working and removed k/bug Something isn't working labels Apr 21, 2021
Copy link

rikinsk commented Apr 21, 2021

@gregoryforel the console only displays functions that are valid to be added as computed fields for the table. Can you confirm your functions meet the requirments as described in the docs?

@rikinsk rikinsk added the support/needs-more-info Needs more details/info/repro instructions label Apr 21, 2021
Copy link

I've got the same issue, and was collecting proofs to report it here,
but then I noticed the "optionally schema-qualified" note in the CREATE FUNCTION: argtype docs

In my case, the table is "public"."record",
I specified the schema for the function itself,
but not for its table argument:

CREATE OR REPLACE FUNCTION "public"."get_record_foo"("record" record, "hasura_session" json)

I checked the API response Hasura Console uses to populate this "Function Name" dropdown
and found that record type was taken from built-in pg_catalog schema:

\"input_arg_types\":[{\"schema\" : \"pg_catalog\", \"name\" : \"record\"...

After I added the correct schema name "public" to the argument type:

CREATE OR REPLACE FUNCTION "public"."get_record_foo"("record" "public"."record", "hasura_session" json)

...the issue got fixed: the function is now available in the "Function Name" dropdown,
and that API response shows correct schema too:

\"input_arg_types\":[{\"schema\" : \"public\", \"name\" : \"record\"

I hope this will help to people that found this issue page for a similar reason

@rikinsk, could you please update Hasura docs to help others to avoid this trap:
in the line "Table Argument: One input argument with a table row type"
please add "(optionally schema-qualified to avoid confusion with built-in types like record)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
a/data c/console Related to console support/needs-more-info Needs more details/info/repro instructions
None yet

No branches or pull requests

4 participants