here my code in swift:
mutation = LoginMutation( email: "sample@gmail.com",password: "pa$$w0rd")
ApolloManager.shared.apollo.perform(mutation: mutation, resultHandler: { result in
switch result {
case .success(let graphQLResult):
if let data = graphQLResult.data {
print("Token: \(data)")
} else if let errors = graphQLResult.errors {
print(errors)
}
case .failure(let error):
print(error)
}
})
I get an error in the generated file and here is the error
Instance method ‘perform(mutation:publishResultToStore:context:queue:resultHandler:)’ requires that ‘LoginMutation’ conform to ‘GraphQLMutation’
btw I used pod file to add some references as I followed the documentation.
here is in my podfile:
# platform :ios, '9.0'
target 'ProjectName' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for AhenteNew
pod 'Apollo'
pod 'Apollo/SQLite'
pod 'Apollo/WebSocket'
end
I used apollo-ios-cli to generate my API but I’m not sure why it is not running. if I made the project not using the podfile the error showed while using the package dependencies, the program would work fine. I don’t know why the error saying cannot conform. please give the solution for this.