Skip to content

Commit 6f55313

Browse files
authored
chore: add graphql files (#17)
* chore: add graphql files * run codegen, add update
1 parent 1959de7 commit 6f55313

18 files changed

+3395
-74
lines changed

Tests/IntegrationTestApp/AppSyncAPI/Sources/Operations/Mutations/CreateTodoMutation.graphql.swift

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
//
2-
// Copyright Amazon.com Inc. or its affiliates.
3-
// All Rights Reserved.
4-
//
5-
// SPDX-License-Identifier: Apache-2.0
6-
//
1+
// @generated
2+
// This file was automatically generated and should not be edited.
73

84
@_exported import ApolloAPI
95

@@ -24,7 +20,7 @@ public class CreateTodoMutation: GraphQLMutation {
2420

2521
public struct Data: AppSyncAPI.SelectionSet {
2622
public let __data: DataDict
27-
public init(_dataDict: DataDict) { self.__data = _dataDict }
23+
public init(_dataDict: DataDict) { __data = _dataDict }
2824

2925
public static var __parentType: any ApolloAPI.ParentType { AppSyncAPI.Objects.Mutation }
3026
public static var __selections: [ApolloAPI.Selection] { [
@@ -38,7 +34,7 @@ public class CreateTodoMutation: GraphQLMutation {
3834
/// Parent Type: `Todo`
3935
public struct CreateTodo: AppSyncAPI.SelectionSet {
4036
public let __data: DataDict
41-
public init(_dataDict: DataDict) { self.__data = _dataDict }
37+
public init(_dataDict: DataDict) { __data = _dataDict }
4238

4339
public static var __parentType: any ApolloAPI.ParentType { AppSyncAPI.Objects.Todo }
4440
public static var __selections: [ApolloAPI.Selection] { [
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// @generated
2+
// This file was automatically generated and should not be edited.
3+
4+
@_exported import ApolloAPI
5+
6+
public class UpdateTodoMutation: GraphQLMutation {
7+
public static let operationName: String = "UpdateTodo"
8+
public static let operationDocument: ApolloAPI.OperationDocument = .init(
9+
definition: .init(
10+
#"mutation UpdateTodo($updateTodoInput: UpdateTodoInput!) { updateTodo(input: $updateTodoInput) { __typename id updatedAt createdAt content owner } }"#
11+
))
12+
13+
public var updateTodoInput: UpdateTodoInput
14+
15+
public init(updateTodoInput: UpdateTodoInput) {
16+
self.updateTodoInput = updateTodoInput
17+
}
18+
19+
public var __variables: Variables? { ["updateTodoInput": updateTodoInput] }
20+
21+
public struct Data: AppSyncAPI.SelectionSet {
22+
public let __data: DataDict
23+
public init(_dataDict: DataDict) { __data = _dataDict }
24+
25+
public static var __parentType: any ApolloAPI.ParentType { AppSyncAPI.Objects.Mutation }
26+
public static var __selections: [ApolloAPI.Selection] { [
27+
.field("updateTodo", UpdateTodo?.self, arguments: ["input": .variable("updateTodoInput")]),
28+
] }
29+
30+
public var updateTodo: UpdateTodo? { __data["updateTodo"] }
31+
32+
/// UpdateTodo
33+
///
34+
/// Parent Type: `Todo`
35+
public struct UpdateTodo: AppSyncAPI.SelectionSet {
36+
public let __data: DataDict
37+
public init(_dataDict: DataDict) { __data = _dataDict }
38+
39+
public static var __parentType: any ApolloAPI.ParentType { AppSyncAPI.Objects.Todo }
40+
public static var __selections: [ApolloAPI.Selection] { [
41+
.field("__typename", String.self),
42+
.field("id", AppSyncAPI.ID.self),
43+
.field("updatedAt", AppSyncAPI.AWSDateTime.self),
44+
.field("createdAt", AppSyncAPI.AWSDateTime.self),
45+
.field("content", String?.self),
46+
.field("owner", String?.self),
47+
] }
48+
49+
public var id: AppSyncAPI.ID { __data["id"] }
50+
public var updatedAt: AppSyncAPI.AWSDateTime { __data["updatedAt"] }
51+
public var createdAt: AppSyncAPI.AWSDateTime { __data["createdAt"] }
52+
public var content: String? { __data["content"] }
53+
public var owner: String? { __data["owner"] }
54+
}
55+
}
56+
}

Tests/IntegrationTestApp/AppSyncAPI/Sources/Operations/Queries/MyQuery.graphql.swift

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
//
2-
// Copyright Amazon.com Inc. or its affiliates.
3-
// All Rights Reserved.
4-
//
5-
// SPDX-License-Identifier: Apache-2.0
6-
//
1+
// @generated
2+
// This file was automatically generated and should not be edited.
73

84
@_exported import ApolloAPI
95

@@ -18,7 +14,7 @@ public class MyQuery: GraphQLQuery {
1814

1915
public struct Data: AppSyncAPI.SelectionSet {
2016
public let __data: DataDict
21-
public init(_dataDict: DataDict) { self.__data = _dataDict }
17+
public init(_dataDict: DataDict) { __data = _dataDict }
2218

2319
public static var __parentType: any ApolloAPI.ParentType { AppSyncAPI.Objects.Query }
2420
public static var __selections: [ApolloAPI.Selection] { [
@@ -32,7 +28,7 @@ public class MyQuery: GraphQLQuery {
3228
/// Parent Type: `ModelTodoConnection`
3329
public struct ListTodos: AppSyncAPI.SelectionSet {
3430
public let __data: DataDict
35-
public init(_dataDict: DataDict) { self.__data = _dataDict }
31+
public init(_dataDict: DataDict) { __data = _dataDict }
3632

3733
public static var __parentType: any ApolloAPI.ParentType { AppSyncAPI.Objects.ModelTodoConnection }
3834
public static var __selections: [ApolloAPI.Selection] { [
@@ -49,7 +45,7 @@ public class MyQuery: GraphQLQuery {
4945
/// Parent Type: `Todo`
5046
public struct Item: AppSyncAPI.SelectionSet {
5147
public let __data: DataDict
52-
public init(_dataDict: DataDict) { self.__data = _dataDict }
48+
public init(_dataDict: DataDict) { __data = _dataDict }
5349

5450
public static var __parentType: any ApolloAPI.ParentType { AppSyncAPI.Objects.Todo }
5551
public static var __selections: [ApolloAPI.Selection] { [

Tests/IntegrationTestApp/AppSyncAPI/Sources/Operations/Subscriptions/OnCreateSubscription.graphql.swift

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
//
2-
// Copyright Amazon.com Inc. or its affiliates.
3-
// All Rights Reserved.
4-
//
5-
// SPDX-License-Identifier: Apache-2.0
6-
//
1+
// @generated
2+
// This file was automatically generated and should not be edited.
73

84
@_exported import ApolloAPI
95

@@ -18,7 +14,7 @@ public class OnCreateSubscription: GraphQLSubscription {
1814

1915
public struct Data: AppSyncAPI.SelectionSet {
2016
public let __data: DataDict
21-
public init(_dataDict: DataDict) { self.__data = _dataDict }
17+
public init(_dataDict: DataDict) { __data = _dataDict }
2218

2319
public static var __parentType: any ApolloAPI.ParentType { AppSyncAPI.Objects.Subscription }
2420
public static var __selections: [ApolloAPI.Selection] { [
@@ -32,7 +28,7 @@ public class OnCreateSubscription: GraphQLSubscription {
3228
/// Parent Type: `Todo`
3329
public struct OnCreateTodo: AppSyncAPI.SelectionSet {
3430
public let __data: DataDict
35-
public init(_dataDict: DataDict) { self.__data = _dataDict }
31+
public init(_dataDict: DataDict) { __data = _dataDict }
3632

3733
public static var __parentType: any ApolloAPI.ParentType { AppSyncAPI.Objects.Todo }
3834
public static var __selections: [ApolloAPI.Selection] { [

Tests/IntegrationTestApp/AppSyncAPI/Sources/Schema/InputObjects/CreateTodoInput.graphql.swift

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
1-
//
2-
// Copyright Amazon.com Inc. or its affiliates.
3-
// All Rights Reserved.
4-
//
5-
// SPDX-License-Identifier: Apache-2.0
6-
//
1+
// @generated
2+
// This file was automatically generated and should not be edited.
73

84
import ApolloAPI
95

106
public struct CreateTodoInput: InputObject {
117
public private(set) var __data: InputDict
128

139
public init(_ data: InputDict) {
14-
self.__data = data
10+
__data = data
1511
}
1612

1713
public init(
1814
content: GraphQLNullable<String> = nil,
1915
id: GraphQLNullable<ID> = nil
2016
) {
21-
self.__data = InputDict([
17+
__data = InputDict([
2218
"content": content,
2319
"id": id
2420
])
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// @generated
2+
// This file was automatically generated and should not be edited.
3+
4+
import ApolloAPI
5+
6+
public struct UpdateTodoInput: InputObject {
7+
public private(set) var __data: InputDict
8+
9+
public init(_ data: InputDict) {
10+
__data = data
11+
}
12+
13+
public init(
14+
content: GraphQLNullable<String> = nil,
15+
id: ID
16+
) {
17+
__data = InputDict([
18+
"content": content,
19+
"id": id
20+
])
21+
}
22+
23+
public var content: GraphQLNullable<String> {
24+
get { __data["content"] }
25+
set { __data["content"] = newValue }
26+
}
27+
28+
public var id: ID {
29+
get { __data["id"] }
30+
set { __data["id"] = newValue }
31+
}
32+
}
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
//
2-
// Copyright Amazon.com Inc. or its affiliates.
3-
// All Rights Reserved.
4-
//
5-
// SPDX-License-Identifier: Apache-2.0
6-
//
1+
// @generated
2+
// This file was automatically generated and should not be edited.
73

84
import ApolloAPI
95

@@ -12,4 +8,4 @@ public extension Objects {
128
typename: "ModelTodoConnection",
139
implementedInterfaces: []
1410
)
15-
}
11+
}
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
//
2-
// Copyright Amazon.com Inc. or its affiliates.
3-
// All Rights Reserved.
4-
//
5-
// SPDX-License-Identifier: Apache-2.0
6-
//
1+
// @generated
2+
// This file was automatically generated and should not be edited.
73

84
import ApolloAPI
95

@@ -12,4 +8,4 @@ public extension Objects {
128
typename: "Mutation",
139
implementedInterfaces: []
1410
)
15-
}
11+
}
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
//
2-
// Copyright Amazon.com Inc. or its affiliates.
3-
// All Rights Reserved.
4-
//
5-
// SPDX-License-Identifier: Apache-2.0
6-
//
1+
// @generated
2+
// This file was automatically generated and should not be edited.
73

84
import ApolloAPI
95

@@ -12,4 +8,4 @@ public extension Objects {
128
typename: "Query",
139
implementedInterfaces: []
1410
)
15-
}
11+
}
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
//
2-
// Copyright Amazon.com Inc. or its affiliates.
3-
// All Rights Reserved.
4-
//
5-
// SPDX-License-Identifier: Apache-2.0
6-
//
1+
// @generated
2+
// This file was automatically generated and should not be edited.
73

84
import ApolloAPI
95

@@ -12,4 +8,4 @@ public extension Objects {
128
typename: "Subscription",
139
implementedInterfaces: []
1410
)
15-
}
11+
}

0 commit comments

Comments
 (0)