stepci / garph

Fullstack GraphQL Framework for TypeScript
https://garph.dev
MIT License
1.31k stars 17 forks source link

Helper Methods: `or` #41

Open mishushakov opened 1 year ago

mishushakov commented 1 year ago

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)