-
Notifications
You must be signed in to change notification settings - Fork 749
Closed
apollographql/apollo-ios-dev
#697Labels
questionIssues that have a question which should be addressedIssues that have a question which should be addressed
Description
Question
Hey Team,
using:
apollo-ios-cli --version
1.23.0
I’ve integrated ApolloTestSupport into our project, which uses Apollo via an XCFramework, and I’ve configured mock generation in the Apollo Codegen config as follows:
"output": {
"testMocks": {
"absolute": {
"path": "./MyAppTests/ApolloGraphQL/ApolloGenerated/TestMocks",
"targetName": "MyAppTests"
}
},
"operations": {
"inSchemaModule": {}
},
"schemaTypes": {
"path": "./MyApp/ApolloGraphQL/ApolloGenerated/",
"moduleType": {
"embeddedInTarget": {
"name": "MyApp"
}
}
}
}The mock files are generated correctly under the MyAppTests target. However, I’m encountering the following error in the generated mock files:
// @generated
// This file was automatically generated and should not be edited.
import ApolloTestSupport
import MyApp
public class Campaign: MockObject {
public static let objectType: ApolloAPI.Object = SchemaGraphQL.Objects.Campaign
public static let _mockFields = MockFields()
public typealias MockValueCollectionType = Array<Mock<Campaign>>
}❗️Cannot find 'SchemaGraphQL' in scope — this module is generated in the MyApp target.
Question
Is there a supported way to make Apollo Codegen use:
@testable import MyApp instead of import MyApp n the generated mock files? That would allow access to internal symbols without needing to make everything public.
Any advice or alternative approaches would be appreciated!
Metadata
Metadata
Assignees
Labels
questionIssues that have a question which should be addressedIssues that have a question which should be addressed