diff --git a/Chester.podspec b/Chester.podspec index 40f42ce..5ff08a0 100644 --- a/Chester.podspec +++ b/Chester.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "Chester" - s.version = "0.15.0" + s.version = "0.16.0" s.summary = "Chester is a Swift GraphQL query builder." s.description = <<-DESC Work in progress: Simplify building GraphQL queries with Chester. diff --git a/Chester/GraphQLBuilder.swift b/Chester/GraphQLBuilder.swift index 37aa537..fba88ce 100644 --- a/Chester/GraphQLBuilder.swift +++ b/Chester/GraphQLBuilder.swift @@ -10,7 +10,7 @@ public protocol Component { var arguments: [Argument]? { get } } -@_functionBuilder +@resultBuilder public struct GraphQLBuilder { public static func buildBlock(_ components: Component...) -> String { diff --git a/README.md b/README.md index 9454588..2d70fa6 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,9 @@ [![License](https://img.shields.io/cocoapods/l/Chester.svg?style=flat)](http://cocoapods.org/pods/Chester) [![Platform](https://img.shields.io/cocoapods/p/Chester.svg?style=flat)](http://cocoapods.org/pods/Chester) -## Experimental: @functionBuilder support +## Sort of Experimental: @resultBuilder Support -`@functionBuilder` seems like a natural match for this kind of task. There's a separate `GraphQLBuilderTests` test suite that shows the supported cases. In it's basic form you can construct a query like this: +`@resultBuilder` seems like a natural match for this kind of task. There's a separate `GraphQLBuilderTests` test suite that shows the supported cases. In it's basic form you can construct a query like this: ```swift import Chester @@ -39,6 +39,7 @@ let query = GraphQLQuery { ``` ### Known Issues + - Queries with multiple root fields and arguments produce a compiler error (e.g. `'Int' is not convertible to 'Any'`) ## Usage @@ -93,20 +94,24 @@ Check the included unit tests for further examples. ## Requirements -* Swift 5 -* Xcode 10.2+ -* iOS 8 +- Swift 5 +- Xcode 12.5+ +- iOS 8 ## Installation Chester is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile: - pod "Chester" +```ruby +pod "Chester" +``` Or [Carthage](https://github.com/Carthage/Carthage). Add Chester to your Cartfile: - github "JanGorman/Chester" +```ogdl +github "JanGorman/Chester" +``` Or [Swift Package Manager](https://swift.org/package-manager/). To install it, simply go to File > Swift Package > Add Swift Package Dependency and add "https://github.com/JanGorman/Chester.git" as Swift Package URL.