Title
r

Rory Kelly

05/16/2018, 11:05 AM
What does a resolver function that returns an enum look like? I cant find any examples for graphql yoga?
i

iamclaytonray

05/16/2018, 11:48 AM
What are you looking to do? You shouldn’t need to implement enums in your resolvers because you are grabbing data from the context object and saving to the DB (or whatever you are doing with the data). The only place enums are exposed are when you are writing mutations. (Unless you are writing some interfaces, in which case, you can just add them to the interface, not the resolver)
n

nilan

05/22/2018, 1:02 PM
Not sure I'd agree with you @iamclaytonray, you can totally return enums from a query.
i

iamclaytonray

05/22/2018, 1:07 PM
How would you do that?