Introspection Query is issued even if `schema` prop is provided
See original GitHub issueHey there, I’m using the latest 1.9.x
version of graphiql
and I’m seeing that the introspection query is always fired regardless of whether a schema
prop is provided to GraphiQL.
I don’t know if this is a new bug or not (or whether I’m missing something here), but I believe that this is the piece of logic that triggers this. Shouldn’t there be a check as to whether props.schema
is defined before proceeding with an Introspection call?
If so, I’m willing to open a PR to address that. Just let me know if I’m missing something or not.
Cheers!
P.S. For anyone else encountering this, at the moment of writing, the last working version is v1.8.10
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
IntrospectionQuery returns error "A query is required" #1444
I'm getting this error returned during an introspection query: "GraphQL.ExecutionError: A query is required. ---> GraphQL.
Read more >reactjs - Prevent Graphiql console from issuing multiple ...
The GraphiQL component accepts a schema prop: schema : a GraphQLSchema instance or null if one is not to be used. If undefined...
Read more >Why You Should Disable GraphQL Introspection In ...
GraphQL introspection enables you to query a GraphQL server for information about the underlying schema. This includes data like types, ...
Read more >Introspection
Introspection. It's often useful to ask a GraphQL schema for information about what queries it supports. GraphQL allows us to do so using...
Read more >The complete GraphQL Security Guide: Fixing the 13 most ...
A description of the 13 most common GraphQL vulnerabilities and how to mitigate them.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
While there, I also found a second bug that relates to the same hook. The
headers
that get passed over to the fetcher are never updated. They always hold their original 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
for me no matter what I’ve tried here.Thus the
headers.current
always holds the initial header value. After an hour’s worth of searching I traced it down to the fact that you’re attempting to read theEditorContext
from withinSchemaContextProvider
. Funnily though, theSchemaContextProvider
wraps theEditorContext
and that’s why you’re not getting any updates there. Reversing the order should fix it, unless the order of the providers was like that for a reasonUPDATE: Just because this is a separate issue, I’ve opened a new issue here so we can track both bugs separately (and help people find the related issues rather than opening new ones)
Just released the fix for this in
@graphiql/react@0.2.1
andgraphiql@1.9.4