Closed zhouzi closed 3 years ago
Hey @Zhouzi thanks for reaching out! I'm not too experienced with typescript generics, but what you describe sounds like a better DX for sure. If you're up for spiking it out on a PR, that would be really cool! I think that's the best way for us to check if we're missing any edge cases :)
Currently, calling
query
ormutation
is a bit tedious as it requires to define precisely their return value. For example:Adding the
data
property and having to mockerrors
is redundant. It can be simplified by usinggraphql
'sExecutionResult
. The above example could be turned into:I think it would be ideal if
TestQuery
could useExecutionResult
so we'd end up with:I would be happy to submit a PR if that's something you would consider. I might miss some use cases so let me know what you think.