fix: sparse fields set not applied to query #498
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
continuation of #476
Indeed, @milosloub, there are still some issues; I was too hasty with replacing
Get
with the newGetQueryable
.Interestingly enough tests are not failing. Some investigation about this:
Fields_Query_Selects_Sparse_Field_Sets
is not failing because, even though the sparse field set is not processed in the SQL query, theDocumentBuilder
still removes the fields from the output JSON. This behaviour annoys me: (de)serialization should be decoupled fromJsonApiContext
, see Deserializer only links attributes and not included relationships #497. I don't think we can properly integration test the usage of the newGetQueryable
without getting rid of this behaviour in the serialization layer, but that is beyond the scope of this PR.I suspect the same goes for the other sparse field set tests.
I have changed a few things that should apply it to the queries again. All tests are passing, let me know if you have any more comments or an idea how we could more thoroughly test the new
GetQueryable
. (Note that the previousGet
wasn't properly tested for sparse field selection neither)