question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Introspection Query is issued even if `schema` prop is provided

See original GitHub issue

Hey 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:closed
  • Created a year ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
3nvicommented, May 26, 2022

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), the useEffect never fires, cause the headerEditor is always null 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 the EditorContext from within SchemaContextProvider. Funnily though, the SchemaContextProvider wraps the EditorContext 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 reason

UPDATE: 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)

0reactions
thomasheyenbrockcommented, May 29, 2022

Just released the fix for this in @graphiql/react@0.2.1 and graphiql@1.9.4

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found