Hacker News new | ask | show | jobs
by andrewingram 1949 days ago
There's also:

- Relay-swift: A port of Relay to Swift - https://relay-tools.github.io/Relay.swift/docs/

- Graphaello: Inspired by Relay, but deviates a bit more from the patterns than Relay-swift - https://github.com/nerdsupremacist/Graphaello

1 comments

Thank you for adding the links!

The main difference between these clients and SwiftGraphQL is that SwiftGraphQL tries to abstract away GraphQL in favour of Swift language feature.

`relay-swift`, for example, relies on query strings which doesn't bring type-safety to your code;

`graphaello` is indeed very similar and I've tried using it before creating SwiftGraphQL. One of the goals of SwiftGraphQL was to let you easily separate the model from your queries. That's why we let you do complex logic in the selection itself. Otherwise, you'd have to first create a utility struct and then translate it into a model-type. I think that's the main difference between graphaello and SwiftGraphQL

Thanks again for sharing the links!

Relay.swift doesn't bring type-safety to your queries but it does use the relay-compiler which will fail if anything is wrong (at least helpful!) and you still get type safety for results as well as automatic conformance to Identifiable & custom scalar type substitutions.

Haven't checked out SwiftGraphQL much, but Relay.swift is definitely the best swift based GQL I have used to date.