Repository navigation
SwiftGraphQL 2.0.0
Hi there 👋🏿 ,
We've finally reached version 2.0.0! After several immensely successful beta releases of the next major SwiftGraphQL version, I think we are ready to ship. This version includes additions that profoundly change how the first version worked. To name a few, we've implemented subscriptions support, improved code-generation, built a CLI utility and more!
I hope you find this package as useful as I've seen it fun.
Before diving into all the changes, I'd like to thank @Amzd who helped me shape this library by implementing the subscription layer and adding some fantastic suggestions that make working with SwiftGraphQL more enjoyable. @Amzd thank you! ❤️
Our mission remains the same with every version - We want to build the most approachable Swift GraphQL client, that solves few things but solves them well.
Features
- We've added support for subscriptions. To make a subscription selection, use the same pattern as before and create a socket, using the
listenmethod. - We've added a CLI that you may use to generate the SwiftGraphQL code. You may download it using
brew,mintor build it yourself usingmake. - Every structure in the schema that may be selected has type alias for better XCode IDE support. If, for example, you had a
Usertype in the database and wanted to select a name out of it, you no longer have to make a phantom-type usingSelection<User, String>. Instead, you can writeSelection.User. Swift should infer the return type itself.
Internal changes
I've changed the code structure so that we expose another child-library - GraphQLAST. I haven't documented it, but it should be simple to use by following function annotations and inline docs.
Breaking Changes
- When making a selection, field decoding might throw. That's why every assignment should be marked with
try. SwiftGraphQLCodegenno longer accepts anOptionsstructure. Instead, you should forward scalars. AdditionallySwiftGraphQLCodegenno longer writes to a file. Instead, it would be best if you usedswift-graphqlCLI tool as an alternative to build-phase script in version1.x.xand2.x.y-beta.z.- I've removed SG and
SwiftGraphQLnamespaces in favour of modules.
Future plans
I've started working on the documentation page. I think it's important that we promote the library more and hopefully land on some sponsors that would encourage this library's maintenance.