Skip to content
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

Allow Description attribute on class #270

Merged
merged 4 commits into from
Jul 1, 2022
Merged

Allow Description attribute on class #270

merged 4 commits into from
Jul 1, 2022

Conversation

jeremynikolic
Copy link
Contributor

@jeremynikolic jeremynikolic commented Jul 1, 2022

  • Added or updated tests
  • Added or updated the README.md
  • Detailed changes in the CHANGELOG.md unreleased section

Related Issue/Intent

We are working with this package alongside Lighthouse.
As an updated our GQL standards we realized auto generated GQL enums from BenShampo\Enum does not generate a description for the enum, only its values.

This PR propose broadening the usage of the Description attribute, so that it may be used on the Enum class itself.

Next step will be to update the LaravelEnumType from Lighthouse to include the description on the generated enum 😄

Changes

  • introduce new usage of Description attribute at class level
  • add new static method getClassDescription() on Enum
  • test new method getClassDescription()

Breaking changes

Nope.

* introduce new usage of Description attribute at class level
* add new static method getClassDescription() on Enum
* test new method getClassDescription()
src/Enum.php Outdated Show resolved Hide resolved
src/Enum.php Outdated Show resolved Hide resolved
src/Enum.php Outdated Show resolved Hide resolved
src/Enum.php Outdated Show resolved Hide resolved
src/Enum.php Outdated Show resolved Hide resolved
@spawnia spawnia marked this pull request as ready for review July 1, 2022 09:14
@jeremynikolic
Copy link
Contributor Author

@spawnia Thanks for your review 🙏

@spawnia spawnia merged commit db71ce6 into BenSampo:master Jul 1, 2022
@jeremynikolic jeremynikolic deleted the description_attribute_on_class branch July 1, 2022 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants