hasura / hasura/graphql-engine

Custom function mutations nor returning setof should be without where/limits/distinct

Open
#8,957 0 comments 0 reactions 0 assignees View on GitHub
k/bug t/native-dbs
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version:
v2.11.1-cloud.2

### Environment

Cloud/ OSS

### What is the current behaviour?

Hasura can track mutation from custom volatile postgres function that returns single object (not an array)

```
CREATE OR REPLACE FUNCTION myMutation(name text) RETURNS tbl1 LANGUAGE plpgsql AS
$$
BEGIN
INSERT INTO
tbl1(name)
VALUES
(name) RETURNING ret;
RETURN ret;
END;
$$
```

### What is the expected behaviour?

Just `arg: {name}` for this mutation in graphql schema - without `where: {} limit distint`

### How to reproduce the issue?

1. create and track posgres function as mutation
2. check graphql schema / graphqil

### Screenshots or Screencast
graphiql doc view:
![image](https://user-images.githubusercontent.com/16844103/189544888-d92ff37a-dad6-4f73-8343-4ddaea7af7c5.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.