Closed mrhardikjoshi closed 7 months ago
Just being the messenger from the Graphiti Slack so future perusers are aware...
I'm getting up to speed here and cleaning up some things and am going to have to trust the wisdom of @richmolj and close this PR until I'm more convinced that this is a real issue.
Fixes #301
The sparse fieldsets is not filtering relationships. Currently if we specify any attribute and/or relationship in
fields
param, it works correctly on attributes but the not on relationships. It returns all the relationships, ignoringfields
param. According to jsonapi format both attribute and relationship should be supported. This PR fixes that.In case of
fields
param having only attribute(s) in them, this change will restrict all relationships as well because of the following line from jsonapi format doc (fields represent both attributes and relationships)I have not changed
include
section because of the following specification from the jsonapi format doc.So in case of having a relationship mentioned in
include
and sparse fieldsets having some atttribute, this will still return the relationship but the linkage won't be there.