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

invalid mutation plan is still cached and reused for valid mutations #2363

Open
hos opened this issue Feb 8, 2025 · 0 comments
Open

invalid mutation plan is still cached and reused for valid mutations #2363

hos opened this issue Feb 8, 2025 · 0 comments
Labels

Comments

@hos
Copy link
Contributor

hos commented Feb 8, 2025

Summary

When mutation request is invalid, the plan is cached and reused for valid mutation plans.

Steps to reproduce

Here is an reproducible benjie/ouch-my-finger#19. First I failed to reproduce because, in graphiql, I was passing patch in the query instead of passing as variables. There is a query.graphql file with the query which can be used in graphiql. After server starts, first you need to run the mutation with invalid variables,
empty patch object, you will get error "no values were provided". After you update the patch and add some values there, you will still get the error.

Expected results

It should run successfully second time.

Actual results

It throws error like I didn't provide any values in the patch.

Additional context

Initially I tried to export the schema js, to see what is wrong in the plans. But I had a lot of custom plugins without EXPORTABLE, so I gave up. So for me it was a bit hard to debug this case to find what I'm doing wrong that I can't reproduce (I guess, it's a me issue), I'm curious if you have any advice for me to do smarter debugging of plans?

Possible Solution

  1. The step for fieldArgs should be re-executed, I'm not sure why it's reusing the plan (do args have plan / plan cache?). I think this one is strangest thing happening here.

  2. Does it makes sense to only cache the plans if they succeed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🌳 Triage
Development

No branches or pull requests

1 participant