Skip to content

Conversation

@jsampedro77
Copy link
Contributor

@jsampedro77 jsampedro77 commented Oct 28, 2025

The resource filters were lost when using a DTO as Resource and using stateOptions with 'entityClass' to specify which is the real doctrine class.

Q A
Branch? >=4.1.8
License MIT

When using a DTO as a resource and the stateOptions attribute to make the filters work with the real entity.

    stateOptions: new Options(entityClass: Property::class),

After this change #7109 , all the filters stopped being recognized. It seems that the code was refactored to use a trait, but the usage of this trait in the FieldsBuilder was missing.

@jsampedro77 jsampedro77 force-pushed the fix-fields-builder-state-options branch 2 times, most recently from 0e51804 to c89d93d Compare October 28, 2025 07:54
@soyuka soyuka changed the base branch from main to 4.1 October 31, 2025 08:47
@soyuka soyuka force-pushed the fix-fields-builder-state-options branch from c89d93d to b1fb4ce Compare October 31, 2025 08:50
The resource filters were lost when using a DTO as Resource and using stateOptions with 'entityClass' to specify which is the real doctrine class.
@soyuka soyuka force-pushed the fix-fields-builder-state-options branch from b1fb4ce to 780d3cf Compare October 31, 2025 08:52
@soyuka soyuka merged commit ddf4c0b into api-platform:4.1 Oct 31, 2025
108 of 111 checks passed
@soyuka
Copy link
Member

soyuka commented Oct 31, 2025

thanks

soyuka added a commit that referenced this pull request Oct 31, 2025
Co-authored-by: Nicolas LAURENT <aegypius@users.noreply.github.com>
Co-authored-by: Javier Sampedro <jsampedro77@gmail.com>
fix(laravel): serializer attributes on Eloquent methods (#7416)
fixes #7289
fixes #7338
fix(validator): custom message was not translated (#7424)
fixes #7336
fix(serializer): resilient denormalizeRelation capability (#7474)
fix(doctrine): properly set properties according to interface (#7487)
fix(graphql): stateOptions to get filter class (#7485)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants