-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Introspection Query always uses initial headers #2442
Comments
Thank you for reporting this @3nvi ! |
Hey @3nvi and thanks again for reporting! Currently the Eventually I wanted to move these methods ( Happy if you wanna work on this, otherwise I'd address this start of next week! |
Given that you already have a plan laid out, I feel that it would take a lot of back-and-forth between us to align in the approach. I'll let you work on it, but feel free to ping me if you need help or turns out that you don't have any free time :) |
That sounds good to me! I'll take a look into this later today. |
In the latest
v1.9.x.
release, theheaders
used for the introspection query (and potentially for other queries as well) are never updated, but instead, retain their initial value.The culprit here is this effect. Whenever I change the
headers
in the secondary editor (regardless of whether their value is controlled or not), theuseEffect
never fires, cause theheaderEditor
is alwaysnull
no matter what I've tried here.Thus the
headers.current
ref always holds its initial value.After some searching, I traced it down to the fact that you're attempting to read the
EditorContext
from withinSchemaContextProvider
. Funnily though, theSchemaContextProvider
wraps theEditorContext
and that's why you're not getting any updates there. Reversing the order of the providers should fix it unless the order of the providers was like that for a particular reason (haven't delved deeper into the latter).I'm willing to work on a PR if you feel that a component order reverse shouldn't create any major problems.
Thanks!
P.S. For anyone else encountering this, at the moment of writing, the last working version is
v1.8.10
The text was updated successfully, but these errors were encountered: