Skip to content

fix: skip introspection when IntrospectionQuery is passed as schema prop#4181

Open
trevor-scheer wants to merge 2 commits intographql:mainfrom
trevor-scheer:fix/introspection-schema-prop
Open

fix: skip introspection when IntrospectionQuery is passed as schema prop#4181
trevor-scheer wants to merge 2 commits intographql:mainfrom
trevor-scheer:fix/introspection-schema-prop

Conversation

@trevor-scheer
Copy link
Copy Markdown
Contributor

The schema prop accepts GraphQLSchema | IntrospectionQuery | null, but shouldIntrospect only checked for a GraphQLSchema instance via isSchema. When an IntrospectionQuery was passed, it was ignored and a network introspection request was still triggered.

It now detects IntrospectionQuery data via __schema check, builds a GraphQLSchema from it, and correctly sets shouldIntrospect to false.

The schema prop accepts GraphQLSchema | IntrospectionQuery | null, but
shouldIntrospect only checked for GraphQLSchema via isSchema(). When an
IntrospectionQuery was passed, it was ignored and a network introspection
request was triggered instead.

Now detects IntrospectionQuery data (via __schema check), builds a
GraphQLSchema from it using buildClientSchema, and sets shouldIntrospect
to false.
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 27, 2026

🦋 Changeset detected

Latest commit: 8bc206e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@graphiql/react Patch
graphiql Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@trevor-scheer trevor-scheer changed the title fix: skip introspection when IntrospectionQuery is passed as schema prop fix: skip introspection when IntrospectionQuery is passed as schema prop Mar 27, 2026
@trevor-scheer trevor-scheer changed the title fix: skip introspection when IntrospectionQuery is passed as schema prop fix: skip introspection when IntrospectionQuery is passed as schema prop Mar 27, 2026
Use introspectionFromSchema to generate a properly typed fixture instead
of a hand-rolled minimal object. This avoids casts and ts-expect-error
while satisfying both Fetcher and IntrospectionQuery types.
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

Successfully merging this pull request may close these issues.

1 participant