[4. Setup and run code generation] - Working fine
./Pods/Apollo/apollo-ios-cli init --schema-name schemaGraphQL --module-type other
Running this command creates an apollo-codegen-config.json
file.
Then
./apollo-ios-cli generate
[5. Create an ApolloClient
] - Working fine
import Foundation
import Apollo
let apolloClient = ApolloClient(url: URL(string: “http://localhost:4000/graphql”)!)
[6. Fetch a query]
After writing
apolloClient.fetch(query: HeroNameQuery) { result in
guard let data = try? result.get().data else { return }
print(data.hero.name) // Luke Skywalker
}
Error Cannot find ‘HeroNameQuery’ in scope
Can anyone help me why I am getting the above error?