The shape customers can use to provide T to graphql<T>() to specify both IN and OUT types (the type of variables and the return type, respectively).
T
graphql<T>()
IN
OUT
variables
I.E.,
type MyVariablesType = { ... };type MyResultType = { ... };type MyOperationType = { variables: MyVariablesType, result: MyResultType };const result: MyResultType = graphql<MyOperationType>("graphql string", { variables: { // MyVariablesType }}) Copy
type MyVariablesType = { ... };type MyResultType = { ... };type MyOperationType = { variables: MyVariablesType, result: MyResultType };const result: MyResultType = graphql<MyOperationType>("graphql string", { variables: { // MyVariablesType }})
The shape customers can use to provide
T
tographql<T>()
to specify bothIN
andOUT
types (the type ofvariables
and the return type, respectively).I.E.,