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

Why does Hasura map text[] to _text type instead of [String!]? #7187

@ethanabrooks

Description

@ethanabrooks

I have the following SQL function:

CREATE OR REPLACE FUNCTION public.my_function(texts text []) 
RETURNS SETOF table 
LANGUAGE sql STABLE
AS $ function $
SELECT  * FROM table 
$ function $

I have added this to my database and the function that Hasura exposes over the GraphQL API looks like:

query MyQuery($texts: _text = "") {
  my_function(args: {texts: $texts}) {
    id
  }
}

where $texts ends up needing to be an argument that looks like "{a,b,c}". In my opinion this is a bit awkward. Furthermore, the _text type is not documented by Hasura:
image

It would seem that an argument of type text[] would more naturally map to [String!]. Is there a reason not to do that? Also, is there a work around on my end that can force Hasura to choose this mapping?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions