I am using apollo IOS v1.0 documents and try to fetch query and mutation but getting more issues “Cannot find type ‘VmaxsAPI’ in scope” in auto generated code
Hi @MohanVMaxIOS, I think that’s going to depend on your JSON codegen configuration and how the schema module is being output.
Hi @calvincestari ,
Thank you for your quick response .
“VmaxsAPI”. This is called schema name when i generate Create a codegen configuration
./apollo-ios-cli init --schema-name StarWarsAPI --module-type swiftPackageManager
But project root name is different “VMaxGraphQL”. when i change manual it working .
{
"schemaName" : "VmaxsAPI",
"input" : {
"operationSearchPaths" : [
"**/*.graphql"
],
"schemaSearchPaths" : [
"**/*.graphqls"
]
},
"output" : {
"testMocks" : {
"none" : {
}
},
"schemaTypes" : {
"path" : "./VmaxsAPI",
"moduleType" : {
"swiftPackageManager" : {
}
}
},
"operations" : {
"inSchemaModule" : {
}
}
}
}
Thanks
Thanks
Are you manually adding the “Sources” folder to your project? You generated a Swift package and therefore you must add it to your project as a new SPM dependency, the same was you added Apollo iOS. The only difference is this time it is a local package.
VmaxsAPI
is the name of the Swift package (module) it’s looking for.
Hi,
I also encountered the same problem.
But I use cocoapods.
My file content looks like this:
Can you see what the problem is from the above pictures?
Thank you so much!
Hi @Shashank_Panwar - I replied in the GitHub issue.