graphql-php icon indicating copy to clipboard operation
graphql-php copied to clipboard

Normalize phpenum type

Open shmax opened this issue 2 years ago • 3 comments

I'm starting to make heavier use of PhpEnumType, and its lack of configurability is starting to become an issue. Someone added support for a custom name recently, but I need the same support for 'description', and rather than start an optional argument chain I thought I'd see what you think about just doing the same config-based setup we do for everything else. In the spirit of brevity, I added a static fromPath helper that will allow that same one-liner feel (or we can ditch it). A backwards-compatible solution using a union type on the first argument may be possible, but I figure it might be best to just rip the band-aid off. Let me know what you think.

shmax avatar May 04 '23 17:05 shmax

Thanks for the comments. 👍 I'm happy with this if you are.

shmax avatar May 05 '23 09:05 shmax

if you really want this feature included in the library before then

Nah, I don't think there's any rush; in the meantime, I can just continue to access the public description property.

I am curious to know how you might propose to preserve bc...

shmax avatar May 05 '23 16:05 shmax

Merged latest. Still no rush, or anything, but it should be ready for next release.

shmax avatar Oct 01 '23 23:10 shmax