diff --git a/ios/.gitignore b/ios/.gitignore index 7a6dd48a..a07787f6 100644 --- a/ios/.gitignore +++ b/ios/.gitignore @@ -18,6 +18,8 @@ Localizable.strings ## Generated code *.generated.swift +*.graphql.swift +*.graphqls ## Various settings *.pbxuser diff --git a/ios/.swiftlint.yml b/ios/.swiftlint.yml index f6c19828..fa8f3fbc 100644 --- a/ios/.swiftlint.yml +++ b/ios/.swiftlint.yml @@ -2,8 +2,10 @@ excluded: - Carthage - Pods - vendor - - DataLayer/Toolkits/RocketToolkit/Sources/RocketToolkit/NetworkModels/NETModels.generated.swift - + - DataLayer/Toolkits/RocketToolkit/.build + - DataLayer/Toolkits/RocketToolkit/Sources/RocketToolkit/NetworkModels/Apollo + - DataLayer/Toolkits/RocketToolkit/Sources/RocketToolkitMocks + indentation: 2 cyclomatic_complexity: 10 file_length: 200 diff --git a/ios/DataLayer/Providers/GraphQLProvider/Package.swift b/ios/DataLayer/Providers/GraphQLProvider/Package.swift index 6bc89b96..ef1b5038 100644 --- a/ios/DataLayer/Providers/GraphQLProvider/Package.swift +++ b/ios/DataLayer/Providers/GraphQLProvider/Package.swift @@ -5,7 +5,10 @@ import PackageDescription let package = Package( name: "GraphQLProvider", - platforms: [.iOS(.v14)], + platforms: [ + .iOS(.v14), + .macOS(.v10_14) + ], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. .library( @@ -20,7 +23,7 @@ let package = Package( dependencies: [ // Dependencies declare other packages that this package depends on. // .package(url: /* package url */, from: "1.0.0"), - .package(url: "https://github.com/apollographql/apollo-ios", .upToNextMajor(from: "0.0.0")) + .package(url: "https://github.com/apollographql/apollo-ios", .upToNextMajor(from: "1.0.0")) ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. diff --git a/ios/DataLayer/Providers/GraphQLProvider/Sources/GraphQLProvider/ApolloClient+Async.swift b/ios/DataLayer/Providers/GraphQLProvider/Sources/GraphQLProvider/ApolloClient+Async.swift index 0dd6f088..c0d40f6a 100644 --- a/ios/DataLayer/Providers/GraphQLProvider/Sources/GraphQLProvider/ApolloClient+Async.swift +++ b/ios/DataLayer/Providers/GraphQLProvider/Sources/GraphQLProvider/ApolloClient+Async.swift @@ -4,6 +4,7 @@ // import Apollo +import ApolloAPI import Foundation // Extension which adds async/await support to Apollo diff --git a/ios/DataLayer/Providers/GraphQLProvider/Sources/GraphQLProvider/ApolloGraphQLProvider.swift b/ios/DataLayer/Providers/GraphQLProvider/Sources/GraphQLProvider/ApolloGraphQLProvider.swift index 56209b14..bfc09d29 100644 --- a/ios/DataLayer/Providers/GraphQLProvider/Sources/GraphQLProvider/ApolloGraphQLProvider.swift +++ b/ios/DataLayer/Providers/GraphQLProvider/Sources/GraphQLProvider/ApolloGraphQLProvider.swift @@ -4,6 +4,7 @@ // import Apollo +import ApolloAPI import Foundation public struct ApolloGraphQLProvider { diff --git a/ios/DataLayer/Providers/GraphQLProvider/Sources/GraphQLProvider/GraphQLProvider.swift b/ios/DataLayer/Providers/GraphQLProvider/Sources/GraphQLProvider/GraphQLProvider.swift index d4f35747..a4cd28cf 100644 --- a/ios/DataLayer/Providers/GraphQLProvider/Sources/GraphQLProvider/GraphQLProvider.swift +++ b/ios/DataLayer/Providers/GraphQLProvider/Sources/GraphQLProvider/GraphQLProvider.swift @@ -4,6 +4,7 @@ // import Apollo +import ApolloAPI import Foundation // sourcery: AutoMockable diff --git a/ios/DataLayer/Providers/GraphQLProvider/Sources/GraphQLProviderMocks/GraphQLProviderMock.swift b/ios/DataLayer/Providers/GraphQLProvider/Sources/GraphQLProviderMocks/GraphQLProviderMock.swift index b8627245..8c621882 100644 --- a/ios/DataLayer/Providers/GraphQLProvider/Sources/GraphQLProviderMocks/GraphQLProviderMock.swift +++ b/ios/DataLayer/Providers/GraphQLProvider/Sources/GraphQLProviderMocks/GraphQLProviderMock.swift @@ -6,6 +6,7 @@ // swiftlint:disable all import Apollo +import ApolloAPI import Foundation import GraphQLProvider diff --git a/ios/DataLayer/Toolkits/RocketToolkit/Package.resolved b/ios/DataLayer/Toolkits/RocketToolkit/Package.resolved new file mode 100644 index 00000000..f03430d1 --- /dev/null +++ b/ios/DataLayer/Toolkits/RocketToolkit/Package.resolved @@ -0,0 +1,59 @@ +{ + "pins" : [ + { + "identity" : "apollo-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apollographql/apollo-ios", + "state" : { + "revision" : "33065d3b3c97fc35ac42bf28f826cac6c61c779e", + "version" : "1.0.0" + } + }, + { + "identity" : "inflectorkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mattt/InflectorKit", + "state" : { + "revision" : "d8cbcc04972690aaa5fc760a2b9ddb3e9f0decd7", + "version" : "1.0.0" + } + }, + { + "identity" : "resolver", + "kind" : "remoteSourceControl", + "location" : "https://github.com/hmlongco/Resolver.git", + "state" : { + "revision" : "97de0b0320036607564af4a60025b48f8d041221", + "version" : "1.5.0" + } + }, + { + "identity" : "sqlite.swift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/stephencelis/SQLite.swift.git", + "state" : { + "revision" : "4d543d811ee644fa4cc4bfa0be996b4dd6ba0f54", + "version" : "0.13.3" + } + }, + { + "identity" : "swift-argument-parser", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-argument-parser.git", + "state" : { + "revision" : "9f39744e025c7d377987f30b03770805dcb0bcd1", + "version" : "1.1.4" + } + }, + { + "identity" : "swift-collections", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-collections", + "state" : { + "revision" : "f504716c27d2e5d4144fa4794b12129301d17729", + "version" : "1.0.3" + } + } + ], + "version" : 2 +} diff --git a/ios/DataLayer/Toolkits/RocketToolkit/Package.swift b/ios/DataLayer/Toolkits/RocketToolkit/Package.swift index c9b82f37..607f4807 100644 --- a/ios/DataLayer/Toolkits/RocketToolkit/Package.swift +++ b/ios/DataLayer/Toolkits/RocketToolkit/Package.swift @@ -5,7 +5,10 @@ import PackageDescription let package = Package( name: "RocketToolkit", - platforms: [.iOS(.v14)], + platforms: [ + .iOS(.v14), + .macOS(.v10_14) + ], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. .library( @@ -16,9 +19,9 @@ let package = Package( dependencies: [ // Dependencies declare other packages that this package depends on. // .package(url: /* package url */, from: "1.0.0"), - .package(name: "SharedDomain", path: "../../DomainLayer/SharedDomain"), - .package(name: "GraphQLProvider", path: "../Providers/GraphQLProvider"), - .package(url: "https://github.com/apollographql/apollo-ios", .upToNextMajor(from: "0.0.0")) + .package(name: "SharedDomain", path: "../../../DomainLayer/SharedDomain"), + .package(name: "GraphQLProvider", path: "../../Providers/GraphQLProvider"), + .package(url: "https://github.com/apollographql/apollo-ios", .upToNextMajor(from: "1.0.0")) ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -34,14 +37,23 @@ let package = Package( .process("NetworkQueries") ] ), + .target( + name: "RocketToolkitMocks", + dependencies: [ + "RocketToolkit", + .product(name: "ApolloTestSupport", package: "apollo-ios") + ] + ), .testTarget( name: "RocketToolkitTests", dependencies: [ "RocketToolkit", + "RocketToolkitMocks", .product(name: "SharedDomain", package: "SharedDomain"), .product(name: "SharedDomainMocks", package: "SharedDomain"), .product(name: "GraphQLProvider", package: "GraphQLProvider"), - .product(name: "GraphQLProviderMocks", package: "GraphQLProvider") + .product(name: "GraphQLProviderMocks", package: "GraphQLProvider"), + .product(name: "ApolloTestSupport", package: "apollo-ios") ] ) ] diff --git a/ios/DataLayer/Toolkits/RocketToolkit/Sources/RocketToolkit/NetworkModels/Apollo/Schema/SchemaConfiguration.swift b/ios/DataLayer/Toolkits/RocketToolkit/Sources/RocketToolkit/NetworkModels/Apollo/Schema/SchemaConfiguration.swift new file mode 100644 index 00000000..fbe4b42d --- /dev/null +++ b/ios/DataLayer/Toolkits/RocketToolkit/Sources/RocketToolkit/NetworkModels/Apollo/Schema/SchemaConfiguration.swift @@ -0,0 +1,15 @@ +// @generated +// This file was automatically generated and can be edited to +// provide custom configuration for a generated GraphQL schema. +// +// Any changes to this file will not be overwritten by future +// code generation execution. + +import ApolloAPI + +enum SchemaConfiguration: ApolloAPI.SchemaConfiguration { + static func cacheKeyInfo(for type: Object, object: JSONObject) -> CacheKeyInfo? { + // Implement this function to configure cache key resolution for your schema types. + return nil + } +} diff --git a/ios/DataLayer/Toolkits/RocketToolkit/Sources/RocketToolkit/NetworkModels/RocketLaunch+Conversion.swift b/ios/DataLayer/Toolkits/RocketToolkit/Sources/RocketToolkit/NetworkModels/RocketLaunch+Conversion.swift index deced061..fb181159 100644 --- a/ios/DataLayer/Toolkits/RocketToolkit/Sources/RocketToolkit/NetworkModels/RocketLaunch+Conversion.swift +++ b/ios/DataLayer/Toolkits/RocketToolkit/Sources/RocketToolkit/NetworkModels/RocketLaunch+Conversion.swift @@ -3,24 +3,15 @@ // Copyright © 2022 Matee. All rights reserved. // +import ApolloAPI import SharedDomain // Conversion from NetworkModel to DomainModel -extension RocketLaunchListQuery.Data.Launch.Launch { +extension Rocket.RocketLaunchListQuery.Data.Launches.Launch { var domainModel: RocketLaunch { - RocketLaunch( - id: id, - site: site ?? "" - ) - } -} - -// Conversion from DomainModel to NetworkModel -extension RocketLaunch { - var networkModel: RocketLaunchListQuery.Data.Launch.Launch { .init( id: id, - site: site + site: site ?? "" ) } } diff --git a/ios/DataLayer/Toolkits/RocketToolkit/Sources/RocketToolkit/Repositories/RocketLaunchRepository.swift b/ios/DataLayer/Toolkits/RocketToolkit/Sources/RocketToolkit/Repositories/RocketLaunchRepository.swift index c93ec87d..57c39d0d 100644 --- a/ios/DataLayer/Toolkits/RocketToolkit/Sources/RocketToolkit/Repositories/RocketLaunchRepository.swift +++ b/ios/DataLayer/Toolkits/RocketToolkit/Sources/RocketToolkit/Repositories/RocketLaunchRepository.swift @@ -14,11 +14,11 @@ public struct RocketLaunchRepositoryImpl: RocketLaunchRepository { self.graphQL = graphQLProvider } - public func read() -> AsyncThrowingStream<[RocketLaunch], Error> { + public func list() -> AsyncThrowingStream<[RocketLaunch], Error> { AsyncThrowingStream { continuation in Task { do { - for try await result in graphQL.fetch(query: RocketLaunchListQuery()) { + for try await result in graphQL.fetch(query: Rocket.RocketLaunchListQuery()) { guard let data = result.data else { return } continuation.yield(data.launches.launches.compactMap { $0?.domainModel }) } diff --git a/ios/DataLayer/Toolkits/RocketToolkit/Tests/RocketToolkitTests/RocketLaunchRepositoryTests.swift b/ios/DataLayer/Toolkits/RocketToolkit/Tests/RocketToolkitTests/RocketLaunchRepositoryTests.swift index fed5aafc..72562802 100644 --- a/ios/DataLayer/Toolkits/RocketToolkit/Tests/RocketToolkitTests/RocketLaunchRepositoryTests.swift +++ b/ios/DataLayer/Toolkits/RocketToolkit/Tests/RocketToolkitTests/RocketLaunchRepositoryTests.swift @@ -4,9 +4,12 @@ // import Apollo +import ApolloAPI +import ApolloTestSupport import GraphQLProvider import GraphQLProviderMocks @testable import RocketToolkit +import RocketToolkitMocks import SharedDomain import SharedDomainMocks import XCTest @@ -15,7 +18,7 @@ final class RocketLaunchRepositoryTests: XCTestCase { // MARK: Dependencies - private let graphQLProvider = GraphQLProviderMock() + private let graphQLProvider = GraphQLProviderMock() private func createRepository() -> RocketLaunchRepository { RocketLaunchRepositoryImpl(graphQLProvider: graphQLProvider) @@ -23,14 +26,17 @@ final class RocketLaunchRepositoryTests: XCTestCase { // MARK: Tests - func testRead() async throws { + func testList() async throws { let repository = createRepository() - let rocketLaunches = [RocketLaunch].stub.map { $0.networkModel } - let queryData = RocketLaunchListQuery.Data(launches: .init(cursor: "0", hasMore: true, launches: rocketLaunches)) + let queryData = Rocket.RocketLaunchListQuery.Data.from(Mock( + launches: Mock( + launches: [RocketLaunch].stub.map { Mock(id: $0.id, site: $0.site) } + ) + )) let queryResult = GraphQLResult(data: queryData, extensions: nil, errors: nil, source: .server, dependentKeys: nil) graphQLProvider.fetchReturnValues = [queryResult] - let rocketLaunchesStream = repository.read() + let rocketLaunchesStream = repository.list() for try await rocketLaunches in rocketLaunchesStream { XCTAssertEqual(rocketLaunches, [RocketLaunch].stub) diff --git a/ios/DataLayer/Toolkits/RocketToolkit/apollo-codegen-config.json b/ios/DataLayer/Toolkits/RocketToolkit/apollo-codegen-config.json new file mode 100644 index 00000000..8ed8d867 --- /dev/null +++ b/ios/DataLayer/Toolkits/RocketToolkit/apollo-codegen-config.json @@ -0,0 +1,44 @@ +{ + "schemaName": "rocket", + "schemaDownloadConfiguration": { + "downloadMethod": { + "introspection": { + "endpointURL": "https://apollo-fullstack-tutorial.herokuapp.com/graphql", + "httpMethod": { + "POST": {} + }, + "includeDeprecatedInputValues": false, + "outputFormat": "SDL" + } + }, + "downloadTimeout": 60, + "headers": [], + "outputPath": "./schema.graphqls" + }, + "input": { + "operationSearchPaths": [ + "./Sources/RocketToolkit/NetworkQueries/*.graphql" + ], + "schemaSearchPaths": [ + "./schema.graphqls" + ] + }, + "output": { + "schemaTypes": { + "path": "./Sources/RocketToolkit/NetworkModels/Apollo", + "moduleType": { + "embeddedInTarget": { + "name": "RocketToolkit" + } + } + }, + "operations": { + "inSchemaModule": {} + }, + "testMocks": { + "absolute": { + "path": "./Sources/RocketToolkitMocks" + } + } + } +} diff --git a/ios/DataLayer/schema.json b/ios/DataLayer/schema.json deleted file mode 100644 index add0733e..00000000 --- a/ios/DataLayer/schema.json +++ /dev/null @@ -1,1717 +0,0 @@ -{ - "__schema": { - "description": null, - "queryType": { - "name": "Query" - }, - "mutationType": { - "name": "Mutation" - }, - "subscriptionType": { - "name": "Subscription" - }, - "types": [ - { - "kind": "OBJECT", - "name": "Query", - "description": null, - "specifiedByUrl": null, - "fields": [ - { - "name": "launches", - "description": null, - "args": [ - { - "name": "pageSize", - "description": "The number of results to show. Must be >= 1. Default = 20", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "after", - "description": "If you add a cursor here, it will only return results _after_ this cursor", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "LaunchConnection", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "launch", - "description": null, - "args": [ - { - "name": "id", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Launch", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "me", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "User", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalTripsBooked", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Int", - "description": "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.", - "specifiedByUrl": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "String", - "description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", - "specifiedByUrl": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "LaunchConnection", - "description": "Simple wrapper around our list of launches that contains a cursor to the\nlast item in the list. Pass this cursor to the launches query to fetch results\nafter these.", - "specifiedByUrl": null, - "fields": [ - { - "name": "cursor", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "hasMore", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "launches", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Launch", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Boolean", - "description": "The `Boolean` scalar type represents `true` or `false`.", - "specifiedByUrl": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Launch", - "description": null, - "specifiedByUrl": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "site", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "mission", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "Mission", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "rocket", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "Rocket", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isBooked", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "ID", - "description": "The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.", - "specifiedByUrl": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Mission", - "description": null, - "specifiedByUrl": null, - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "missionPatch", - "description": null, - "args": [ - { - "name": "size", - "description": null, - "type": { - "kind": "ENUM", - "name": "PatchSize", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "PatchSize", - "description": null, - "specifiedByUrl": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "SMALL", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "LARGE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Rocket", - "description": null, - "specifiedByUrl": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "User", - "description": null, - "specifiedByUrl": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "email", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "profileImage", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "trips", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Launch", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "token", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Mutation", - "description": null, - "specifiedByUrl": null, - "fields": [ - { - "name": "bookTrips", - "description": null, - "args": [ - { - "name": "launchIds", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "TripUpdateResponse", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cancelTrip", - "description": null, - "args": [ - { - "name": "launchId", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "TripUpdateResponse", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "login", - "description": null, - "args": [ - { - "name": "email", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "OBJECT", - "name": "User", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TripUpdateResponse", - "description": null, - "specifiedByUrl": null, - "fields": [ - { - "name": "success", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "message", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "launches", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Launch", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Subscription", - "description": null, - "specifiedByUrl": null, - "fields": [ - { - "name": "tripsBooked", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Schema", - "description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.", - "specifiedByUrl": null, - "fields": [ - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "types", - "description": "A list of all types supported by this server.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "queryType", - "description": "The type that query operations will be rooted at.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "mutationType", - "description": "If this server supports mutation, the type that mutation operations will be rooted at.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "subscriptionType", - "description": "If this server support subscription, the type that subscription operations will be rooted at.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "directives", - "description": "A list of all directives supported by this server.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Directive", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Type", - "description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByUrl`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", - "specifiedByUrl": null, - "fields": [ - { - "name": "kind", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "__TypeKind", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "specifiedByUrl", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "fields", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false", - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Field", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "interfaces", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "possibleTypes", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "enumValues", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false", - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__EnumValue", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "inputFields", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false", - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ofType", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "__TypeKind", - "description": "An enum describing what kind of type a given `__Type` is.", - "specifiedByUrl": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "SCALAR", - "description": "Indicates this type is a scalar.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OBJECT", - "description": "Indicates this type is an object. `fields` and `interfaces` are valid fields.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INTERFACE", - "description": "Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNION", - "description": "Indicates this type is a union. `possibleTypes` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM", - "description": "Indicates this type is an enum. `enumValues` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_OBJECT", - "description": "Indicates this type is an input object. `inputFields` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "LIST", - "description": "Indicates this type is a list. `ofType` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NON_NULL", - "description": "Indicates this type is a non-null. `ofType` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Field", - "description": "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", - "specifiedByUrl": null, - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "args", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false", - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__InputValue", - "description": "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", - "specifiedByUrl": null, - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValue", - "description": "A GraphQL-formatted string representing the default value for this input value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__EnumValue", - "description": "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", - "specifiedByUrl": null, - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Directive", - "description": "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", - "specifiedByUrl": null, - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isRepeatable", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locations", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "__DirectiveLocation", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "args", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false", - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "__DirectiveLocation", - "description": "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", - "specifiedByUrl": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "QUERY", - "description": "Location adjacent to a query operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "MUTATION", - "description": "Location adjacent to a mutation operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SUBSCRIPTION", - "description": "Location adjacent to a subscription operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD", - "description": "Location adjacent to a field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_DEFINITION", - "description": "Location adjacent to a fragment definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_SPREAD", - "description": "Location adjacent to a fragment spread.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INLINE_FRAGMENT", - "description": "Location adjacent to an inline fragment.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "VARIABLE_DEFINITION", - "description": "Location adjacent to a variable definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCHEMA", - "description": "Location adjacent to a schema definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCALAR", - "description": "Location adjacent to a scalar definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OBJECT", - "description": "Location adjacent to an object type definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD_DEFINITION", - "description": "Location adjacent to a field definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ARGUMENT_DEFINITION", - "description": "Location adjacent to an argument definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INTERFACE", - "description": "Location adjacent to an interface definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNION", - "description": "Location adjacent to a union definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM", - "description": "Location adjacent to an enum definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM_VALUE", - "description": "Location adjacent to an enum value definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_OBJECT", - "description": "Location adjacent to an input object type definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_FIELD_DEFINITION", - "description": "Location adjacent to an input object field definition.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Upload", - "description": "The `Upload` scalar type represents a file upload.", - "specifiedByUrl": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - } - ], - "directives": [ - { - "name": "skip", - "description": "Directs the executor to skip this field or fragment when the `if` argument is true.", - "isRepeatable": false, - "locations": [ - "FIELD", - "FRAGMENT_SPREAD", - "INLINE_FRAGMENT" - ], - "args": [ - { - "name": "if", - "description": "Skipped when true.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ] - }, - { - "name": "include", - "description": "Directs the executor to include this field or fragment only when the `if` argument is true.", - "isRepeatable": false, - "locations": [ - "FIELD", - "FRAGMENT_SPREAD", - "INLINE_FRAGMENT" - ], - "args": [ - { - "name": "if", - "description": "Included when true.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ] - }, - { - "name": "deprecated", - "description": "Marks an element of a GraphQL schema as no longer supported.", - "isRepeatable": false, - "locations": [ - "FIELD_DEFINITION", - "ENUM_VALUE" - ], - "args": [ - { - "name": "reason", - "description": "Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax (as specified by [CommonMark](https://commonmark.org/).", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": "\"No longer supported\"", - "isDeprecated": false, - "deprecationReason": null - } - ] - } - ] - } -} \ No newline at end of file diff --git a/ios/DevStack.xcodeproj/project.pbxproj b/ios/DevStack.xcodeproj/project.pbxproj index a16ba06e..1bf054e6 100644 --- a/ios/DevStack.xcodeproj/project.pbxproj +++ b/ios/DevStack.xcodeproj/project.pbxproj @@ -40,7 +40,6 @@ 4524472727A417B1004853C8 /* WidgetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4524472627A417B1004853C8 /* WidgetView.swift */; }; 453580E7284801D8007AEC9E /* GraphQLProvider in Frameworks */ = {isa = PBXBuildFile; productRef = 453580E6284801D8007AEC9E /* GraphQLProvider */; }; 453580E9284801DE007AEC9E /* RocketToolkit in Frameworks */ = {isa = PBXBuildFile; productRef = 453580E8284801DE007AEC9E /* RocketToolkit */; }; - 453580ED284806D1007AEC9E /* schema.json in Resources */ = {isa = PBXBuildFile; fileRef = 453580EC284806D1007AEC9E /* schema.json */; }; 453580EF284806FE007AEC9E /* strings.txt in Resources */ = {isa = PBXBuildFile; fileRef = 453580EE284806FE007AEC9E /* strings.txt */; }; 454F6EC426CE8B3900C386B8 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 454F6EC226CE8B3500C386B8 /* InfoPlist.strings */; }; 4558D30B20FCC8FF005BC325 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4558D30A20FCC8FF005BC325 /* AppDelegate.swift */; }; @@ -102,7 +101,6 @@ 4524472627A417B1004853C8 /* WidgetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetView.swift; sourceTree = ""; }; 4534C1C42603D6AD0022ACF4 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 453580E52847E814007AEC9E /* GraphQLProvider */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = GraphQLProvider; sourceTree = ""; }; - 453580EC284806D1007AEC9E /* schema.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = schema.json; sourceTree = ""; }; 453580EE284806FE007AEC9E /* strings.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = strings.txt; path = ../../twine/strings.txt; sourceTree = ""; }; 453C8807283FAB4C0027BDFB /* SharedDomain */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = SharedDomain; sourceTree = ""; }; 453C880C283FB33D0027BDFB /* DevstackKmpShared.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = DevstackKmpShared.xcframework; sourceTree = ""; }; @@ -234,7 +232,6 @@ children = ( 45FF99D62842B05700E32D9A /* Toolkits */, 45702E5928421D7F008D5487 /* Providers */, - 453580EC284806D1007AEC9E /* schema.json */, ); path = DataLayer; sourceTree = ""; @@ -521,7 +518,6 @@ files = ( 4575E65625F6FA7600CCC003 /* AppIcon.xcassets in Resources */, 453580EF284806FE007AEC9E /* strings.txt in Resources */, - 453580ED284806D1007AEC9E /* schema.json in Resources */, 454F6EC426CE8B3900C386B8 /* InfoPlist.strings in Resources */, 4597626F20FDF0810034DE29 /* LaunchScreen.storyboard in Resources */, ); diff --git a/ios/DevStack.xcodeproj/xcshareddata/xcschemes/DevStack.xcscheme b/ios/DevStack.xcodeproj/xcshareddata/xcschemes/DevStack.xcscheme index 87d0d2e5..0d1a7593 100644 --- a/ios/DevStack.xcodeproj/xcshareddata/xcschemes/DevStack.xcscheme +++ b/ios/DevStack.xcodeproj/xcshareddata/xcschemes/DevStack.xcscheme @@ -26,7 +26,7 @@ ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction"> + scriptText = "cd "${PROJECT_DIR}" exec > prebuild.log 2>&1 # For debugging scripts/twine.sh scripts/sourcery.sh "> + scriptText = "cd "${PROJECT_DIR}" exec > prebuild.log 2>&1 # For debugging scripts/twine.sh scripts/sourcery.sh "> + scriptText = "cd "${PROJECT_DIR}" exec > prebuild.log 2>&1 # For debugging scripts/twine.sh scripts/sourcery.sh "> AsyncThrowingStream<[RocketLaunch], Error> + func list() -> AsyncThrowingStream<[RocketLaunch], Error> } diff --git a/ios/DomainLayer/SharedDomain/Sources/SharedDomain/Rocket/UseCases/GetRocketLaunchesUseCase.swift b/ios/DomainLayer/SharedDomain/Sources/SharedDomain/Rocket/UseCases/GetRocketLaunchesUseCase.swift index 8567e1cb..97730f49 100644 --- a/ios/DomainLayer/SharedDomain/Sources/SharedDomain/Rocket/UseCases/GetRocketLaunchesUseCase.swift +++ b/ios/DomainLayer/SharedDomain/Sources/SharedDomain/Rocket/UseCases/GetRocketLaunchesUseCase.swift @@ -17,6 +17,6 @@ public struct GetRocketLaunchesUseCaseImpl: GetRocketLaunchesUseCase { } public func execute() -> AsyncThrowingStream<[RocketLaunch], Error> { - rocketLaunchRepository.read() + rocketLaunchRepository.list() } } diff --git a/ios/DomainLayer/SharedDomain/Tests/SharedDomainTests/Rocket/GetRocketLaunchesUseCaseTests.swift b/ios/DomainLayer/SharedDomain/Tests/SharedDomainTests/Rocket/GetRocketLaunchesUseCaseTests.swift index ae43cac5..8beb385a 100644 --- a/ios/DomainLayer/SharedDomain/Tests/SharedDomainTests/Rocket/GetRocketLaunchesUseCaseTests.swift +++ b/ios/DomainLayer/SharedDomain/Tests/SharedDomainTests/Rocket/GetRocketLaunchesUseCaseTests.swift @@ -17,7 +17,7 @@ final class GetRocketLaunchesUseCaseTests: XCTestCase { func testExecute() async throws { let useCase = GetRocketLaunchesUseCaseImpl(rocketLaunchRepository: rocketLaunchRepository) - rocketLaunchRepository.readReturnValue = AsyncThrowingStream([RocketLaunch].self) { continuation in + rocketLaunchRepository.listReturnValue = AsyncThrowingStream([RocketLaunch].self) { continuation in continuation.yield([RocketLaunch].stub) continuation.finish() } @@ -27,6 +27,6 @@ final class GetRocketLaunchesUseCaseTests: XCTestCase { for try await rocketLaunches in rocketLaunchesStream { XCTAssertEqual(rocketLaunches, [RocketLaunch].stub) } - XCTAssertEqual(rocketLaunchRepository.readCallsCount, 1) + XCTAssertEqual(rocketLaunchRepository.listCallsCount, 1) } } diff --git a/ios/PresentationLayer/UIToolkit/Plugins/SwiftGenPlugin/Plugin.swift b/ios/PresentationLayer/UIToolkit/Plugins/SwiftGenPlugin/Plugin.swift index 3950bbf8..957a0a6e 100644 --- a/ios/PresentationLayer/UIToolkit/Plugins/SwiftGenPlugin/Plugin.swift +++ b/ios/PresentationLayer/UIToolkit/Plugins/SwiftGenPlugin/Plugin.swift @@ -7,7 +7,7 @@ import Foundation import PackagePlugin @main -struct SwiftGenPlugins: BuildToolPlugin { +struct SwiftGenPlugin: BuildToolPlugin { func createBuildCommands(context: PluginContext, target: Target) async throws -> [Command] { let configurations: [Path] = [context.package.directory, target.directory] .map { $0.appending("swiftgen.yml") } diff --git a/ios/scripts/apollo.sh b/ios/scripts/apollo.sh index 89fb0161..c099830d 100755 --- a/ios/scripts/apollo.sh +++ b/ios/scripts/apollo.sh @@ -1,32 +1,10 @@ -#!/bin/zsh -l +#!/bin/bash -# Don't run this during index builds -if [ $ACTION = "indexbuild" ]; then exit 0; fi +cd "$(dirname "$0")" -# Go to the build root and search up the chain to find the Derived Data Path where the source packages are checked out. -DERIVED_DATA_CANDIDATE="${BUILD_ROOT}" - -while ! [ -d "${DERIVED_DATA_CANDIDATE}/SourcePackages" ]; do - if [ "${DERIVED_DATA_CANDIDATE}" = / ]; then - echo >&2 "error: Unable to locate SourcePackages directory from BUILD_ROOT: '${BUILD_ROOT}'" - exit 1 - fi - - DERIVED_DATA_CANDIDATE="$(dirname "${DERIVED_DATA_CANDIDATE}")" -done - -# Grab a reference to the directory where scripts are checked out -SCRIPT_PATH="${DERIVED_DATA_CANDIDATE}/SourcePackages/checkouts/apollo-ios/scripts" - -if [ -z "${SCRIPT_PATH}" ]; then - echo >&2 "error: Couldn't find the CLI script in your checked out SPM packages; make sure to add the framework to your project." - exit 1 -fi - -cd "${SRCROOT}" - -# Download GraphQL schema -#"${SCRIPT_PATH}"/run-bundled-codegen.sh schema:download --endpoint="https://apollo-fullstack-tutorial.herokuapp.com/graphql" "./DataLayer/schema.json" - -# Generate code from queries -"${SCRIPT_PATH}"/run-bundled-codegen.sh codegen:generate --target=swift --includes="./DataLayer/Toolkits/RocketToolkit/Sources/RocketToolkit/NetworkQueries/*.graphql" --localSchemaFile="./DataLayer/schema.json" "./DataLayer/Toolkits/RocketToolkit/Sources/RocketToolkit/NetworkModels/NETModels.generated.swift" +# RocketToolkit +cd ../DataLayer/Toolkits/RocketToolkit +swift package --disable-sandbox --allow-writing-to-package-directory apollo-fetch-schema +swift package --disable-sandbox --allow-writing-to-package-directory apollo-generate +find ./Sources/RocketToolkitMocks -type f -exec sed -i '' -e "s/rocket/Rocket/g" {} + +cd ../../.. diff --git a/ios/scripts/setup.sh b/ios/scripts/setup.sh index fcb70972..35c597f6 100755 --- a/ios/scripts/setup.sh +++ b/ios/scripts/setup.sh @@ -14,6 +14,9 @@ else echo "✅ File header is properly set" fi +echo "Downloading GraphQL schemas and generating code from queries" +./apollo.sh + echo "Checking whether Homebrew is installed" if command -v brew &> /dev/null; then echo "✅ Homebrew is installed"