Skip to content

Releases: graphiti-api/graphiti

Don't show pagination links on #show endpoints

09 May 13:01
Compare
Choose a tag to compare
1.2.42

Fix specs and rubocop issues

Fix issue with sideposted m2m validation

23 Apr 13:05
Compare
Choose a tag to compare

Don't blow up when missing/unexpected context

13 Apr 18:36
Compare
Choose a tag to compare
v1.2.40

Don't blow up when missing/unexpected context

Allow unwritable PK when associating on create

26 Mar 17:05
Compare
Choose a tag to compare

Fix issue with multiple extra_attributes without blocks

21 Mar 15:31
Compare
Choose a tag to compare
Ensure multiple extra_attrs without blocks work correctly

Two pieces of context needed:

First, there's a bunch of logic around serializer attributes:
subclassing resources, explicit serializers, defaults, overrides, etc.
And all of this gets dicey considering it all wraps and hacks an
external library, `jsonapi-serializable`.  So we're pretty dumb about
saying "any time we're doing something that can affect serialization,
re-configure everything".

Second, we recently accommodated the scenario where a parent resource
class guards an attribute, and a subclass removes that guard. The logic
added says "if this was previously guarded, remove the guard - as we're
adding the property again, the guard will get added again if it needs to
be".

These two scenarios conflicted. If you had two `extra_attribute` calls,
the second would cause the first to be re-applied as part of the
"reconfigure everything" approach. And when re-applied, we remove the
prior guard...expecting it to be added again as part of the idempotent
nature of the call.

This worked as expected if you passed a block, because you'd end up back
[here](https://github.com/graphiti-api/graphiti/blob/master/lib/graphiti/util/serializer_attributes.rb#L20).
But if you didn't pass a block, you'd end up [here](https://github.com/graphiti-api/graphiti/blob/master/lib/graphiti/util/serializer_attributes.rb#L24),
with the logic being "the only thing we need to do here is add the guard
back.

This was dumb! If you're going to do the "reconfigure everything"
approach, you need to ensure you're following the same codepath - not
this special codepath that was added. This had the adverse effect that
no guard was re-added (for extra attributes, the conditional [is added
in a different way](https://github.com/graphiti-api/graphiti/blob/master/lib/graphiti/extensions/extra_attribute.rb#L43) than a normal guard).

So the fix is to ensure we always follow the same codepath, which will
now correctly re-apply the guard. And added tests for the scenario where
multiple `extra_attributes` are added with and without blocks.

Finally, I'm not so sure about the wisdom of "reconfigure everything".
This was added 3 years ago as part of the major refactor that replaced
`jsonapi_suite` and became the `graphiti` we know and love today. It's
possible that the scenarios we were worried about are no longer
relevant, and this is more of a hindrance than a help. For now, simplest
fix.

Avoid requiring filter_groups in .find calls

18 Mar 19:43
Compare
Choose a tag to compare
v1.2.35

Fixed Standard error

v1.2.34: Merge pull request #336 from chiliburger/add-filter-group

16 Mar 03:56
054685c
Compare
Choose a tag to compare

1.2.25

02 Sep 12:36
1c03f11
Compare
Choose a tag to compare
Merge pull request #273 from richmolj/master

bump version

1.2.24

01 Sep 23:16
ab03cb9
Compare
Choose a tag to compare
Merge pull request #272 from richmolj/master

bump version

v1.2.23: Merge pull request #269 from richmolj/master

25 Aug 18:58
bf75a88
Compare
Choose a tag to compare