GraphQL iOS Apollo Client Automatic Persisted Queries Causing a Crash

GraphQL iOS Apollo Client Automatic Persisted Queries Causing a Crash


1

Looking to get some help with setup of APQ’s on the iOS Apollo SDK, using version of Apollo 1.2.2 and when turned on the APQ as:

 let transport = RequestChainNetworkTransport(interceptorProvider: provider,
                                                     endpointURL: url,
                                                     autoPersistQueries: true)

Getting an error on query fetch as:

  Apollo/RequestBodyCreator.swift:47: Fatal error: To enable autoPersistQueries, Apollo types must be generated with operationIdentifiers 

I did add this snippet to config and re-ran code gen via cli:

  "options": {
       "operationDocumentFormat" : [
         "definition",
         "operationId"
       ]
  }

1 Answer
1


2

We ran into this same issue with 1.2. We upgraded to 1.7 and the issue was no longer. Wasn’t much involved with the upgrade either. A few items were deprecated but everything continued to work as is.

1

  • That worked! Thank you @djneely

    – Mishka

    3 hours ago




Leave a Reply

Your email address will not be published. Required fields are marked *