hatchify icon indicating copy to clipboard operation
hatchify copied to clipboard

Sparse fieldsets returning all fields

Open arthurpankiewicz opened this issue 11 months ago • 1 comments

Describe the bug Querying by sparse fieldsets is not behaving as expected. When trying to specify multiple fields for one resource, it does not work (all fields are returned). It works if you specify the multiple fields for the one resource across multiple query params.

  • does not work, but should: [resource1]=field1,field2,field3
  • workaround: [resource1]=field1&[resource1]=field2&[resource1]=field3

To Reproduce Use the fields parameter with useAll or useDataGridState, it will structure the query in the jsonapi format, but the request will return all fields regardless.

Expected behavior Using the jsonapi URL format returns only specified fields.

arthurpankiewicz avatar Feb 12 '25 01:02 arthurpankiewicz

Hi folks! I can add some additional detail. This bug only shows up on included schemas. It behaves as expected on the base schema but fails to parse on the inlcuded schemas.

kt-mattie-langenberg avatar Mar 07 '25 19:03 kt-mattie-langenberg