Skip to content
New issue

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

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

Already on GitHub? # to your account

Throw better error when polymorphic type not found #123

Merged
merged 1 commit into from
Apr 19, 2019

Conversation

richmolj
Copy link
Contributor

@richmolj richmolj commented Apr 4, 2019

If you are sideposting a polymorphic relationship, and pass a jsonapi
type that is not registered, we would throw a confusing error. Now we
throw an explicit error with information about what's happening.

@richmolj
Copy link
Contributor Author

richmolj commented Apr 4, 2019

@wadetandy

Copy link
Contributor

@wadetandy wadetandy left a comment

Choose a reason for hiding this comment

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

Small comment but looks good overall!

polymorphic_belongs_to #{@sideload.name.inspect} do
group_by(#{@sideload.grouper.field_name.inspect}) do
on(:foo)
on(:foo).belongs_to :foo, resource: FooResource (long-hand example)
Copy link
Contributor

Choose a reason for hiding this comment

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

Pedantic fix: on(:foo).belongs_to :foo, resource: FooResource # (long-hand example)

If you are sideposting a polymorphic relationship, and pass a jsonapi
type that is not registered, we would throw a confusing error. Now we
throw an explicit error with information about what's happening.
@richmolj richmolj merged commit a634aef into graphiti-api:master Apr 19, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants