# \*Solved\* Test Target: \`No such module 'ApolloAPI'\`

**URL:** <https://community.apollographql.com/t/solved-test-target-no-such-module-apolloapi/5792>\
**Category:** Client SDKs\
**Tags:** client, mobile, ios\
**Created:** [February 23, 2023, 4:27pm UTC](https://community.apollographql.com/t/solved-test-target-no-such-module-apolloapi/5792 "2023-02-23T16:27:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cswelin](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/cswelin/32/3937_2.png) [@cswelin](https://community.apollographql.com/u/cswelin)\
**Post date:** [February 23, 2023, 4:27pm UTC](https://community.apollographql.com/t/solved-test-target-no-such-module-apolloapi/5792/1 "2023-02-23T16:27:55Z")

</div>

Lost for ideas what’s going on here, but I’m in the process of upgrading to 1.x and have codegen generating a SwiftPM package with a test framework (TestMocks).

```auto
 products: [
    .library(name: "SomeAPI", targets: ["SomeAPI"]),
    .library(name: "SomeAPITestMocks", targets: ["SomeAPITestMocks"]),
  ],

```

When trying to build the tests (errors on building `SomeAPI` I’m getting the following error

```auto
No such module 'ApolloAPI'

```

in a code generated file from `SomeAPI` at the exported import

```auto
 @_exported **import** `ApolloAPI`

```

I’ve followed what’s here [https://www.apollographql.com/docs/ios/project-configuration/#shared-models](https://www.apollographql.com/docs/ios/project-configuration/#shared-models) and linked against `SomeAPITestMocks` and `ApolloAPI` as well as `ApolloTestSupport`

Lost for ideas at this point.

HAZAAH!

Problem solved, issue was out of order linking.

---

<div class="post-metadata">

**Author:** ![cswelin](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/cswelin/32/3937_2.png) [@cswelin](https://community.apollographql.com/u/cswelin)\
**Post date:** [March 1, 2023, 3:06pm UTC](https://community.apollographql.com/t/solved-test-target-no-such-module-apolloapi/5792/2 "2023-03-01T15:06:41Z")

</div>

Hmm maybe its not solved, could of been derived data masking the issue.

Cleared derived data and having this issue again.

---

<div class="post-metadata">

**Author:** ![Polenoso](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/polenoso/32/4494_2.png) [@Polenoso](https://community.apollographql.com/u/Polenoso)\
**Post date:** [August 11, 2023, 1:19pm UTC](https://community.apollographql.com/t/solved-test-target-no-such-module-apolloapi/5792/3 "2023-08-11T13:19:40Z")

</div>

You need to declare dependency for apollo in your targets.

Also make sure you’re setting the generated code properly inside Sources or the path defined in the Package.swift

---

<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/solved-test-target-no-such-module-apolloapi/5792/4 "2025-02-06T20:48:26Z")

</div>


