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

Support custom rule classes in @rules and @rulesForArray #812

Merged
merged 15 commits into from
May 26, 2019
Merged

Support custom rule classes in @rules and @rulesForArray #812

merged 15 commits into from
May 26, 2019

Conversation

oozman
Copy link
Contributor

@oozman oozman commented May 25, 2019

  • Added or updated tests
  • Added Docs for all relevant versions
  • Updated the changelog

Support or allow custom rules in @rules directive.

Usage

php artisan make:rule MyCustomRule

and in your schema.graphql

input FooBar {
    field: String! @rules(apply: ["required", "App\\Rules\\MyCustomRule"])
}

src/Schema/Directives/RulesDirective.php Outdated Show resolved Hide resolved
@spawnia spawnia changed the title Support custom rules. Support custom rule classes in @rules and @rulesForArray May 25, 2019
@spawnia
Copy link
Collaborator

spawnia commented May 25, 2019

@OmarUsman hey, thanks for the PR. I like the idea behind this, the approach is elegant.

In order for this to be merged, make sure you can check the boxes in the PR template (i added them back in to the description.). Tests, Docs and the Changelog should be in place.

In addition to the @rules directive, the @rulesForArray directive should also receive an update.

@oozman
Copy link
Contributor Author

oozman commented May 26, 2019

@spawnia Made some changes. 😊

Copy link
Collaborator

@spawnia spawnia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave it some polish, good to go now, thanks!

@spawnia spawnia added the enhancement A feature or improvement label May 26, 2019
@spawnia spawnia requested a review from chrissm79 May 26, 2019 18:29
@chrissm79
Copy link
Contributor

This is awesome, thanks @OmarUsman and @spawnia!

@chrissm79 chrissm79 merged commit 485a4ab into nuwave:master May 26, 2019
@oozman
Copy link
Contributor Author

oozman commented May 27, 2019

@spawnia cool 😊

@jampack jampack mentioned this pull request Jul 20, 2019
3 tasks
spawnia pushed a commit that referenced this pull request Jul 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants