Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Native Enums Support #407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
enumag opened this issue Nov 15, 2021 · 4 comments
Closed

Native Enums Support #407

enumag opened this issue Nov 15, 2021 · 4 comments

Comments

@enumag
Copy link

enumag commented Nov 15, 2021

From the documentation I can see that this library supports myclabs/php-enum.

The upcoming PHP 8.1 will however have native enums. Are native enums supported as well? If not is there a plan to add the support? I'd like to move away from using myclabs enums if possible.

@oojacoboo
Copy link
Collaborator

Native enums aren't currently supported. However, a PR adding support for 8.1 will be happily accepted. Support for myclabs/php-enum will need to remain in place and deprecated until PHP 8.1 has a high enough use percentage.

@enumag
Copy link
Author

enumag commented Nov 16, 2021

Do you have some estimate of the scope? What would the PR need to implement? Would be helpful if someone wants to try and send such PR. Not saying I'll try. It's possible but can't promise it yet.

@oojacoboo
Copy link
Collaborator

oojacoboo commented Nov 16, 2021

I'm not familiar with the enum portion of the lib, but you'd basically just have to translate an Enum to a GraphQL enum type instead of the enum lib. The lib would need to support both, so you'd just add an additional type translation, basically.

It's probably about 3-4 hours of coding work to get looking good and maybe another hour to get the PR wrapped up.

@Lappihuan
Copy link
Contributor

@oojacoboo this can be closed since the PR is merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants