iOS Main Thread blocked by Apollo

I’ve noticed that Apollo does its work on the Main thread, which is causing a UI hiccup in my app (the app freezes briefly) while Apollo processes the response. Note: this hiccup doesn’t happen for all calls, I’m guessing it just happens on larger responses. This happens even though I provide a background queue (e.g., .global()) to the client.fetch(query:queue:)

How can I avoid this? I’ve moved all the code before and after my client.fetch call to a background thread, but YOUR Apollo library is still using the main thread and blocking.

Am I doing something wrong? Can I avoid this?

Thanks

Hi @joe. Do you mind sharing a few more details about your set up; which version of apollo-ios and how you’re setting up your ApolloClient instance. We can better help you once we understand more about your configuration - thanks.

@calvincestari Thanks for replying; Apologies for not providing my setup info.

Apollo and Apollo/WebSocket (v0.50)

Here is a screenshot of all the Apollo setup code. I just use the client in my API code:
client.fetch and client.perform

Same issue here.

Frozen UI while fetching · Issue #1651 · apollographql/apollo-ios · GitHub