-
-
Notifications
You must be signed in to change notification settings - Fork 894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(doctrine): fixed backed enum filter to use case name as value to filter by #6864
base: 3.4
Are you sure you want to change the base?
Conversation
can you rebase please? Not sure if this isn't breaking current implementations though |
08f842e
to
372c9c0
Compare
372c9c0
to
bd40751
Compare
Done. Probably would break custom implementations where people just accounted for this problem, but the current state basically means that filtering an enum, unless it's a string, just does not work at all. String based filtering I imagine might break, but then people could not relly on schema provided enumumeration and had to populate UI fields with static values or some javascript shenanigans. I've tested only with GraphQL, I sadly don't have time to try and play around with REST and whatever other versions there are. I also looked at the test cases for the filter - they are small and cover basically just string backed enum only, so i don't know what even the expectations here are, if any at all :D |
it looks like it breaks our tests, I'm surprised that this doesn't work as expected though. |
The last 2 tests breaking makes sense - it's just case sensitivity when comparing strings, fixable. The other tests, that check if the generated DQL query matches, now that's a head-scratcher. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Okay okay, I will update it today, chill bot :) |
In GraphQL enums are serialized using the case name, not the value of the enum in the responses. Backed Enum Filter users value as enum values, which is also hard coded to "string" type, which creates issues with backed enums of any other type than string (I run into this issue using a int backed enum).
This straightforward fix puts the expected filter values inline with the serialization of enums, so now you can use the GraphQL schema to populate your enum filter (schema defined enums as ENUM_NAME: ENUM_NAME and not ENUM_MANE: ENUM_VALUE )
One problem I do have is I can't make the schema to define the filter as Enum so it shows up as one in GraphQL schema, I'm probably missing something here.