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

Throw GraphQL error when ModelNotFoundException is thrown in CanDirective #1225

Merged
merged 8 commits into from
Mar 9, 2020
Merged

Throw GraphQL error when ModelNotFoundException is thrown in CanDirective #1225

merged 8 commits into from
Mar 9, 2020

Conversation

andershagbard
Copy link
Contributor

  • Added or updated tests
  • Added Docs for all relevant versions N/A
  • Updated CHANGELOG.md

Changes
Catch ModelNotFoundException in CanDirective and instead throw GraphQL\Error\Error.

Also improved a few tests with GraphQL errors.

Breaking changes
Using @can no longer throws ModelNotFoundException when model is not found. Instead the object returns as null, and a GraphQL error is sent. Status code is also changed to 200.

CHANGELOG.md Outdated Show resolved Hide resolved
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.

Agree with the change, thanks. Will merge once the review comments are addressed.

@andershagbard andershagbard requested a review from spawnia March 9, 2020 14:14
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.

Well done!

@spawnia spawnia merged commit a0c2103 into nuwave:master Mar 9, 2020
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

Successfully merging this pull request may close these issues.

2 participants