How to mock the ApolloClientProtocol, apollo-ios v1.0.6

Hello all, does anyone have any examples of how to mock the ApolloClientProtocol? Have been trying for a while now but cant get it to click, nor find any code examples seemingly doing this.

Im trying to get the previews and UITests to run currently (SwiftUI), I see theres a React { MockedProvider} and MockServer for Kotlin is there any equivalent in iOS?

I have read Issue 983 amongst others which has led me here.

Thanks for any help

Hi - here’s a very quick and dirty sample SPM project that mocks ApolloClientProtocol and stubs out the responses. Hope this helps, it should be enough to get you moving forward.

1 Like

Thanks for your help, I will have a go with that, much appreciated.