-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #147 from NeedleInAJayStack/feat/graphql-sdl
- Loading branch information
Showing
32 changed files
with
183 additions
and
367 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Migration | ||
|
||
## 1.0 to 2.0 | ||
|
||
### TypeReference removal | ||
|
||
The `TypeReference` type was removed in v2.0.0, since it was made unnecessary when using the [GraphQL](https://github.com/GraphQLSwift/GraphQL) closure-based `field` API. Simply replace any `TypeReference` usage with the actual type: | ||
|
||
```swift | ||
// Before | ||
let schema = try! Schema<HelloResolver, HelloContext> { | ||
Type(Object1.self) { } | ||
Type(Object2.self) { | ||
Field("object1", at: \.object1, as: TypeReference<Object1>.self) | ||
} | ||
} | ||
|
||
// After | ||
let schema = try! Schema<HelloResolver, HelloContext> { | ||
Type(Object1.self) { } | ||
Type(Object2.self) { | ||
Field("object1", at: \.object1) | ||
} | ||
} | ||
``` | ||
|
||
### Field/InputField `as` argument removal | ||
|
||
Since TypeReference was removed, there is no longer a functional need for the `as` argument on `Field` and `InputField` | ||
types. To remove it, simply omit it and let the compiler determine the type from the signature of the `at` argument. | ||
|
||
### `Types` removal | ||
|
||
The deprecated `Types` type has been removed. Instead define types individually using the `Type` initializers. | ||
|
||
### Reflection `isEncodable` | ||
|
||
The deprecated `Reflection.isEncodable(type: Any.Type) -> Bool` function has been removed. Please re-implement in your | ||
package if this functionality is needed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,50 @@ | ||
{ | ||
"object": { | ||
"pins": [ | ||
{ | ||
"package": "GraphQL", | ||
"repositoryURL": "https://github.com/GraphQLSwift/GraphQL.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "ec809df8cce95d6aea820f70f04067abc08080f2", | ||
"version": "2.10.3" | ||
} | ||
}, | ||
{ | ||
"package": "swift-atomics", | ||
"repositoryURL": "https://github.com/apple/swift-atomics.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "cd142fd2f64be2100422d658e7411e39489da985", | ||
"version": "1.2.0" | ||
} | ||
}, | ||
{ | ||
"package": "swift-collections", | ||
"repositoryURL": "https://github.com/apple/swift-collections", | ||
"state": { | ||
"branch": null, | ||
"revision": "671108c96644956dddcd89dd59c203dcdb36cec7", | ||
"version": "1.1.4" | ||
} | ||
}, | ||
{ | ||
"package": "swift-nio", | ||
"repositoryURL": "https://github.com/apple/swift-nio.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "914081701062b11e3bb9e21accc379822621995e", | ||
"version": "2.76.1" | ||
} | ||
}, | ||
{ | ||
"package": "swift-system", | ||
"repositoryURL": "https://github.com/apple/swift-system.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "c8a44d836fe7913603e246acab7c528c2e780168", | ||
"version": "1.4.0" | ||
} | ||
"pins" : [ | ||
{ | ||
"identity" : "graphql", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/GraphQLSwift/GraphQL.git", | ||
"state" : { | ||
"revision" : "5e098b3b1789169dded5116c171f716d584225ea", | ||
"version" : "3.0.0" | ||
} | ||
] | ||
}, | ||
"version": 1 | ||
}, | ||
{ | ||
"identity" : "swift-atomics", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/apple/swift-atomics.git", | ||
"state" : { | ||
"revision" : "cd142fd2f64be2100422d658e7411e39489da985", | ||
"version" : "1.2.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "swift-collections", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/apple/swift-collections", | ||
"state" : { | ||
"revision" : "671108c96644956dddcd89dd59c203dcdb36cec7", | ||
"version" : "1.1.4" | ||
} | ||
}, | ||
{ | ||
"identity" : "swift-nio", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/apple/swift-nio.git", | ||
"state" : { | ||
"revision" : "f7dc3f527576c398709b017584392fb58592e7f5", | ||
"version" : "2.75.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "swift-system", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/apple/swift-system.git", | ||
"state" : { | ||
"revision" : "c8a44d836fe7913603e246acab7c528c2e780168", | ||
"version" : "1.4.0" | ||
} | ||
} | ||
], | ||
"version" : 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
enum WrapperModifier { | ||
case optional | ||
case list | ||
case reference | ||
} | ||
|
||
protocol Wrapper { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.