hasura / hasura/graphql-engine
v1.2.0.beta.2 Bug: Not interpreting postgres function argument type of `uuid[]` correctly
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
### Version Information
v1.2.0.beta.2
### What is the expected behaviour?
The postgres (mutation) function starts off like this:
```sql
CREATE
OR REPLACE FUNCTION public.u_testset_tests(
id uuid,
tests uuid [],
recorded_at timestamp with time zone,
hasura_session json
) RETURNS SETOF tests LANGUAGE plpgsql AS $ function $
...
```
Hasura is generating the API as follows:
```
id: uuid
recorded_at: timestamptz
tests: _uuid # <- Problem
```
### Keywords
postgres function array
### How to reproduce the issue?
1. Make a postgres function with an arg of type uuid[]
2. See if API is correct for args type
### Any possible solutions?
I'm pretty sure this used to work correctly in a previous version.
### Can you identify the location in the source code where the problem exists?
No.
### If the bug is confirmed, would you be willing to submit a PR?
No, apologies.
Thank you very much for looking into this,
Lydia
Contributor guide
Research direction
Start by reproducing the issue with a PostgreSQL function argument declared as uuid[] and inspect the generated API schema, especially why it is exposed as _uuid. Trace the PostgreSQL function argument type mapping from schema introspection to the generated GraphQL API. Done means uuid[] is represented correctly without regressing other function argument types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, postgresql
- Domain
- api, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100