graphql-hive / graphql-hive/envelop

useImmediateIntrospection is dangerously broken when combined with useValidationCache

Open
#2,560 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
No language data
Stars
827
Forks
132
PR merge metrics
No merged PRs in 30d

Description

useImmediateIntrospection assumes introspection query by default https://github.com/graphql-hive/envelop/blob/e45066cdabaa7324ce4587da600c4b7ee47a99f2/packages/plugins/immediate-introspection/src/index.ts#L39 and sets it to false when validation fails.

and when the validation is skipped then this will stay true ... so for the next run context creation is skipped for all queries.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in packages/plugins/immediate-introspection/src/index.ts at the default introspection handling around line 39, then trace how useValidationCache skips validation. Reproduce consecutive queries using both plugins and verify that a skipped validation does not leave useImmediateIntrospection true in a way that skips context creation for later queries.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.