Skip to content
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

@rename doesn't work as expected: no filters #88

Closed
LastDragon-ru opened this issue Jul 30, 2023 · 7 comments · Fixed by #89
Closed

@rename doesn't work as expected: no filters #88

LastDragon-ru opened this issue Jul 30, 2023 · 7 comments · Fixed by #89
Assignees
Labels
bug Something isn't working pkg: graphql
Milestone

Comments

@LastDragon-ru
Copy link
Owner

LastDragon-ru commented Jul 30, 2023

I am using 4.5.0 and actually just upgraded. However, I think I found where the value is lost:
image

The input is still country_code but the type's property is countryCode and hence the arguments are empty and the filter is not applied:
image

Originally posted by @jaulz in #87 (comment)

@LastDragon-ru LastDragon-ru added bug Something isn't working pkg: graphql labels Jul 30, 2023
@LastDragon-ru LastDragon-ru added this to the 4.x milestone Jul 30, 2023
@LastDragon-ru LastDragon-ru changed the title @rename doesn't work as expected @rename doesn't work as expected: no filters Jul 30, 2023
@LastDragon-ru
Copy link
Owner Author

The problem is the $value passed into ArgBuilderDirective::handleBuilder() contains renamed properties, not the original. Thus, we cannot create the valid Argument.

The second problem: the tests are ok.

@jaulz
Copy link

jaulz commented Jul 30, 2023

Yeah, I was also wondering why the tests were running fine but I could not trace it down yet. While running the tests, $value actually contains the unrenamed keys.

@jaulz
Copy link

jaulz commented Jul 30, 2023

Why do we need the getArgumentSet at all? 🤔 Wouldn't it just convert the property names back and forth?

@LastDragon-ru
Copy link
Owner Author

Why do we need the getArgumentSet at all?

To work directly with directives which also allows to add operators inside the schema, it is also allow create complex queries like #11.

Seems I have an idea... I will try to create PR for lighthouse within a few days. If it will be accepted the Argument will be passed directly into ArgBuilderDirective that should resolve the issue.

@jaulz
Copy link

jaulz commented Jul 30, 2023

Great, sounds good. Thanks for the library and your efforts! ✌️

@LastDragon-ru LastDragon-ru linked a pull request Jul 31, 2023 that will close this issue
LastDragon-ru added a commit that referenced this issue Jul 31, 2023
@LastDragon-ru LastDragon-ru self-assigned this Jul 31, 2023
@LastDragon-ru
Copy link
Owner Author

Should be fixed in v4.5.1, please try

@jaulz
Copy link

jaulz commented Jul 31, 2023

Wow, nice, that worked as far as I can see 😊 Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg: graphql
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants