Improve the completions of Mock types when using ApolloTestSupport #3451
Labels
codegen
Issues related to or arising from code generation
feature
New addition or enhancement to existing solutions
low-priority
testing
Use case
We're working on updating our tests to use the generated
ApolloTestSupport.Mock
initializers. We've noticed that it's fairly difficult to create theMocks
and response types..from(...)
, autocomplete shows everyMock
init that's accessible..from(...)
is passed an incorrectMock
type, it fails at runtime.Mock
to create it by looking at the selection set's__parentType
property in the generated code.Describe the solution you'd like
Ideally there'd be more type information in the
MockObject
and selection sets. The the compiler could tell whether.from(...)
is being passed a mock that is valid for the selection set and resolve the difficulties from above..from(...)
is being called on.The text was updated successfully, but these errors were encountered: