You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can potentially specify these in the meta extensions e.g. string().meta({ type: 'id' }), alternatives(a, b).meta({ type: 'interface|union' }), object({ red: 1, green: 2 }).meta({ type: 'enum' }).
Or we can use custom Joi extensions, e.g. string().id(), interface(a, b), union(a, b), enum({ red: 1, green: 2 }).
The advantage of the former is we can easily leverage the extra validation from existing Joi types, the latter is more obvious how it maps to GraphQL.
The text was updated successfully, but these errors were encountered:
FWIW right now we use union type in the case of array and alternatives and ignore the rest of the types that don't map well... that might be okay for now.
Types that map well
Types that don't map well
We can potentially specify these in the meta extensions e.g.
string().meta({ type: 'id' })
,alternatives(a, b).meta({ type: 'interface|union' })
,object({ red: 1, green: 2 }).meta({ type: 'enum' })
.Or we can use custom Joi extensions, e.g.
string().id()
,interface(a, b)
,union(a, b)
,enum({ red: 1, green: 2 })
.The advantage of the former is we can easily leverage the extra validation from existing Joi types, the latter is more obvious how it maps to GraphQL.
The text was updated successfully, but these errors were encountered: