hasura / hasura/graphql-engine

Type composition for actions

Open
#7,883 1 comment 1 reaction 0 assignees View on GitHub
c/actions k/enhancement
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Is your proposal related to a problem?
Sometimes an action needs to support two different types as input, ala union types. E.g an action that can handle billing and refund for an e-commerce site.

### Describe the solution you'd like
When describing the input types for an action then a composition of types can be declared like
```
type Refund{
...someKeys
}

type Billing{
...someKeys
}

input Order {
args: Refund | Billing
}
```

### Describe alternatives you've considered
Currently the way to achieve this is loosely type the input to the action by using a JSON type.
### If the feature is approved, would you be willing to submit a PR?
Not experienced with Haskell, so won't be able to submit a PR.

Edit: for correctness of terms.

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.