glesys / butler-graphql

An opinionated GraphQL package for Laravel.
MIT License
34 stars 5 forks source link

Support passing php Enums to resolvers. #49

Closed emil-nasso closed 2 years ago

emil-nasso commented 2 years ago

Currently, all enums are converted to strings by the library.

This patch changes that behavior by only converting enums to strings if no other resolvers could be found for the field. This enables passing enums to resolvers/types.

emil-nasso commented 2 years ago

I have rewritten the test to simplify the test-cases and make the purpose of the change a bit easier to understand.