No such module 'ApolloAPI'

After I did all steps in Code Generation tutorial here: Get started with Apollo iOS codegen - Apollo GraphQL Docs , I keep getting Xcode error: No such module ‘ApolloAPI’.

I installed Apollo using Cocoapods.

Any help?

Thanks in advance!

I have the same problem:

I followed the process here: Apollo iOS 1.0 migration guide - Apollo GraphQL Docs

This is my config file:

{
  "schemaNamespace" : "ExampleApp",
  "schemaDownload": {
    "downloadMethod": {
        "introspection": {
            "endpointURL": "https://countries.trevorblades.com/graphql",
            "httpMethod": {
                "POST": {}
            },
            "includeDeprecatedInputValues": false,
            "outputFormat": "JSON"
        }
    },
    "downloadTimeout": 60,
    "headers": [],
    "outputPath": "./graphql/"
  },
  "input" : {
    "operationSearchPaths" : [
      "**/*.graphql"
    ],
    "schemaSearchPaths" : [
      "**/schema.json"
    ]
  },
  "output" : {
    "testMocks" : {
      "none" : {
      }
    },
    "schemaTypes" : {
      "path" : "./GeneratedAPI",
      "moduleType" : {
        "embeddedInTarget" : {
          "name" : "ExampleApp"
        }
      }
    },
    "operations" : {
      "inSchemaModule" : {
      }
    }
  }
}

And I am fetching Apollo iOS client from this repo: https://github.com/apollographql/apollo-ios/blob/main/Apollo.podspec:

I noticed how the source_files have Sources/ApolloAPI in there, but the framework itself is called Apollo

When I replace the imports statement in the generated code with Apollo (instead of ApolloAPI), then it compiles.

ApolloAPI is also nowhere in the framework list downloaded via Cocoapods:
Screenshot 2024-03-06 at 1.43.53 pm

Ok I found the solution, if you are importing via Cocoapods, you have to use this additional option so that it sets the right import:

Set this value to true and you are good to go