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

codegen: fix the run order of resolvers #2267

Merged
merged 5 commits into from
Jul 3, 2022
Merged

codegen: fix the run order of resolvers #2267

merged 5 commits into from
Jul 3, 2022

Conversation

giautm
Copy link
Contributor

@giautm giautm commented Jul 2, 2022

We (entgql) have a report from @amrnt about the unexpected result when he want to trying to use the custom Input field to set the value for the mutation's input.

Because with range the order of the map's iteration is randomized, so the custom field may run first then overrided by the original input.

You can run the test here few times without cache: ent/contrib@master...amrnt:contrib:custom-input-field

I have:

  • Added tests covering the bug / feature (see testing)
  • Updated any relevant documentation (see docs)

@giautm giautm changed the title codegen: fix run order of resolvers codegen: fix the run order of resolvers Jul 2, 2022
@coveralls
Copy link

coveralls commented Jul 2, 2022

Coverage Status

Coverage remained the same at 75.097% when pulling 5294611 on giautm:giautm/run-field-resolver-in-correct-order into 8481457 on 99designs:master.

Copy link
Collaborator

@a8m a8m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

codegen/input.gotpl Outdated Show resolved Hide resolved
@giautm
Copy link
Contributor Author

giautm commented Jul 3, 2022

Hello @StevenACoffman, please review this PR. I have added tests and updated the template to generate the input resolver

Copy link
Collaborator

@a8m a8m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK! Looks good 😍

Thanks for addressing this @giautm

@a8m a8m merged commit c287a7b into 99designs:master Jul 3, 2022
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.

3 participants