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).

I.E.,

type MyVariablesType = { ... };
type MyResultType = { ... };
type MyOperationType = { variables: MyVariablesType, result: MyResultType };

const result: MyResultType = graphql<MyOperationType>("graphql string", {
variables: {
// MyVariablesType
}
})
interface GraphQLOperationType<IN, OUT> {
    result: OUT;
    variables: IN;
}

Type Parameters

Properties

Properties

result: OUT
variables: IN