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

Resolvers are executed twice #810

Closed
kamek-pf opened this issue Feb 3, 2023 · 4 comments
Closed

Resolvers are executed twice #810

kamek-pf opened this issue Feb 3, 2023 · 4 comments

Comments

@kamek-pf
Copy link
Contributor

kamek-pf commented Feb 3, 2023

I recently came to realize Morpheus is executing resolvers twice for a single query.
This issue is similar to #806, but more general as it applies to all types of resolvers (queries, mutations and subscriptions).

I ran git bisect and the issue was introduced in #786.
To figure that out, I just added a print "running resolver" to the query resolver in the Mythology example.
If the log shows up more than once, you've reproduced the bug.

This method only proves the issue happens with query resolvers, but I've observed the same thing in my code base for mutations, and #806 reports the same behavior for subscriptions. It's probably fair to assume the root cause is the same in all 3 cases and that the bug was introduced by the same commit.

Here's the bisect log just in case:

git bisect start
# status: waiting for both good and bad commits
# bad: [a7634d448389698e85b850aebb340db4ed48046b] Relax text upped bounds
git bisect bad a7634d448389698e85b850aebb340db4ed48046b
# status: waiting for good commit(s), bad commit known
# good: [f9684d1451fd4ee3aabdb821424fd352003a3982] publish-release/0.20.1 (#741)
git bisect good f9684d1451fd4ee3aabdb821424fd352003a3982
# good: [76cef01abdc04e52b82aaad49bc7da35a9106ca4] Publish Release 0.23.0 (#772)
git bisect good 76cef01abdc04e52b82aaad49bc7da35a9106ca4
# good: [1d422eb1c2c40fee1148d236fc848144a0b08e11]  refactor: clean up (#785)
git bisect good 1d422eb1c2c40fee1148d236fc848144a0b08e11
# bad: [4b27e0fbc7e31d4febfddd6d2000b744f3cdf2d4] Up to date installation instructions (#796)
git bisect bad 4b27e0fbc7e31d4febfddd6d2000b744f3cdf2d4
# bad: [d4daae8b067baafe001ce58744ec582a6c1db979] Publish Release 0.26.0 (#789)
git bisect bad d4daae8b067baafe001ce58744ec582a6c1db979
# bad: [8c650560ad5c976d8d645212d467ddb9e0ea8503] Publish Release 0.25.0 (#787)
git bisect bad 8c650560ad5c976d8d645212d467ddb9e0ea8503
# bad: [2b2eb76e4cf9e9ed07b8cf65d6987af252aecdee] Named resolvers support batching (#786)
git bisect bad 2b2eb76e4cf9e9ed07b8cf65d6987af252aecdee
# first bad commit: [2b2eb76e4cf9e9ed07b8cf65d6987af252aecdee] Named resolvers support batching (#786)
@kamek-pf
Copy link
Contributor Author

kamek-pf commented Mar 1, 2023

@nalchevanidze sorry to bother you, I'd like to take a stab at this as it is blocking some of my own work. Do you have any idea what's going on, or any advice for me ?

@nalchevanidze
Copy link
Member

hi @kamek-pf ,sorry i had/have a lot of to do. i suspect introducing a new typed resolver model messes up the resolver calls. i will try to look on it and will try to fix it

@nalchevanidze
Copy link
Member

@kamek-pf my suspicion was true. this should fix it, i also added test to avoid this happening in future.

@kamek-pf
Copy link
Contributor Author

kamek-pf commented Mar 2, 2023

Can confirm #812 fixes the issue for both mutation and queries.
Thank you so much @nalchevanidze !

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

No branches or pull requests

2 participants