# No such module 'ApolloAPI'

**URL:** <https://community.apollographql.com/t/no-such-module-apolloapi/7011>\
**Category:** Client SDKs\
**Tags:** ios\
**Created:** [December 1, 2023, 1:19pm UTC](https://community.apollographql.com/t/no-such-module-apolloapi/7011 "2023-12-01T13:19:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lux1706](https://avatars.discourse-cdn.com/v4/letter/l/f475e1/32.png) [@lux1706](https://community.apollographql.com/u/lux1706)\
**Post date:** [December 1, 2023, 1:19pm UTC](https://community.apollographql.com/t/no-such-module-apolloapi/7011/1 "2023-12-01T13:19:43Z")

</div>

After I did all steps in `Code Generation` tutorial here: [Get started with Apollo iOS codegen - Apollo GraphQL Docs](https://www.apollographql.com/docs/ios/tutorial/codegen-getting-started) , I keep getting Xcode error: No such module ‘ApolloAPI’.

I installed Apollo using Cocoapods.

Any help?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![mike\_loo\_rea](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/mike_loo_rea/32/4949_2.png) [@mike\_loo\_rea](https://community.apollographql.com/u/mike_loo_rea)\
**Post date:** [March 6, 2024, 2:31am UTC](https://community.apollographql.com/t/no-such-module-apolloapi/7011/2 "2024-03-06T02:31:22Z")

</div>

I have the same problem:

 ![Screenshot 2024-03-06 at 1.28.43 pm](https://us1.discourse-cdn.com/flex019/uploads/apollographql/original/2X/5/55aef181e21a10a3022b68e5cfe0dc2bbba36447.png)

I followed the process here: [Apollo iOS 1.0 migration guide - Apollo GraphQL Docs](https://www.apollographql.com/docs/ios/migrations/1.0/#step-3-replace-the-code-generation-build-phase)

This is my config file:

```auto
{
  "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:](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 `import`s statement in the generated code with `Apollo` (instead of `ApolloAPI`), then it compiles.

---

<div class="post-metadata">

**Author:** ![mike\_loo\_rea](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/mike_loo_rea/32/4949_2.png) [@mike\_loo\_rea](https://community.apollographql.com/u/mike_loo_rea)\
**Post date:** [March 6, 2024, 2:46am UTC](https://community.apollographql.com/t/no-such-module-apolloapi/7011/3 "2024-03-06T02:46:10Z")

</div>

`ApolloAPI` is also nowhere in the framework list downloaded via Cocoapods:  
 ![Screenshot 2024-03-06 at 1.43.53 pm](https://us1.discourse-cdn.com/flex019/uploads/apollographql/original/2X/5/56b5b6c8e913c3e8de9f05eec5717df9f39dde8e.png)

---

<div class="post-metadata">

**Author:** ![mike\_loo\_rea](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/mike_loo_rea/32/4949_2.png) [@mike\_loo\_rea](https://community.apollographql.com/u/mike_loo_rea)\
**Post date:** [March 6, 2024, 2:53am UTC](https://community.apollographql.com/t/no-such-module-apolloapi/7011/4 "2024-03-06T02:53:20Z")

</div>

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:

> **[Codegen configuration](https://www.apollographql.com/docs/ios/code-generation/codegen-configuration/#module-type)**

 ![Screenshot 2024-03-06 at 1.53.03 pm](https://us1.discourse-cdn.com/flex019/uploads/apollographql/original/2X/2/2dda5f133fcb56c032c1b9512d10739a1ded42d8.png)

Set this value to `true` and you are good to go

---

<div class="post-metadata">

**Author:** ![Justin\_Gonzalez](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/justin_gonzalez/32/5359_2.png) [@Justin\_Gonzalez](https://community.apollographql.com/u/Justin_Gonzalez)\
**Post date:** [February 6, 2025, 8:48pm UTC](https://community.apollographql.com/t/no-such-module-apolloapi/7011/5 "2025-02-06T20:48:01Z")

</div>


