garph icon indicating copy to clipboard operation
garph copied to clipboard

Helper Methods: `or`

Open mishushakov opened this issue 1 year ago • 0 comments

or helper would help create a Union with the current type and the type specified in or

The use-case for the feature include error handling

Example:

const error = g.type('Error', {
  message: g.string()
})

g.type('Test', {
  test: g.string()
})
.or(error)

mishushakov avatar Mar 09 '23 15:03 mishushakov