Skip to content

Commit af903a2

Browse files
Merge pull request #64 from NeedleInAJayStack/fix/preserveResultOrder
Preserve result order
2 parents dbed58c + 91654c7 commit af903a2

File tree

4 files changed

+15
-23
lines changed

4 files changed

+15
-23
lines changed

Package.resolved

Lines changed: 8 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let package = Package(
77
.library(name: "Graphiti", targets: ["Graphiti"]),
88
],
99
dependencies: [
10-
.package(url: "https://github.com/GraphQLSwift/GraphQL.git", .upToNextMajor(from: "1.3.0"))
10+
.package(url: "https://github.com/GraphQLSwift/GraphQL.git", .upToNextMajor(from: "2.0.0"))
1111
],
1212
targets: [
1313
.target(name: "Graphiti", dependencies: ["GraphQL"]),

Sources/Graphiti/Scalar/Scalar.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import GraphQL
2+
import OrderedCollections
23

34
open class Scalar<Resolver, Context, ScalarType : Codable> : Component<Resolver, Context> {
45
override func update(typeProvider: SchemaTypeProvider) throws {
@@ -92,7 +93,7 @@ extension GraphQL.Value {
9293
if
9394
let value = self as? ObjectValue
9495
{
95-
let dictionary = value.fields.reduce(into: [:]) { result, field in
96+
let dictionary: OrderedDictionary<String, Map> = value.fields.reduce(into: [:]) { result, field in
9697
result[field.name.value] = field.value.map
9798
}
9899

Tests/GraphitiTests/StarWarsTests/StarWarsIntrospectionTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,8 @@ class StarWarsIntrospectionTests : XCTestCase {
331331
"name": nil,
332332
"kind": "NON_NULL",
333333
"ofType": [
334-
"kind": "LIST",
335-
"name": nil
334+
"name": nil,
335+
"kind": "LIST"
336336
]
337337
]
338338
],
@@ -342,8 +342,8 @@ class StarWarsIntrospectionTests : XCTestCase {
342342
"name": nil,
343343
"kind": "NON_NULL",
344344
"ofType": [
345-
"kind": "LIST",
346-
"name": nil
345+
"name": nil,
346+
"kind": "LIST"
347347
]
348348
]
349349
],

0 commit comments

Comments
 (0)