You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With graphql-request 5.2.0, Vars needs to extend from Variables, otherwise typescript complains that "Index signature for type 'string' is missing in type 'Vars'". But extending from Variables (and therefore introducing an index signature) means that unknown variables are not flagged anymore:
import{Variables,request}from"graphql-request";interfaceVarsextendsVariables{bar: string;}voidrequest<unknown,Vars>("...","...",{bar: "baz",wrong: 123,// <-- not flagged});
I wasn't unable to identify the exact change that caused it, unfortunately.
The text was updated successfully, but these errors were encountered:
Description
Please consider the following code, which worked fine with graphql-request 5.1.0:
If unknown variables are used, typescript would fail to compile:
With graphql-request 5.2.0,
Vars
needs to extend fromVariables
, otherwise typescript complains that "Index signature for type 'string' is missing in type 'Vars'". But extending fromVariables
(and therefore introducing an index signature) means that unknown variables are not flagged anymore:I wasn't unable to identify the exact change that caused it, unfortunately.
The text was updated successfully, but these errors were encountered: