apollographql / apollo-ios

📱  A strongly-typed, caching GraphQL client for iOS, written in Swift.
https://www.apollographql.com/docs/ios/
MIT License
3.86k stars 712 forks source link

Swift4 in Xcode9-beta Error #95

Closed Jiar closed 7 years ago

Jiar commented 7 years ago

Protocol 'GraphQLQuery' can only be used as a generic constraint because it has Self or associated type requirements

apolloStore.swift

func rootKey<Operation: GraphQLOperation>(forOperation operation: Operation) -> CacheKey {
  switch operation {
  case is GraphQLQuery:   // Error
    return "QUERY_ROOT"
  case is GraphQLMutation:   // Error
    return "MUTATION_ROOT"
  default:
    preconditionFailure("Unknown operation type")
  }
}
martijnwalraven commented 7 years ago

We don't yet support Swift 4. I did try running the tests on Xcode 9 in Swift 3 mode, and that seems to work, so I suggest you stick to that for now.

thinkOfWord commented 6 years ago

什么时候支持swift4