From 94be72076b944f5957dd520f45e2a72868a06a04 Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Thu, 6 Jun 2024 11:23:19 -0700 Subject: [PATCH] Added Existential Any requirement (apollographql/apollo-ios-dev#379) --- .package.resolved | 9 + .../ClassroomPetDetails.graphql.swift | 14 +- .../Fragments/CrocodileFragment.graphql.swift | 2 +- .../Fragments/DogFragment.graphql.swift | 2 +- .../Fragments/HeightInMeters.graphql.swift | 4 +- .../Fragments/PetDetails.graphql.swift | 4 +- .../WarmBloodedDetails.graphql.swift | 2 +- ...AllAnimalsLocalCacheMutation.graphql.swift | 6 +- .../PetDetailsMutation.graphql.swift | 4 +- .../PetSearchLocalCacheMutation.graphql.swift | 4 +- .../PetAdoptionMutation.graphql.swift | 4 +- .../AllAnimalsIncludeSkipQuery.graphql.swift | 36 +- .../Queries/AllAnimalsQuery.graphql.swift | 40 +-- .../Queries/ClassroomPetsQuery.graphql.swift | 16 +- .../Operations/Queries/DogQuery.graphql.swift | 6 +- .../Queries/PetSearchQuery.graphql.swift | 4 +- .../Schema/SchemaMetadata.graphql.swift | 2 +- .../Fragments/AuthorDetails.graphql.swift | 4 +- ...ndCommentsForRepositoryQuery.graphql.swift | 20 +- .../Queries/RepoURLQuery.graphql.swift | 4 +- .../Queries/RepositoryQuery.graphql.swift | 16 +- .../Schema/SchemaMetadata.graphql.swift | 2 +- .../CharacterAppearsIn.graphql.swift | 2 +- .../Fragments/CharacterName.graphql.swift | 2 +- .../CharacterNameAndAppearsIn.graphql.swift | 2 +- ...AppearsInWithNestedFragments.graphql.swift | 2 +- ...aracterNameAndDroidAppearsIn.graphql.swift | 4 +- ...rNameAndDroidPrimaryFunction.graphql.swift | 4 +- ...racterNameWithInlineFragment.graphql.swift | 8 +- ...eWithNestedAppearsInFragment.graphql.swift | 2 +- .../Fragments/DroidDetails.graphql.swift | 2 +- .../Sources/Fragments/DroidName.graphql.swift | 2 +- .../DroidNameAndPrimaryFunction.graphql.swift | 2 +- .../DroidPrimaryFunction.graphql.swift | 2 +- .../Fragments/FriendsNames.graphql.swift | 4 +- .../Fragments/HeroDetails.graphql.swift | 6 +- .../HumanHeightWithVariable.graphql.swift | 2 +- .../CreateAwesomeReviewMutation.graphql.swift | 4 +- ...eateReviewForEpisodeMutation.graphql.swift | 4 +- ...eReviewWithNullFieldMutation.graphql.swift | 4 +- ...roidDetailsWithFragmentQuery.graphql.swift | 6 +- .../HeroAndFriendsIDsQuery.graphql.swift | 6 +- .../HeroAndFriendsNamesQuery.graphql.swift | 6 +- ...riendsNamesWithFragmentQuery.graphql.swift | 4 +- ...sNamesWithFragmentTwiceQuery.graphql.swift | 10 +- ...amesWithIDForParentOnlyQuery.graphql.swift | 6 +- ...oAndFriendsNamesWithIDsQuery.graphql.swift | 6 +- .../Queries/HeroAppearsInQuery.graphql.swift | 4 +- ...roAppearsInWithFragmentQuery.graphql.swift | 4 +- ...entConditionalInclusionQuery.graphql.swift | 6 +- ...ineConditionalInclusionQuery.graphql.swift | 6 +- .../Queries/HeroDetailsQuery.graphql.swift | 8 +- ...HeroDetailsWithFragmentQuery.graphql.swift | 8 +- ...ilsConditionalInclusionQuery.graphql.swift | 8 +- ...AndConditionalInclusionQuery.graphql.swift | 12 +- ...roFriendsOfFriendsNamesQuery.graphql.swift | 8 +- .../HeroNameAndAppearsInQuery.graphql.swift | 4 +- ...ndAppearsInWithFragmentQuery.graphql.swift | 4 +- ...HeroNameConditionalBothQuery.graphql.swift | 4 +- ...ConditionalBothSeparateQuery.graphql.swift | 4 +- ...ameConditionalExclusionQuery.graphql.swift | 4 +- ...ameConditionalInclusionQuery.graphql.swift | 4 +- .../Queries/HeroNameQuery.graphql.swift | 4 +- ...ficConditionalInclusionQuery.graphql.swift | 6 +- ...roNameWithFragmentAndIDQuery.graphql.swift | 4 +- .../HeroNameWithFragmentQuery.graphql.swift | 4 +- .../Queries/HeroNameWithIDQuery.graphql.swift | 4 +- ...arentTypeDependentFieldQuery.graphql.swift | 16 +- ...peDependentAliasedFieldQuery.graphql.swift | 8 +- .../Queries/HumanQuery.graphql.swift | 4 +- .../Queries/SameHeroTwiceQuery.graphql.swift | 6 +- .../Queries/SearchQuery.graphql.swift | 10 +- .../StarshipCoordinatesQuery.graphql.swift | 4 +- .../Queries/StarshipQuery.graphql.swift | 4 +- .../Queries/TwoHeroesQuery.graphql.swift | 6 +- .../ReviewAddedSubscription.graphql.swift | 4 +- .../Schema/SchemaMetadata.graphql.swift | 2 +- .../IncrementingSubscription.graphql.swift | 2 +- .../Schema/SchemaMetadata.graphql.swift | 2 +- ...oDifferentParametersMutation.graphql.swift | 4 +- ...esToTheSameParameterMutation.graphql.swift | 4 +- .../UploadOneFileMutation.graphql.swift | 4 +- .../Schema/SchemaMetadata.graphql.swift | 2 +- .../IRTestWrapper.swift | 2 +- .../MockFileGenerator.swift | 4 +- .../MockNetworkSession.swift | 6 +- .../Templates/CustomScalarTemplateTests.swift | 2 +- .../Templates/FragmentTemplateTests.swift | 12 +- .../Templates/MockObjectTemplateTests.swift | 16 +- .../OperationDefinitionTemplateTests.swift | 2 +- .../SchemaMetadataTemplateTests.swift | 10 +- .../SelectionSetTemplateTests.swift | 28 +- .../FileManagerExtensionTests.swift | 2 +- .../URLDownloaderTests.swift | 8 +- .../ConcurrentTaskContainer.swift | 4 +- .../InterceptorTester.swift | 20 +- .../ApolloInternalTestHelpers/Matchable.swift | 2 +- .../MockApolloStore.swift | 2 +- .../MockGraphQLServer.swift | 2 +- .../MockLocalCacheMutation.swift | 2 +- .../MockNetworkTransport.swift | 8 +- .../MockOperation.swift | 2 +- .../MockSchemaMetadata.swift | 6 +- .../MockURLProtocol.swift | 2 +- .../MockURLSession.swift | 4 +- .../MockWebSocket.swift | 2 +- .../MockWebSocketDelegate.swift | 8 +- .../SQLiteTestCacheProvider.swift | 4 +- .../TestCacheProvider.swift | 12 +- .../XCTAssertHelpers.swift | 8 +- .../XCTestCase+Helpers.swift | 6 +- ...yncGraphQLQueryPagerCoordinatorTests.swift | 4 +- .../BidirectionalPaginationTests.swift | 8 +- .../ConcurrencyTest.swift | 4 +- .../ForwardPaginationTests.swift | 6 +- .../GraphQLQueryPagerCoordinatorTests.swift | 8 +- .../GraphQLQueryPagerTests.swift | 2 +- Tests/ApolloPaginationTests/OffsetTests.swift | 4 +- .../ReversePaginationTests.swift | 6 +- .../SubscribeTests.swift | 8 +- .../XCTAssert+Async.swift | 2 +- ...ectionSetInitializerPerformanceTests.swift | 1 + .../TypeCaseConversionPerformanceTests.swift | 1 + .../StarWarsServerCachingRoundtripTests.swift | 6 +- .../StarWarsServerTests.swift | 14 +- .../StarWarsSubscriptionTests.swift | 6 +- .../StarWarsWebSocketTests.swift | 4 +- .../SubscriptionTests.swift | 2 +- .../TestHelpers/TestConfigs.swift | 14 +- .../ApolloClientOperationTests.swift | 2 +- Tests/ApolloTests/BatchedLoadTests.swift | 6 +- .../BlindRetryingTestInterceptor.swift | 4 +- .../CacheDependentInterceptorTests.swift | 14 +- Tests/ApolloTests/Cache/FetchQueryTests.swift | 4 +- .../Cache/LoadQueryFromStoreTests.swift | 4 +- .../Cache/ReadWriteFromStoreTests.swift | 48 +-- .../Cache/SQLite/SQLiteCacheTests.swift | 8 +- .../Cache/StoreConcurrencyTests.swift | 4 +- Tests/ApolloTests/Cache/WatchQueryTests.swift | 4 +- .../CancellationHandlingInterceptor.swift | 4 +- Tests/ApolloTests/ClearCacheTests.swift | 2 +- ..._ResultNormalizer_FromResponse_Tests.swift | 16 +- ...electionSetMapper_FromResponse_Tests.swift | 30 +- Tests/ApolloTests/JSONValueMatcher.swift | 2 +- .../ApolloTests/RequestBodyCreatorTests.swift | 2 +- Tests/ApolloTests/RequestChainTests.swift | 70 ++-- .../RetryToCountThenSucceedInterceptor.swift | 4 +- Tests/ApolloTests/SelectionSetTests.swift | 64 ++-- .../SelectionSet_JSONInitializerTests.swift | 24 +- Tests/ApolloTests/TestMockTests.swift | 44 +-- .../Matchers/ErrorMatchers.swift | 6 +- .../Support/MockApolloSchemaDownloader.swift | 2 +- .../Support/MockLogLevelSetter.swift | 2 +- .../project.pbxproj | 312 +++++++++++++++++- .../ClassroomPetDetails.graphql.swift | 14 +- .../Fragments/CrocodileFragment.graphql.swift | 2 +- .../MyAPI/Fragments/DogFragment.graphql.swift | 2 +- .../Fragments/HeightInMeters.graphql.swift | 4 +- .../MyAPI/Fragments/PetDetails.graphql.swift | 4 +- .../WarmBloodedDetails.graphql.swift | 2 +- ...AllAnimalsLocalCacheMutation.graphql.swift | 6 +- .../PetDetailsMutation.graphql.swift | 4 +- .../PetSearchLocalCacheMutation.graphql.swift | 4 +- .../PetAdoptionMutation.graphql.swift | 4 +- .../AllAnimalsIncludeSkipQuery.graphql.swift | 48 +-- .../Queries/AllAnimalsQuery.graphql.swift | 65 ++-- .../Queries/ClassroomPetsQuery.graphql.swift | 16 +- .../Operations/Queries/DogQuery.graphql.swift | 6 +- .../Queries/PetSearchQuery.graphql.swift | 4 +- .../MyAPI/Schema/CustomScalars/ID.swift | 14 + .../PetAdoptionInput.graphql.swift | 2 +- .../Schema/Interfaces/Animal.graphql.swift | 2 +- .../Schema/Interfaces/HousePet.graphql.swift | 2 +- .../MyAPI/Schema/Interfaces/Pet.graphql.swift | 2 +- .../Interfaces/WarmBlooded.graphql.swift | 2 +- .../MyAPI/Schema/SchemaMetadata.graphql.swift | 4 +- .../Package.swift | 10 +- .../Tests/TestAppTests/TestAppTests.swift | 6 +- .../PackageOne/Package.swift | 12 +- .../graphql/ccnGraphql/AllAnimalsCCN.graphql | 8 - .../ccnGraphql/ClassroomPetsCCN.graphql | 14 - .../PackageTwo/Package.swift | 14 +- .../apollo-codegen-config.json | 2 +- .../project.pbxproj | 6 + .../project.pbxproj | 18 +- .../xcschemes/AnimalKingdomAPI.xcscheme | 2 +- .../xcschemes/CustomTargetProject.xcscheme | 2 +- .../CustomTargetProjectTests.xcscheme | 2 +- .../SwiftPackageManager/Package.swift | 8 +- .../Settings/Settings+Apollo.swift | 37 ++- apollo-ios-codegen/Package.swift | 23 +- .../ApolloCodegenLib/ApolloCodegen.swift | 6 +- .../ApolloCodegenConfiguration.swift | 32 +- .../ApolloSchemaDownloadConfiguration.swift | 4 +- .../ApolloSchemaDownloader.swift | 14 +- ...ation+OperationManifestConfiguration.swift | 4 +- .../CustomScalarFileGenerator.swift | 2 +- .../FileGenerators/EnumFileGenerator.swift | 2 +- .../FileGenerators/FileGenerator.swift | 2 +- .../FragmentFileGenerator.swift | 2 +- .../InputObjectFileGenerator.swift | 2 +- .../InterfaceFileGenerator.swift | 2 +- .../MockInterfacesFileGenerator.swift | 2 +- .../MockObjectFileGenerator.swift | 2 +- .../MockUnionsFileGenerator.swift | 2 +- .../FileGenerators/ObjectFileGenerator.swift | 2 +- .../OperationFileGenerator.swift | 2 +- .../SchemaConfigurationFileGenerator.swift | 2 +- .../SchemaMetadataFileGenerator.swift | 2 +- .../FileGenerators/UnionFileGenerator.swift | 2 +- .../Sources/ApolloCodegenLib/Glob.swift | 4 +- .../OperationIdentifierFactory.swift | 2 +- .../Templates/MockObjectTemplate.swift | 2 +- .../Templates/SchemaMetadataTemplate.swift | 2 +- .../Templates/SelectionSetTemplate.swift | 6 +- .../ApolloCodegenLib/URLDownloader.swift | 12 +- .../CodegenCLI/Commands/FetchSchema.swift | 6 +- .../CodegenCLI/Commands/Generate.swift | 12 +- .../Commands/GenerateOperationManifest.swift | 6 +- .../Protocols/SchemaDownloadProvider.swift | 2 +- .../GraphQLCompiler/JavaScriptBridge.swift | 16 +- .../Sources/IR/IR+FieldCollector.swift | 8 +- .../Sources/IR/IR+RootFieldBuilder.swift | 2 +- .../Sources/IR/IR+ScopeDescriptor.swift | 2 +- apollo-ios-pagination/Package.swift | 5 +- .../AsyncGraphQLQueryPager.swift | 10 +- .../AsyncGraphQLQueryPagerCoordinator.swift | 28 +- .../GraphQLQueryPager+Convenience.swift | 24 +- .../ApolloPagination/GraphQLQueryPager.swift | 10 +- .../GraphQLQueryPagerCoordinator.swift | 6 +- .../ApolloPagination/PaginationError.swift | 2 +- apollo-ios/Package.swift | 15 +- apollo-ios/Sources/Apollo/ApolloClient.swift | 30 +- .../Sources/Apollo/ApolloClientProtocol.swift | 28 +- .../Apollo/ApolloErrorInterceptor.swift | 10 +- .../Sources/Apollo/ApolloInterceptor.swift | 4 +- apollo-ios/Sources/Apollo/ApolloStore.swift | 20 +- .../AutomaticPersistedQueryInterceptor.swift | 4 +- .../Sources/Apollo/CacheReadInterceptor.swift | 8 +- .../Apollo/CacheWriteInterceptor.swift | 4 +- apollo-ios/Sources/Apollo/DataLoader.swift | 2 +- .../Apollo/DefaultInterceptorProvider.swift | 2 +- .../Apollo/DispatchQueue+Optional.swift | 4 +- .../CacheDataExecutionSource.swift | 2 +- .../NetworkResponseExecutionSource.swift | 6 +- .../SelectionSetModelExecutionSource.swift | 6 +- .../Apollo/GraphQLExecutionSource.swift | 4 +- .../Sources/Apollo/GraphQLExecutor.swift | 8 +- .../Sources/Apollo/GraphQLQueryWatcher.swift | 12 +- apollo-ios/Sources/Apollo/GraphQLResult.swift | 2 +- .../Apollo/GraphQLResultNormalizer.swift | 2 +- apollo-ios/Sources/Apollo/HTTPRequest.swift | 4 +- .../Sources/Apollo/InterceptorProvider.swift | 4 +- .../Apollo/InterceptorRequestChain.swift | 22 +- apollo-ios/Sources/Apollo/JSONRequest.swift | 6 +- .../JSONResponseParsingInterceptor.swift | 4 +- .../Apollo/JSONSerializationFormat.swift | 2 +- .../Sources/Apollo/MaxRetryInterceptor.swift | 4 +- .../Apollo/MultipartResponseDeferParser.swift | 2 +- .../MultipartResponseParsingInterceptor.swift | 10 +- .../MultipartResponseSubscriptionParser.swift | 2 +- .../Apollo/NetworkFetchInterceptor.swift | 4 +- .../Sources/Apollo/NetworkTransport.swift | 8 +- .../Sources/Apollo/PossiblyDeferred.swift | 4 +- apollo-ios/Sources/Apollo/RequestChain.swift | 14 +- .../Apollo/RequestChainNetworkTransport.swift | 22 +- .../Apollo/ResponseCodeInterceptor.swift | 4 +- .../Sources/Apollo/URLSessionClient.swift | 10 +- apollo-ios/Sources/Apollo/UploadRequest.swift | 8 +- .../Sources/ApolloAPI/GraphQLOperation.swift | 4 +- .../JSONStandardTypeConversions.swift | 2 +- apollo-ios/Sources/ApolloAPI/ObjectData.swift | 8 +- .../Sources/ApolloAPI/SchemaMetadata.swift | 2 +- .../ApolloAPI/SchemaTypes/InputObject.swift | 4 +- apollo-ios/Sources/ApolloAPI/Selection.swift | 2 +- .../Sources/ApolloAPI/SelectionSet.swift | 2 +- .../ApolloSQLite/SQLiteNormalizedCache.swift | 6 +- .../Sources/ApolloTestSupport/TestMock.swift | 8 +- .../DefaultImplementation/WebSocket.swift | 18 +- .../WebSocketStream.swift | 10 +- .../ApolloWebSocket/OperationMessage.swift | 4 +- .../SplitNetworkTransport.swift | 14 +- .../ApolloWebSocket/WebSocketClient.swift | 10 +- .../ApolloWebSocket/WebSocketError.swift | 2 +- .../ApolloWebSocket/WebSocketTask.swift | 2 +- .../ApolloWebSocket/WebSocketTransport.swift | 46 +-- 286 files changed, 1440 insertions(+), 1110 deletions(-) create mode 100644 Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/CustomScalars/ID.swift delete mode 100644 Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageOne/Sources/PackageOne/graphql/ccnGraphql/AllAnimalsCCN.graphql delete mode 100644 Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageOne/Sources/PackageOne/graphql/ccnGraphql/ClassroomPetsCCN.graphql diff --git a/.package.resolved b/.package.resolved index f32fe5631..456c05981 100644 --- a/.package.resolved +++ b/.package.resolved @@ -1,5 +1,14 @@ { "pins" : [ + { + "identity" : "apollo-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apollographql/apollo-ios.git", + "state" : { + "revision" : "99dfbdb869dbba16bd09e086b2b669bfcab811ec", + "version" : "1.12.2" + } + }, { "identity" : "cwlcatchexception", "kind" : "remoteSourceControl", diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/ClassroomPetDetails.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/ClassroomPetDetails.graphql.swift index b59fb9378..fa311f303 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/ClassroomPetDetails.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/ClassroomPetDetails.graphql.swift @@ -11,7 +11,7 @@ public struct ClassroomPetDetails: AnimalKingdomAPI.SelectionSet, Fragment { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Unions.ClassroomPet } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Unions.ClassroomPet } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .inlineFragment(AsAnimal.self), @@ -50,7 +50,7 @@ public struct ClassroomPetDetails: AnimalKingdomAPI.SelectionSet, Fragment { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetDetails - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } public static var __selections: [ApolloAPI.Selection] { [ .field("species", String.self), ] } @@ -82,7 +82,7 @@ public struct ClassroomPetDetails: AnimalKingdomAPI.SelectionSet, Fragment { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetDetails - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Pet } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Pet } public static var __selections: [ApolloAPI.Selection] { [ .field("humanName", String?.self), ] } @@ -114,7 +114,7 @@ public struct ClassroomPetDetails: AnimalKingdomAPI.SelectionSet, Fragment { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetDetails - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.WarmBlooded } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.WarmBlooded } public static var __selections: [ApolloAPI.Selection] { [ .field("laysEggs", Bool.self), ] } @@ -150,7 +150,7 @@ public struct ClassroomPetDetails: AnimalKingdomAPI.SelectionSet, Fragment { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetDetails - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Cat } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Cat } public static var __selections: [ApolloAPI.Selection] { [ .field("bodyTemperature", Int.self), .field("isJellicle", Bool.self), @@ -197,7 +197,7 @@ public struct ClassroomPetDetails: AnimalKingdomAPI.SelectionSet, Fragment { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetDetails - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Bird } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Bird } public static var __selections: [ApolloAPI.Selection] { [ .field("wingspan", Double.self), ] } @@ -240,7 +240,7 @@ public struct ClassroomPetDetails: AnimalKingdomAPI.SelectionSet, Fragment { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetDetails - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.PetRock } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.PetRock } public static var __selections: [ApolloAPI.Selection] { [ .field("favoriteToy", String.self), ] } diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/CrocodileFragment.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/CrocodileFragment.graphql.swift index 563429226..e2d8a3026 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/CrocodileFragment.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/CrocodileFragment.graphql.swift @@ -11,7 +11,7 @@ public struct CrocodileFragment: AnimalKingdomAPI.SelectionSet, Fragment { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Crocodile } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Crocodile } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("species", String.self), diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/DogFragment.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/DogFragment.graphql.swift index a8a4d8636..4563ab20b 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/DogFragment.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/DogFragment.graphql.swift @@ -11,7 +11,7 @@ public struct DogFragment: AnimalKingdomAPI.SelectionSet, Fragment { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Dog } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Dog } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("species", String.self), diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/HeightInMeters.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/HeightInMeters.graphql.swift index 2b449eeee..33aa69a21 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/HeightInMeters.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/HeightInMeters.graphql.swift @@ -11,7 +11,7 @@ public struct HeightInMeters: AnimalKingdomAPI.SelectionSet, Fragment { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("height", Height.self), @@ -41,7 +41,7 @@ public struct HeightInMeters: AnimalKingdomAPI.SelectionSet, Fragment { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("meters", Int.self), diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/PetDetails.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/PetDetails.graphql.swift index fa42bc844..bf5f36fb4 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/PetDetails.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/PetDetails.graphql.swift @@ -11,7 +11,7 @@ public struct PetDetails: AnimalKingdomAPI.SelectionSet, Fragment { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Pet } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Pet } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("humanName", String?.self), @@ -49,7 +49,7 @@ public struct PetDetails: AnimalKingdomAPI.SelectionSet, Fragment { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Human } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Human } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("firstName", String.self), diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/WarmBloodedDetails.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/WarmBloodedDetails.graphql.swift index 13bf20c93..67367755f 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/WarmBloodedDetails.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Fragments/WarmBloodedDetails.graphql.swift @@ -11,7 +11,7 @@ public struct WarmBloodedDetails: AnimalKingdomAPI.SelectionSet, Fragment { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.WarmBlooded } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.WarmBlooded } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("bodyTemperature", Int.self), diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/LocalCacheMutations/AllAnimalsLocalCacheMutation.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/LocalCacheMutations/AllAnimalsLocalCacheMutation.graphql.swift index 8f33cbf44..7647d2047 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/LocalCacheMutations/AllAnimalsLocalCacheMutation.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/LocalCacheMutations/AllAnimalsLocalCacheMutation.graphql.swift @@ -12,7 +12,7 @@ public class AllAnimalsLocalCacheMutation: LocalCacheMutation { public var __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("allAnimals", [AllAnimal].self), ] } @@ -43,7 +43,7 @@ public class AllAnimalsLocalCacheMutation: LocalCacheMutation { public var __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("species", String.self), @@ -90,7 +90,7 @@ public class AllAnimalsLocalCacheMutation: LocalCacheMutation { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsLocalCacheMutation.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Bird } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Bird } public static var __selections: [ApolloAPI.Selection] { [ .field("wingspan", Double.self), ] } diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/LocalCacheMutations/PetDetailsMutation.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/LocalCacheMutations/PetDetailsMutation.graphql.swift index ea4b22664..b8ed1d5ca 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/LocalCacheMutations/PetDetailsMutation.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/LocalCacheMutations/PetDetailsMutation.graphql.swift @@ -11,7 +11,7 @@ public struct PetDetailsMutation: AnimalKingdomAPI.MutableSelectionSet, Fragment public var __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Pet } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Pet } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("owner", Owner?.self), @@ -44,7 +44,7 @@ public struct PetDetailsMutation: AnimalKingdomAPI.MutableSelectionSet, Fragment public var __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Human } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Human } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("firstName", String.self), diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/LocalCacheMutations/PetSearchLocalCacheMutation.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/LocalCacheMutations/PetSearchLocalCacheMutation.graphql.swift index f11ffcef5..afaa74a2e 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/LocalCacheMutations/PetSearchLocalCacheMutation.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/LocalCacheMutations/PetSearchLocalCacheMutation.graphql.swift @@ -29,7 +29,7 @@ public class PetSearchLocalCacheMutation: LocalCacheMutation { public var __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("pets", [Pet].self, arguments: ["filters": .variable("filters")]), ] } @@ -60,7 +60,7 @@ public class PetSearchLocalCacheMutation: LocalCacheMutation { public var __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Pet } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Pet } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("id", AnimalKingdomAPI.ID.self), diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Mutations/PetAdoptionMutation.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Mutations/PetAdoptionMutation.graphql.swift index 69295b24c..c564e5d50 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Mutations/PetAdoptionMutation.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Mutations/PetAdoptionMutation.graphql.swift @@ -22,7 +22,7 @@ public class PetAdoptionMutation: GraphQLMutation { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Mutation } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Mutation } public static var __selections: [ApolloAPI.Selection] { [ .field("adoptPet", AdoptPet.self, arguments: ["input": .variable("input")]), ] } @@ -50,7 +50,7 @@ public class PetAdoptionMutation: GraphQLMutation { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Pet } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Pet } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("id", AnimalKingdomAPI.ID.self), diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Queries/AllAnimalsIncludeSkipQuery.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Queries/AllAnimalsIncludeSkipQuery.graphql.swift index 4f843d711..232400d4a 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Queries/AllAnimalsIncludeSkipQuery.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Queries/AllAnimalsIncludeSkipQuery.graphql.swift @@ -43,7 +43,7 @@ public class AllAnimalsIncludeSkipQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("allAnimals", [AllAnimal].self), ] } @@ -71,7 +71,7 @@ public class AllAnimalsIncludeSkipQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("height", Height.self), @@ -131,7 +131,7 @@ public class AllAnimalsIncludeSkipQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("feet", Int.self), @@ -165,7 +165,7 @@ public class AllAnimalsIncludeSkipQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .include(if: "includeSpecies", .field("species", String.self)), @@ -199,7 +199,7 @@ public class AllAnimalsIncludeSkipQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsIncludeSkipQuery.Data.AllAnimal.Predator - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.WarmBlooded } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.WarmBlooded } public static var __selections: [ApolloAPI.Selection] { [ .field("species", String.self), .fragment(WarmBloodedDetails.self), @@ -255,7 +255,7 @@ public class AllAnimalsIncludeSkipQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsIncludeSkipQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } public static var __selections: [ApolloAPI.Selection] { [ .fragment(HeightInMeters.self), ] } @@ -302,7 +302,7 @@ public class AllAnimalsIncludeSkipQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } @@ -338,7 +338,7 @@ public class AllAnimalsIncludeSkipQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsIncludeSkipQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.WarmBlooded } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.WarmBlooded } public static var __selections: [ApolloAPI.Selection] { [ .fragment(WarmBloodedDetails.self), ] } @@ -390,7 +390,7 @@ public class AllAnimalsIncludeSkipQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } @@ -426,7 +426,7 @@ public class AllAnimalsIncludeSkipQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsIncludeSkipQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Pet } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Pet } public static var __selections: [ApolloAPI.Selection] { [ .field("height", Height.self), .inlineFragment(AsWarmBlooded.self), @@ -487,7 +487,7 @@ public class AllAnimalsIncludeSkipQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .include(if: "varA", [ @@ -533,7 +533,7 @@ public class AllAnimalsIncludeSkipQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsIncludeSkipQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.WarmBlooded } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.WarmBlooded } public static var __selections: [ApolloAPI.Selection] { [ .fragment(WarmBloodedDetails.self), ] } @@ -597,7 +597,7 @@ public class AllAnimalsIncludeSkipQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } @@ -643,7 +643,7 @@ public class AllAnimalsIncludeSkipQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsIncludeSkipQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Cat } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Cat } public static var __selections: [ApolloAPI.Selection] { [ .field("isJellicle", Bool.self), ] } @@ -710,7 +710,7 @@ public class AllAnimalsIncludeSkipQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } @@ -755,7 +755,7 @@ public class AllAnimalsIncludeSkipQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsIncludeSkipQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Unions.ClassroomPet } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Unions.ClassroomPet } public static var __selections: [ApolloAPI.Selection] { [ .inlineFragment(AsBird.self), ] } @@ -804,7 +804,7 @@ public class AllAnimalsIncludeSkipQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsIncludeSkipQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Bird } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Bird } public static var __selections: [ApolloAPI.Selection] { [ .field("wingspan", Double.self), ] } @@ -872,7 +872,7 @@ public class AllAnimalsIncludeSkipQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Queries/AllAnimalsQuery.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Queries/AllAnimalsQuery.graphql.swift index d8e80fbdc..e7ac702e6 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Queries/AllAnimalsQuery.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Queries/AllAnimalsQuery.graphql.swift @@ -17,7 +17,7 @@ public class AllAnimalsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("allAnimals", [AllAnimal].self), ] } @@ -45,7 +45,7 @@ public class AllAnimalsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("id", AnimalKingdomAPI.ID.self), @@ -110,7 +110,7 @@ public class AllAnimalsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("feet", Int.self), @@ -148,7 +148,7 @@ public class AllAnimalsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("species", String.self), @@ -182,7 +182,7 @@ public class AllAnimalsQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsQuery.Data.AllAnimal.Predator - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.WarmBlooded } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.WarmBlooded } public static var __selections: [ApolloAPI.Selection] { [ .field("predators", [Predator].self), .field("laysEggs", Bool.self), @@ -236,7 +236,7 @@ public class AllAnimalsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("species", String.self), @@ -272,7 +272,7 @@ public class AllAnimalsQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.WarmBlooded } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.WarmBlooded } public static var __selections: [ApolloAPI.Selection] { [ .fragment(WarmBloodedDetails.self), ] } @@ -327,7 +327,7 @@ public class AllAnimalsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } @@ -363,7 +363,7 @@ public class AllAnimalsQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Pet } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Pet } public static var __selections: [ApolloAPI.Selection] { [ .field("height", Height.self), .inlineFragment(AsWarmBlooded.self), @@ -427,7 +427,7 @@ public class AllAnimalsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("relativeSize", GraphQLEnum.self), @@ -475,7 +475,7 @@ public class AllAnimalsQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.WarmBlooded } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.WarmBlooded } public static var __selections: [ApolloAPI.Selection] { [ .fragment(WarmBloodedDetails.self), ] } @@ -542,7 +542,7 @@ public class AllAnimalsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } @@ -588,7 +588,7 @@ public class AllAnimalsQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Cat } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Cat } public static var __selections: [ApolloAPI.Selection] { [ .field("isJellicle", Bool.self), ] } @@ -659,7 +659,7 @@ public class AllAnimalsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } @@ -704,7 +704,7 @@ public class AllAnimalsQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Unions.ClassroomPet } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Unions.ClassroomPet } public static var __selections: [ApolloAPI.Selection] { [ .inlineFragment(AsBird.self), ] } @@ -756,7 +756,7 @@ public class AllAnimalsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } @@ -791,7 +791,7 @@ public class AllAnimalsQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Bird } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Bird } public static var __selections: [ApolloAPI.Selection] { [ .field("wingspan", Double.self), ] } @@ -863,7 +863,7 @@ public class AllAnimalsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } @@ -909,7 +909,7 @@ public class AllAnimalsQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Dog } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Dog } public static var __selections: [ApolloAPI.Selection] { [ .field("favoriteToy", String.self), .field("birthdate", AnimalKingdomAPI.CustomDate?.self), @@ -981,7 +981,7 @@ public class AllAnimalsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Queries/ClassroomPetsQuery.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Queries/ClassroomPetsQuery.graphql.swift index a3c5f1866..0c6872880 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Queries/ClassroomPetsQuery.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Queries/ClassroomPetsQuery.graphql.swift @@ -17,7 +17,7 @@ public class ClassroomPetsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("classroomPets", [ClassroomPet?]?.self), ] } @@ -45,7 +45,7 @@ public class ClassroomPetsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Unions.ClassroomPet } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Unions.ClassroomPet } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .fragment(ClassroomPetDetails.self), @@ -86,7 +86,7 @@ public class ClassroomPetsQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetsQuery.Data.ClassroomPet - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } public static var __mergedSources: [any ApolloAPI.SelectionSet.Type] { [ ClassroomPetsQuery.Data.ClassroomPet.self, ClassroomPetDetails.AsAnimal.self @@ -128,7 +128,7 @@ public class ClassroomPetsQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetsQuery.Data.ClassroomPet - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Pet } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Pet } public static var __mergedSources: [any ApolloAPI.SelectionSet.Type] { [ ClassroomPetsQuery.Data.ClassroomPet.self, ClassroomPetDetails.AsPet.self @@ -170,7 +170,7 @@ public class ClassroomPetsQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetsQuery.Data.ClassroomPet - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.WarmBlooded } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.WarmBlooded } public static var __mergedSources: [any ApolloAPI.SelectionSet.Type] { [ ClassroomPetsQuery.Data.ClassroomPet.self, ClassroomPetDetails.AsAnimal.self, @@ -217,7 +217,7 @@ public class ClassroomPetsQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetsQuery.Data.ClassroomPet - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Cat } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Cat } public static var __mergedSources: [any ApolloAPI.SelectionSet.Type] { [ ClassroomPetsQuery.Data.ClassroomPet.self, ClassroomPetDetails.AsAnimal.self, @@ -276,7 +276,7 @@ public class ClassroomPetsQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetsQuery.Data.ClassroomPet - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Bird } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Bird } public static var __mergedSources: [any ApolloAPI.SelectionSet.Type] { [ ClassroomPetsQuery.Data.ClassroomPet.self, ClassroomPetDetails.AsAnimal.self, @@ -332,7 +332,7 @@ public class ClassroomPetsQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetsQuery.Data.ClassroomPet - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.PetRock } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.PetRock } public static var __mergedSources: [any ApolloAPI.SelectionSet.Type] { [ ClassroomPetsQuery.Data.ClassroomPet.self, ClassroomPetDetails.AsPet.self, diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Queries/DogQuery.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Queries/DogQuery.graphql.swift index b9b15c1bb..7bd9f94b0 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Queries/DogQuery.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Queries/DogQuery.graphql.swift @@ -17,7 +17,7 @@ public class DogQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("allAnimals", [AllAnimal].self), ] } @@ -45,7 +45,7 @@ public class DogQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Animal } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("id", AnimalKingdomAPI.ID.self), @@ -83,7 +83,7 @@ public class DogQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = DogQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Dog } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Dog } public static var __selections: [ApolloAPI.Selection] { [ .field("houseDetails", AnimalKingdomAPI.Object?.self), .fragment(DogFragment.self), diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Queries/PetSearchQuery.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Queries/PetSearchQuery.graphql.swift index a0510adf2..0690f8caf 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Queries/PetSearchQuery.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Operations/Queries/PetSearchQuery.graphql.swift @@ -33,7 +33,7 @@ public class PetSearchQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("pets", [Pet].self, arguments: ["filters": .variable("filters")]), ] } @@ -61,7 +61,7 @@ public class PetSearchQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Pet } + public static var __parentType: any ApolloAPI.ParentType { AnimalKingdomAPI.Interfaces.Pet } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("id", AnimalKingdomAPI.ID.self), diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Schema/SchemaMetadata.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Schema/SchemaMetadata.graphql.swift index 08ef30bca..ef715bed9 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Schema/SchemaMetadata.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Schema/SchemaMetadata.graphql.swift @@ -16,7 +16,7 @@ public protocol MutableInlineFragment: ApolloAPI.MutableSelectionSet & ApolloAPI where Schema == AnimalKingdomAPI.SchemaMetadata {} public enum SchemaMetadata: ApolloAPI.SchemaMetadata { - public static let configuration: ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self + public static let configuration: any ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self public static func objectType(forTypename typename: String) -> ApolloAPI.Object? { switch typename { diff --git a/Sources/GitHubAPI/GitHubAPI/Sources/Fragments/AuthorDetails.graphql.swift b/Sources/GitHubAPI/GitHubAPI/Sources/Fragments/AuthorDetails.graphql.swift index 2fe4a02a3..4e14819c8 100644 --- a/Sources/GitHubAPI/GitHubAPI/Sources/Fragments/AuthorDetails.graphql.swift +++ b/Sources/GitHubAPI/GitHubAPI/Sources/Fragments/AuthorDetails.graphql.swift @@ -11,7 +11,7 @@ public struct AuthorDetails: GitHubAPI.SelectionSet, Fragment { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Interfaces.Actor } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Interfaces.Actor } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("login", String.self), @@ -31,7 +31,7 @@ public struct AuthorDetails: GitHubAPI.SelectionSet, Fragment { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AuthorDetails - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Objects.User } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Objects.User } public static var __selections: [ApolloAPI.Selection] { [ .field("id", GitHubAPI.ID.self), .field("name", String?.self), diff --git a/Sources/GitHubAPI/GitHubAPI/Sources/Operations/Queries/IssuesAndCommentsForRepositoryQuery.graphql.swift b/Sources/GitHubAPI/GitHubAPI/Sources/Operations/Queries/IssuesAndCommentsForRepositoryQuery.graphql.swift index 81e37f478..281d63552 100644 --- a/Sources/GitHubAPI/GitHubAPI/Sources/Operations/Queries/IssuesAndCommentsForRepositoryQuery.graphql.swift +++ b/Sources/GitHubAPI/GitHubAPI/Sources/Operations/Queries/IssuesAndCommentsForRepositoryQuery.graphql.swift @@ -17,7 +17,7 @@ public class IssuesAndCommentsForRepositoryQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("repository", Repository?.self, arguments: [ "name": "apollo-ios", @@ -35,7 +35,7 @@ public class IssuesAndCommentsForRepositoryQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Objects.Repository } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Objects.Repository } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), @@ -54,7 +54,7 @@ public class IssuesAndCommentsForRepositoryQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Objects.IssueConnection } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Objects.IssueConnection } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("nodes", [Node?]?.self), @@ -70,7 +70,7 @@ public class IssuesAndCommentsForRepositoryQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Objects.Issue } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Objects.Issue } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("title", String.self), @@ -95,7 +95,7 @@ public class IssuesAndCommentsForRepositoryQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Interfaces.Actor } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Interfaces.Actor } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .fragment(AuthorDetails.self), @@ -121,7 +121,7 @@ public class IssuesAndCommentsForRepositoryQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = IssuesAndCommentsForRepositoryQuery.Data.Repository.Issues.Node.Author - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Objects.User } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Objects.User } public static var __mergedSources: [any ApolloAPI.SelectionSet.Type] { [ IssuesAndCommentsForRepositoryQuery.Data.Repository.Issues.Node.Author.self, AuthorDetails.self, @@ -150,7 +150,7 @@ public class IssuesAndCommentsForRepositoryQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Objects.IssueCommentConnection } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Objects.IssueCommentConnection } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("nodes", [Node?]?.self), @@ -166,7 +166,7 @@ public class IssuesAndCommentsForRepositoryQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Objects.IssueComment } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Objects.IssueComment } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("body", String.self), @@ -185,7 +185,7 @@ public class IssuesAndCommentsForRepositoryQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Interfaces.Actor } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Interfaces.Actor } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .fragment(AuthorDetails.self), @@ -211,7 +211,7 @@ public class IssuesAndCommentsForRepositoryQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = IssuesAndCommentsForRepositoryQuery.Data.Repository.Issues.Node.Comments.Node.Author - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Objects.User } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Objects.User } public static var __mergedSources: [any ApolloAPI.SelectionSet.Type] { [ IssuesAndCommentsForRepositoryQuery.Data.Repository.Issues.Node.Comments.Node.Author.self, AuthorDetails.self, diff --git a/Sources/GitHubAPI/GitHubAPI/Sources/Operations/Queries/RepoURLQuery.graphql.swift b/Sources/GitHubAPI/GitHubAPI/Sources/Operations/Queries/RepoURLQuery.graphql.swift index 50276ec33..203c53534 100644 --- a/Sources/GitHubAPI/GitHubAPI/Sources/Operations/Queries/RepoURLQuery.graphql.swift +++ b/Sources/GitHubAPI/GitHubAPI/Sources/Operations/Queries/RepoURLQuery.graphql.swift @@ -16,7 +16,7 @@ public class RepoURLQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("repository", Repository?.self, arguments: [ "owner": "apollographql", @@ -34,7 +34,7 @@ public class RepoURLQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Objects.Repository } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Objects.Repository } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("url", GitHubAPI.URI.self), diff --git a/Sources/GitHubAPI/GitHubAPI/Sources/Operations/Queries/RepositoryQuery.graphql.swift b/Sources/GitHubAPI/GitHubAPI/Sources/Operations/Queries/RepositoryQuery.graphql.swift index 991e2fbae..a88a43dd5 100644 --- a/Sources/GitHubAPI/GitHubAPI/Sources/Operations/Queries/RepositoryQuery.graphql.swift +++ b/Sources/GitHubAPI/GitHubAPI/Sources/Operations/Queries/RepositoryQuery.graphql.swift @@ -16,7 +16,7 @@ public class RepositoryQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("repository", Repository?.self, arguments: [ "owner": "apollographql", @@ -34,7 +34,7 @@ public class RepositoryQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Objects.Repository } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Objects.Repository } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("issueOrPullRequest", IssueOrPullRequest?.self, arguments: ["number": 13]), @@ -50,7 +50,7 @@ public class RepositoryQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Unions.IssueOrPullRequest } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Unions.IssueOrPullRequest } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .inlineFragment(AsIssue.self), @@ -68,7 +68,7 @@ public class RepositoryQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = RepositoryQuery.Data.Repository.IssueOrPullRequest - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Objects.Issue } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Objects.Issue } public static var __selections: [ApolloAPI.Selection] { [ .field("body", String.self), .field("url", GitHubAPI.URI.self), @@ -91,7 +91,7 @@ public class RepositoryQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Interfaces.Actor } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Interfaces.Actor } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("avatarUrl", GitHubAPI.URI.self), @@ -112,7 +112,7 @@ public class RepositoryQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = RepositoryQuery.Data.Repository.IssueOrPullRequest - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Interfaces.Reactable } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Interfaces.Reactable } public static var __selections: [ApolloAPI.Selection] { [ .field("viewerCanReact", Bool.self), .inlineFragment(AsComment.self), @@ -131,7 +131,7 @@ public class RepositoryQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = RepositoryQuery.Data.Repository.IssueOrPullRequest - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Interfaces.Comment } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Interfaces.Comment } public static var __selections: [ApolloAPI.Selection] { [ .field("author", Author?.self), ] } @@ -148,7 +148,7 @@ public class RepositoryQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { GitHubAPI.Interfaces.Actor } + public static var __parentType: any ApolloAPI.ParentType { GitHubAPI.Interfaces.Actor } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("login", String.self), diff --git a/Sources/GitHubAPI/GitHubAPI/Sources/Schema/SchemaMetadata.graphql.swift b/Sources/GitHubAPI/GitHubAPI/Sources/Schema/SchemaMetadata.graphql.swift index 8647e7cb1..b120de54c 100644 --- a/Sources/GitHubAPI/GitHubAPI/Sources/Schema/SchemaMetadata.graphql.swift +++ b/Sources/GitHubAPI/GitHubAPI/Sources/Schema/SchemaMetadata.graphql.swift @@ -16,7 +16,7 @@ public protocol MutableInlineFragment: ApolloAPI.MutableSelectionSet & ApolloAPI where Schema == GitHubAPI.SchemaMetadata {} public enum SchemaMetadata: ApolloAPI.SchemaMetadata { - public static let configuration: ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self + public static let configuration: any ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self public static func objectType(forTypename typename: String) -> ApolloAPI.Object? { switch typename { diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterAppearsIn.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterAppearsIn.graphql.swift index ee29605e6..33ca07a12 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterAppearsIn.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterAppearsIn.graphql.swift @@ -11,7 +11,7 @@ public struct CharacterAppearsIn: StarWarsAPI.SelectionSet, Fragment { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("appearsIn", [GraphQLEnum?].self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterName.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterName.graphql.swift index 052f0d211..cca5e4f99 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterName.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterName.graphql.swift @@ -11,7 +11,7 @@ public struct CharacterName: StarWarsAPI.SelectionSet, Fragment { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameAndAppearsIn.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameAndAppearsIn.graphql.swift index e6c5549dd..662a61ffd 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameAndAppearsIn.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameAndAppearsIn.graphql.swift @@ -11,7 +11,7 @@ public struct CharacterNameAndAppearsIn: StarWarsAPI.SelectionSet, Fragment { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameAndAppearsInWithNestedFragments.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameAndAppearsInWithNestedFragments.graphql.swift index 85836c12d..6e166401c 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameAndAppearsInWithNestedFragments.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameAndAppearsInWithNestedFragments.graphql.swift @@ -11,7 +11,7 @@ public struct CharacterNameAndAppearsInWithNestedFragments: StarWarsAPI.Selectio public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .fragment(CharacterNameWithNestedAppearsInFragment.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameAndDroidAppearsIn.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameAndDroidAppearsIn.graphql.swift index b2626b5aa..358012f8d 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameAndDroidAppearsIn.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameAndDroidAppearsIn.graphql.swift @@ -11,7 +11,7 @@ public struct CharacterNameAndDroidAppearsIn: StarWarsAPI.SelectionSet, Fragment public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), @@ -46,7 +46,7 @@ public struct CharacterNameAndDroidAppearsIn: StarWarsAPI.SelectionSet, Fragment public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = CharacterNameAndDroidAppearsIn - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } public static var __selections: [ApolloAPI.Selection] { [ .field("appearsIn", [GraphQLEnum?].self), ] } diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameAndDroidPrimaryFunction.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameAndDroidPrimaryFunction.graphql.swift index f724c1ebf..fc6b1cf03 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameAndDroidPrimaryFunction.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameAndDroidPrimaryFunction.graphql.swift @@ -11,7 +11,7 @@ public struct CharacterNameAndDroidPrimaryFunction: StarWarsAPI.SelectionSet, Fr public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .inlineFragment(AsDroid.self), @@ -54,7 +54,7 @@ public struct CharacterNameAndDroidPrimaryFunction: StarWarsAPI.SelectionSet, Fr public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = CharacterNameAndDroidPrimaryFunction - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } public static var __selections: [ApolloAPI.Selection] { [ .fragment(DroidPrimaryFunction.self), ] } diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameWithInlineFragment.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameWithInlineFragment.graphql.swift index 1f102976c..c626d1389 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameWithInlineFragment.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameWithInlineFragment.graphql.swift @@ -11,7 +11,7 @@ public struct CharacterNameWithInlineFragment: StarWarsAPI.SelectionSet, Fragmen public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .inlineFragment(AsHuman.self), @@ -42,7 +42,7 @@ public struct CharacterNameWithInlineFragment: StarWarsAPI.SelectionSet, Fragmen public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = CharacterNameWithInlineFragment - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Human } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Human } public static var __selections: [ApolloAPI.Selection] { [ .field("friends", [Friend?]?.self), ] } @@ -72,7 +72,7 @@ public struct CharacterNameWithInlineFragment: StarWarsAPI.SelectionSet, Fragmen public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("appearsIn", [GraphQLEnum?].self), @@ -106,7 +106,7 @@ public struct CharacterNameWithInlineFragment: StarWarsAPI.SelectionSet, Fragmen public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = CharacterNameWithInlineFragment - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } public static var __selections: [ApolloAPI.Selection] { [ .fragment(CharacterName.self), .fragment(FriendsNames.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameWithNestedAppearsInFragment.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameWithNestedAppearsInFragment.graphql.swift index 3b4016e8a..2b7a4109a 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameWithNestedAppearsInFragment.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/CharacterNameWithNestedAppearsInFragment.graphql.swift @@ -11,7 +11,7 @@ public struct CharacterNameWithNestedAppearsInFragment: StarWarsAPI.SelectionSet public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/DroidDetails.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/DroidDetails.graphql.swift index 91a03fd88..63aca1287 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/DroidDetails.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/DroidDetails.graphql.swift @@ -11,7 +11,7 @@ public struct DroidDetails: StarWarsAPI.SelectionSet, Fragment { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/DroidName.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/DroidName.graphql.swift index 34511d245..366eaebe4 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/DroidName.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/DroidName.graphql.swift @@ -11,7 +11,7 @@ public struct DroidName: StarWarsAPI.SelectionSet, Fragment { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/DroidNameAndPrimaryFunction.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/DroidNameAndPrimaryFunction.graphql.swift index 66e901252..4ac32abaf 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/DroidNameAndPrimaryFunction.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/DroidNameAndPrimaryFunction.graphql.swift @@ -11,7 +11,7 @@ public struct DroidNameAndPrimaryFunction: StarWarsAPI.SelectionSet, Fragment { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .fragment(CharacterName.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/DroidPrimaryFunction.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/DroidPrimaryFunction.graphql.swift index d5b7b65df..5b6183e68 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/DroidPrimaryFunction.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/DroidPrimaryFunction.graphql.swift @@ -11,7 +11,7 @@ public struct DroidPrimaryFunction: StarWarsAPI.SelectionSet, Fragment { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("primaryFunction", String?.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/FriendsNames.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/FriendsNames.graphql.swift index d75b6d7e8..13c072daf 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/FriendsNames.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/FriendsNames.graphql.swift @@ -11,7 +11,7 @@ public struct FriendsNames: StarWarsAPI.SelectionSet, Fragment { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("friends", [Friend?]?.self), @@ -42,7 +42,7 @@ public struct FriendsNames: StarWarsAPI.SelectionSet, Fragment { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/HeroDetails.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/HeroDetails.graphql.swift index 5fbbe2f33..9ecb7f92a 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/HeroDetails.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/HeroDetails.graphql.swift @@ -11,7 +11,7 @@ public struct HeroDetails: StarWarsAPI.SelectionSet, Fragment { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), @@ -48,7 +48,7 @@ public struct HeroDetails: StarWarsAPI.SelectionSet, Fragment { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = HeroDetails - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Human } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Human } public static var __selections: [ApolloAPI.Selection] { [ .field("height", Double?.self), ] } @@ -84,7 +84,7 @@ public struct HeroDetails: StarWarsAPI.SelectionSet, Fragment { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = HeroDetails - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } public static var __selections: [ApolloAPI.Selection] { [ .field("primaryFunction", String?.self), ] } diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/HumanHeightWithVariable.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/HumanHeightWithVariable.graphql.swift index 8db8fb97c..512999329 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/HumanHeightWithVariable.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Fragments/HumanHeightWithVariable.graphql.swift @@ -11,7 +11,7 @@ public struct HumanHeightWithVariable: StarWarsAPI.SelectionSet, Fragment { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Human } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Human } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("height", Double?.self, arguments: ["unit": .variable("heightUnit")]), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Mutations/CreateAwesomeReviewMutation.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Mutations/CreateAwesomeReviewMutation.graphql.swift index 3d4c63942..c2e2a3d6c 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Mutations/CreateAwesomeReviewMutation.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Mutations/CreateAwesomeReviewMutation.graphql.swift @@ -17,7 +17,7 @@ public class CreateAwesomeReviewMutation: GraphQLMutation { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Mutation } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Mutation } public static var __selections: [ApolloAPI.Selection] { [ .field("createReview", CreateReview?.self, arguments: [ "episode": "JEDI", @@ -51,7 +51,7 @@ public class CreateAwesomeReviewMutation: GraphQLMutation { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Review } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Review } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("stars", Int.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Mutations/CreateReviewForEpisodeMutation.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Mutations/CreateReviewForEpisodeMutation.graphql.swift index 8b8b371eb..a72e25bca 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Mutations/CreateReviewForEpisodeMutation.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Mutations/CreateReviewForEpisodeMutation.graphql.swift @@ -31,7 +31,7 @@ public class CreateReviewForEpisodeMutation: GraphQLMutation { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Mutation } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Mutation } public static var __selections: [ApolloAPI.Selection] { [ .field("createReview", CreateReview?.self, arguments: [ "episode": .variable("episode"), @@ -62,7 +62,7 @@ public class CreateReviewForEpisodeMutation: GraphQLMutation { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Review } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Review } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("stars", Int.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Mutations/CreateReviewWithNullFieldMutation.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Mutations/CreateReviewWithNullFieldMutation.graphql.swift index 316dd036f..22bcd53ff 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Mutations/CreateReviewWithNullFieldMutation.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Mutations/CreateReviewWithNullFieldMutation.graphql.swift @@ -17,7 +17,7 @@ public class CreateReviewWithNullFieldMutation: GraphQLMutation { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Mutation } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Mutation } public static var __selections: [ApolloAPI.Selection] { [ .field("createReview", CreateReview?.self, arguments: [ "episode": "JEDI", @@ -51,7 +51,7 @@ public class CreateReviewWithNullFieldMutation: GraphQLMutation { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Review } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Review } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("stars", Int.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/DroidDetailsWithFragmentQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/DroidDetailsWithFragmentQuery.graphql.swift index 78e5a3416..709851f13 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/DroidDetailsWithFragmentQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/DroidDetailsWithFragmentQuery.graphql.swift @@ -24,7 +24,7 @@ public class DroidDetailsWithFragmentQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self, arguments: ["episode": .variable("episode")]), ] } @@ -52,7 +52,7 @@ public class DroidDetailsWithFragmentQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .inlineFragment(AsDroid.self), @@ -81,7 +81,7 @@ public class DroidDetailsWithFragmentQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = DroidDetailsWithFragmentQuery.Data.Hero - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } public static var __selections: [ApolloAPI.Selection] { [ .fragment(DroidDetails.self), ] } diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsIDsQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsIDsQuery.graphql.swift index 32f25cbf0..bc6e3f140 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsIDsQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsIDsQuery.graphql.swift @@ -23,7 +23,7 @@ public class HeroAndFriendsIDsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self, arguments: ["episode": .variable("episode")]), ] } @@ -51,7 +51,7 @@ public class HeroAndFriendsIDsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("id", StarWarsAPI.ID.self), @@ -92,7 +92,7 @@ public class HeroAndFriendsIDsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("id", StarWarsAPI.ID.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsNamesQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsNamesQuery.graphql.swift index 5b9df4b28..4cbdc39a1 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsNamesQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsNamesQuery.graphql.swift @@ -23,7 +23,7 @@ public class HeroAndFriendsNamesQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self, arguments: ["episode": .variable("episode")]), ] } @@ -51,7 +51,7 @@ public class HeroAndFriendsNamesQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), @@ -87,7 +87,7 @@ public class HeroAndFriendsNamesQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsNamesWithFragmentQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsNamesWithFragmentQuery.graphql.swift index 4b80179e4..6bf9f0635 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsNamesWithFragmentQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsNamesWithFragmentQuery.graphql.swift @@ -24,7 +24,7 @@ public class HeroAndFriendsNamesWithFragmentQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self, arguments: ["episode": .variable("episode")]), ] } @@ -52,7 +52,7 @@ public class HeroAndFriendsNamesWithFragmentQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsNamesWithFragmentTwiceQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsNamesWithFragmentTwiceQuery.graphql.swift index 294657191..aad20acf4 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsNamesWithFragmentTwiceQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsNamesWithFragmentTwiceQuery.graphql.swift @@ -24,7 +24,7 @@ public class HeroAndFriendsNamesWithFragmentTwiceQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self, arguments: ["episode": .variable("episode")]), ] } @@ -52,7 +52,7 @@ public class HeroAndFriendsNamesWithFragmentTwiceQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("friends", [Friend?]?.self), @@ -86,7 +86,7 @@ public class HeroAndFriendsNamesWithFragmentTwiceQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .fragment(CharacterName.self), @@ -127,7 +127,7 @@ public class HeroAndFriendsNamesWithFragmentTwiceQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = HeroAndFriendsNamesWithFragmentTwiceQuery.Data.Hero - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } public static var __selections: [ApolloAPI.Selection] { [ .field("friends", [Friend?]?.self), ] } @@ -157,7 +157,7 @@ public class HeroAndFriendsNamesWithFragmentTwiceQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .fragment(CharacterName.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsNamesWithIDForParentOnlyQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsNamesWithIDForParentOnlyQuery.graphql.swift index 1ab94f7ca..db28086fd 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsNamesWithIDForParentOnlyQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsNamesWithIDForParentOnlyQuery.graphql.swift @@ -23,7 +23,7 @@ public class HeroAndFriendsNamesWithIDForParentOnlyQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self, arguments: ["episode": .variable("episode")]), ] } @@ -51,7 +51,7 @@ public class HeroAndFriendsNamesWithIDForParentOnlyQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("id", StarWarsAPI.ID.self), @@ -92,7 +92,7 @@ public class HeroAndFriendsNamesWithIDForParentOnlyQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsNamesWithIDsQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsNamesWithIDsQuery.graphql.swift index e53401a39..8bae1877f 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsNamesWithIDsQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAndFriendsNamesWithIDsQuery.graphql.swift @@ -23,7 +23,7 @@ public class HeroAndFriendsNamesWithIDsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self, arguments: ["episode": .variable("episode")]), ] } @@ -51,7 +51,7 @@ public class HeroAndFriendsNamesWithIDsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("id", StarWarsAPI.ID.self), @@ -92,7 +92,7 @@ public class HeroAndFriendsNamesWithIDsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("id", StarWarsAPI.ID.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAppearsInQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAppearsInQuery.graphql.swift index 7c47cb649..225a0478c 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAppearsInQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAppearsInQuery.graphql.swift @@ -17,7 +17,7 @@ public class HeroAppearsInQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self), ] } @@ -45,7 +45,7 @@ public class HeroAppearsInQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("appearsIn", [GraphQLEnum?].self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAppearsInWithFragmentQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAppearsInWithFragmentQuery.graphql.swift index 3278f1e15..b0f0cca52 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAppearsInWithFragmentQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroAppearsInWithFragmentQuery.graphql.swift @@ -24,7 +24,7 @@ public class HeroAppearsInWithFragmentQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self, arguments: ["episode": .variable("episode")]), ] } @@ -52,7 +52,7 @@ public class HeroAppearsInWithFragmentQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .fragment(CharacterAppearsIn.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroDetailsFragmentConditionalInclusionQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroDetailsFragmentConditionalInclusionQuery.graphql.swift index f59c2ccfb..018ce7b03 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroDetailsFragmentConditionalInclusionQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroDetailsFragmentConditionalInclusionQuery.graphql.swift @@ -24,7 +24,7 @@ public class HeroDetailsFragmentConditionalInclusionQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self), ] } @@ -52,7 +52,7 @@ public class HeroDetailsFragmentConditionalInclusionQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .include(if: "includeDetails", .inlineFragment(IfIncludeDetails.self)), @@ -88,7 +88,7 @@ public class HeroDetailsFragmentConditionalInclusionQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = HeroDetailsFragmentConditionalInclusionQuery.Data.Hero - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .fragment(HeroDetails.self), ] } diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroDetailsInlineConditionalInclusionQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroDetailsInlineConditionalInclusionQuery.graphql.swift index 87d854d25..33005ecaf 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroDetailsInlineConditionalInclusionQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroDetailsInlineConditionalInclusionQuery.graphql.swift @@ -23,7 +23,7 @@ public class HeroDetailsInlineConditionalInclusionQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self), ] } @@ -51,7 +51,7 @@ public class HeroDetailsInlineConditionalInclusionQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .include(if: "includeDetails", .inlineFragment(IfIncludeDetails.self)), @@ -80,7 +80,7 @@ public class HeroDetailsInlineConditionalInclusionQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = HeroDetailsInlineConditionalInclusionQuery.Data.Hero - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("name", String.self), .field("appearsIn", [GraphQLEnum?].self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroDetailsQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroDetailsQuery.graphql.swift index c1430f37c..701ad9da9 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroDetailsQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroDetailsQuery.graphql.swift @@ -23,7 +23,7 @@ public class HeroDetailsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self, arguments: ["episode": .variable("episode")]), ] } @@ -51,7 +51,7 @@ public class HeroDetailsQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), @@ -88,7 +88,7 @@ public class HeroDetailsQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = HeroDetailsQuery.Data.Hero - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Human } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Human } public static var __selections: [ApolloAPI.Selection] { [ .field("height", Double?.self), ] } @@ -124,7 +124,7 @@ public class HeroDetailsQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = HeroDetailsQuery.Data.Hero - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } public static var __selections: [ApolloAPI.Selection] { [ .field("primaryFunction", String?.self), ] } diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroDetailsWithFragmentQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroDetailsWithFragmentQuery.graphql.swift index 5ead7c5e0..ec6c229a1 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroDetailsWithFragmentQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroDetailsWithFragmentQuery.graphql.swift @@ -24,7 +24,7 @@ public class HeroDetailsWithFragmentQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self, arguments: ["episode": .variable("episode")]), ] } @@ -52,7 +52,7 @@ public class HeroDetailsWithFragmentQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .fragment(HeroDetails.self), @@ -95,7 +95,7 @@ public class HeroDetailsWithFragmentQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = HeroDetailsWithFragmentQuery.Data.Hero - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Human } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Human } public static var __mergedSources: [any ApolloAPI.SelectionSet.Type] { [ HeroDetailsWithFragmentQuery.Data.Hero.self, HeroDetails.self, @@ -142,7 +142,7 @@ public class HeroDetailsWithFragmentQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = HeroDetailsWithFragmentQuery.Data.Hero - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } public static var __mergedSources: [any ApolloAPI.SelectionSet.Type] { [ HeroDetailsWithFragmentQuery.Data.Hero.self, HeroDetails.self, diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroFriendsDetailsConditionalInclusionQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroFriendsDetailsConditionalInclusionQuery.graphql.swift index 601f7a596..281e50e47 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroFriendsDetailsConditionalInclusionQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroFriendsDetailsConditionalInclusionQuery.graphql.swift @@ -23,7 +23,7 @@ public class HeroFriendsDetailsConditionalInclusionQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self), ] } @@ -51,7 +51,7 @@ public class HeroFriendsDetailsConditionalInclusionQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .include(if: "includeFriendsDetails", .field("friends", [Friend?]?.self)), @@ -82,7 +82,7 @@ public class HeroFriendsDetailsConditionalInclusionQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), @@ -117,7 +117,7 @@ public class HeroFriendsDetailsConditionalInclusionQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = HeroFriendsDetailsConditionalInclusionQuery.Data.Hero.Friend - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } public static var __selections: [ApolloAPI.Selection] { [ .field("primaryFunction", String?.self), ] } diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.graphql.swift index a40ce9fac..54cddca0b 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.graphql.swift @@ -23,7 +23,7 @@ public class HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery: GraphQ public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self), ] } @@ -51,7 +51,7 @@ public class HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery: GraphQ public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("friends", [Friend?]?.self), @@ -82,7 +82,7 @@ public class HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery: GraphQ public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), @@ -118,7 +118,7 @@ public class HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery: GraphQ public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("name", String.self), .inlineFragment(AsDroid.self), @@ -153,7 +153,7 @@ public class HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery: GraphQ public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } public static var __selections: [ApolloAPI.Selection] { [ .field("primaryFunction", String?.self), ] } @@ -190,7 +190,7 @@ public class HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery: GraphQ public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } public static var __mergedSources: [any ApolloAPI.SelectionSet.Type] { [ HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend.self, HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend.AsDroid.self diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroFriendsOfFriendsNamesQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroFriendsOfFriendsNamesQuery.graphql.swift index 7dcba96e6..caa245e01 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroFriendsOfFriendsNamesQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroFriendsOfFriendsNamesQuery.graphql.swift @@ -23,7 +23,7 @@ public class HeroFriendsOfFriendsNamesQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self, arguments: ["episode": .variable("episode")]), ] } @@ -51,7 +51,7 @@ public class HeroFriendsOfFriendsNamesQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("friends", [Friend?]?.self), @@ -82,7 +82,7 @@ public class HeroFriendsOfFriendsNamesQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("id", StarWarsAPI.ID.self), @@ -118,7 +118,7 @@ public class HeroFriendsOfFriendsNamesQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameAndAppearsInQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameAndAppearsInQuery.graphql.swift index 02c928b70..f97b7f0be 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameAndAppearsInQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameAndAppearsInQuery.graphql.swift @@ -23,7 +23,7 @@ public class HeroNameAndAppearsInQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self, arguments: ["episode": .variable("episode")]), ] } @@ -51,7 +51,7 @@ public class HeroNameAndAppearsInQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameAndAppearsInWithFragmentQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameAndAppearsInWithFragmentQuery.graphql.swift index 0bc73f215..8b514a607 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameAndAppearsInWithFragmentQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameAndAppearsInWithFragmentQuery.graphql.swift @@ -24,7 +24,7 @@ public class HeroNameAndAppearsInWithFragmentQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self, arguments: ["episode": .variable("episode")]), ] } @@ -52,7 +52,7 @@ public class HeroNameAndAppearsInWithFragmentQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .fragment(CharacterNameAndAppearsIn.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameConditionalBothQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameConditionalBothQuery.graphql.swift index daaa7685e..5aafe80e9 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameConditionalBothQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameConditionalBothQuery.graphql.swift @@ -31,7 +31,7 @@ public class HeroNameConditionalBothQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self), ] } @@ -59,7 +59,7 @@ public class HeroNameConditionalBothQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .include(if: !"skipName" && "includeName", .field("name", String.self)), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameConditionalBothSeparateQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameConditionalBothSeparateQuery.graphql.swift index 3f9c31a6f..51bdc7680 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameConditionalBothSeparateQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameConditionalBothSeparateQuery.graphql.swift @@ -31,7 +31,7 @@ public class HeroNameConditionalBothSeparateQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self), ] } @@ -59,7 +59,7 @@ public class HeroNameConditionalBothSeparateQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .include(if: !"skipName" || "includeName", .field("name", String.self)), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameConditionalExclusionQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameConditionalExclusionQuery.graphql.swift index 4387136fb..b7228464c 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameConditionalExclusionQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameConditionalExclusionQuery.graphql.swift @@ -23,7 +23,7 @@ public class HeroNameConditionalExclusionQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self), ] } @@ -51,7 +51,7 @@ public class HeroNameConditionalExclusionQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .include(if: !"skipName", .field("name", String.self)), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameConditionalInclusionQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameConditionalInclusionQuery.graphql.swift index 8cf4865ef..d95f8c564 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameConditionalInclusionQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameConditionalInclusionQuery.graphql.swift @@ -23,7 +23,7 @@ public class HeroNameConditionalInclusionQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self), ] } @@ -51,7 +51,7 @@ public class HeroNameConditionalInclusionQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .include(if: "includeName", .field("name", String.self)), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameQuery.graphql.swift index 20d4d99b9..cb6f488f1 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameQuery.graphql.swift @@ -23,7 +23,7 @@ public class HeroNameQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self, arguments: ["episode": .variable("episode")]), ] } @@ -51,7 +51,7 @@ public class HeroNameQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameTypeSpecificConditionalInclusionQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameTypeSpecificConditionalInclusionQuery.graphql.swift index 653119d0b..2d19640a5 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameTypeSpecificConditionalInclusionQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameTypeSpecificConditionalInclusionQuery.graphql.swift @@ -31,7 +31,7 @@ public class HeroNameTypeSpecificConditionalInclusionQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self, arguments: ["episode": .variable("episode")]), ] } @@ -59,7 +59,7 @@ public class HeroNameTypeSpecificConditionalInclusionQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .inlineFragment(AsDroid.self), @@ -94,7 +94,7 @@ public class HeroNameTypeSpecificConditionalInclusionQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = HeroNameTypeSpecificConditionalInclusionQuery.Data.Hero - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } public static var __selections: [ApolloAPI.Selection] { [ .field("name", String.self), ] } diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameWithFragmentAndIDQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameWithFragmentAndIDQuery.graphql.swift index c7f39bc18..48c6b7a81 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameWithFragmentAndIDQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameWithFragmentAndIDQuery.graphql.swift @@ -24,7 +24,7 @@ public class HeroNameWithFragmentAndIDQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self, arguments: ["episode": .variable("episode")]), ] } @@ -52,7 +52,7 @@ public class HeroNameWithFragmentAndIDQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("id", StarWarsAPI.ID.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameWithFragmentQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameWithFragmentQuery.graphql.swift index 1024aced9..8b75a2307 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameWithFragmentQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameWithFragmentQuery.graphql.swift @@ -24,7 +24,7 @@ public class HeroNameWithFragmentQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self, arguments: ["episode": .variable("episode")]), ] } @@ -52,7 +52,7 @@ public class HeroNameWithFragmentQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .fragment(CharacterName.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameWithIDQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameWithIDQuery.graphql.swift index 72c548446..05158d570 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameWithIDQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroNameWithIDQuery.graphql.swift @@ -23,7 +23,7 @@ public class HeroNameWithIDQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self, arguments: ["episode": .variable("episode")]), ] } @@ -51,7 +51,7 @@ public class HeroNameWithIDQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("id", StarWarsAPI.ID.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroParentTypeDependentFieldQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroParentTypeDependentFieldQuery.graphql.swift index 6448abf12..3b9f14a60 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroParentTypeDependentFieldQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroParentTypeDependentFieldQuery.graphql.swift @@ -23,7 +23,7 @@ public class HeroParentTypeDependentFieldQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self, arguments: ["episode": .variable("episode")]), ] } @@ -51,7 +51,7 @@ public class HeroParentTypeDependentFieldQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), @@ -88,7 +88,7 @@ public class HeroParentTypeDependentFieldQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = HeroParentTypeDependentFieldQuery.Data.Hero - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Human } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Human } public static var __selections: [ApolloAPI.Selection] { [ .field("friends", [Friend?]?.self), ] } @@ -122,7 +122,7 @@ public class HeroParentTypeDependentFieldQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), @@ -157,7 +157,7 @@ public class HeroParentTypeDependentFieldQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = HeroParentTypeDependentFieldQuery.Data.Hero.AsHuman.Friend - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Human } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Human } public static var __selections: [ApolloAPI.Selection] { [ .field("height", Double?.self, arguments: ["unit": "FOOT"]), ] } @@ -195,7 +195,7 @@ public class HeroParentTypeDependentFieldQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = HeroParentTypeDependentFieldQuery.Data.Hero - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } public static var __selections: [ApolloAPI.Selection] { [ .field("friends", [Friend?]?.self), ] } @@ -229,7 +229,7 @@ public class HeroParentTypeDependentFieldQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), @@ -264,7 +264,7 @@ public class HeroParentTypeDependentFieldQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = HeroParentTypeDependentFieldQuery.Data.Hero.AsDroid.Friend - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Human } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Human } public static var __selections: [ApolloAPI.Selection] { [ .field("height", Double?.self, arguments: ["unit": "METER"]), ] } diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroTypeDependentAliasedFieldQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroTypeDependentAliasedFieldQuery.graphql.swift index 4a6d4dbbb..906acf4ce 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroTypeDependentAliasedFieldQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroTypeDependentAliasedFieldQuery.graphql.swift @@ -23,7 +23,7 @@ public class HeroTypeDependentAliasedFieldQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self, arguments: ["episode": .variable("episode")]), ] } @@ -51,7 +51,7 @@ public class HeroTypeDependentAliasedFieldQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .inlineFragment(AsHuman.self), @@ -82,7 +82,7 @@ public class HeroTypeDependentAliasedFieldQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = HeroTypeDependentAliasedFieldQuery.Data.Hero - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Human } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Human } public static var __selections: [ApolloAPI.Selection] { [ .field("homePlanet", alias: "property", String?.self), ] } @@ -114,7 +114,7 @@ public class HeroTypeDependentAliasedFieldQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = HeroTypeDependentAliasedFieldQuery.Data.Hero - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } public static var __selections: [ApolloAPI.Selection] { [ .field("primaryFunction", alias: "property", String?.self), ] } diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HumanQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HumanQuery.graphql.swift index b9096e4d5..f10a16f59 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HumanQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HumanQuery.graphql.swift @@ -23,7 +23,7 @@ public class HumanQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("human", Human?.self, arguments: ["id": .variable("id")]), ] } @@ -51,7 +51,7 @@ public class HumanQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Human } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Human } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/SameHeroTwiceQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/SameHeroTwiceQuery.graphql.swift index 78d9bce64..d97406905 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/SameHeroTwiceQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/SameHeroTwiceQuery.graphql.swift @@ -17,7 +17,7 @@ public class SameHeroTwiceQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", Hero?.self), .field("hero", alias: "r2", R2?.self), @@ -49,7 +49,7 @@ public class SameHeroTwiceQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), @@ -81,7 +81,7 @@ public class SameHeroTwiceQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("appearsIn", [GraphQLEnum?].self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/SearchQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/SearchQuery.graphql.swift index 610575f59..560ea85ca 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/SearchQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/SearchQuery.graphql.swift @@ -23,7 +23,7 @@ public class SearchQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("search", [Search?]?.self, arguments: ["text": .variable("term")]), ] } @@ -51,7 +51,7 @@ public class SearchQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Unions.SearchResult } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Unions.SearchResult } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .inlineFragment(AsHuman.self), @@ -84,7 +84,7 @@ public class SearchQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = SearchQuery.Data.Search - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Human } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Human } public static var __selections: [ApolloAPI.Selection] { [ .field("id", StarWarsAPI.ID.self), .field("name", String.self), @@ -121,7 +121,7 @@ public class SearchQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = SearchQuery.Data.Search - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } public static var __selections: [ApolloAPI.Selection] { [ .field("id", StarWarsAPI.ID.self), .field("name", String.self), @@ -158,7 +158,7 @@ public class SearchQuery: GraphQLQuery { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = SearchQuery.Data.Search - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Starship } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Starship } public static var __selections: [ApolloAPI.Selection] { [ .field("id", StarWarsAPI.ID.self), .field("name", String.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/StarshipCoordinatesQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/StarshipCoordinatesQuery.graphql.swift index 10b020aff..14035ac93 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/StarshipCoordinatesQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/StarshipCoordinatesQuery.graphql.swift @@ -23,7 +23,7 @@ public class StarshipCoordinatesQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("starshipCoordinates", StarshipCoordinates?.self, arguments: ["coordinates": .variable("coordinates")]), ] } @@ -51,7 +51,7 @@ public class StarshipCoordinatesQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Starship } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Starship } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/StarshipQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/StarshipQuery.graphql.swift index 82730cd59..3e7cc9d3d 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/StarshipQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/StarshipQuery.graphql.swift @@ -17,7 +17,7 @@ public class StarshipQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("starship", Starship?.self, arguments: ["id": 3000]), ] } @@ -45,7 +45,7 @@ public class StarshipQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Starship } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Starship } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/TwoHeroesQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/TwoHeroesQuery.graphql.swift index 9392b82df..53a5237ee 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/TwoHeroesQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/TwoHeroesQuery.graphql.swift @@ -17,7 +17,7 @@ public class TwoHeroesQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("hero", alias: "r2", R2?.self), .field("hero", alias: "luke", Luke?.self, arguments: ["episode": "EMPIRE"]), @@ -49,7 +49,7 @@ public class TwoHeroesQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), @@ -81,7 +81,7 @@ public class TwoHeroesQuery: GraphQLQuery { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("name", String.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Subscriptions/ReviewAddedSubscription.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Subscriptions/ReviewAddedSubscription.graphql.swift index 3b1945974..975858b1e 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Subscriptions/ReviewAddedSubscription.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Subscriptions/ReviewAddedSubscription.graphql.swift @@ -23,7 +23,7 @@ public class ReviewAddedSubscription: GraphQLSubscription { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Subscription } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Subscription } public static var __selections: [ApolloAPI.Selection] { [ .field("reviewAdded", ReviewAdded?.self, arguments: ["episode": .variable("episode")]), ] } @@ -51,7 +51,7 @@ public class ReviewAddedSubscription: GraphQLSubscription { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Review } + public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Review } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("episode", GraphQLEnum?.self), diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Schema/SchemaMetadata.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Schema/SchemaMetadata.graphql.swift index ea0e0a555..bbccc342e 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Schema/SchemaMetadata.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Schema/SchemaMetadata.graphql.swift @@ -16,7 +16,7 @@ public protocol MutableInlineFragment: ApolloAPI.MutableSelectionSet & ApolloAPI where Schema == StarWarsAPI.SchemaMetadata {} public enum SchemaMetadata: ApolloAPI.SchemaMetadata { - public static let configuration: ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self + public static let configuration: any ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self public static func objectType(forTypename typename: String) -> ApolloAPI.Object? { switch typename { diff --git a/Sources/SubscriptionAPI/SubscriptionAPI/Sources/Operations/Subscriptions/IncrementingSubscription.graphql.swift b/Sources/SubscriptionAPI/SubscriptionAPI/Sources/Operations/Subscriptions/IncrementingSubscription.graphql.swift index 1a899ede6..2317e6783 100644 --- a/Sources/SubscriptionAPI/SubscriptionAPI/Sources/Operations/Subscriptions/IncrementingSubscription.graphql.swift +++ b/Sources/SubscriptionAPI/SubscriptionAPI/Sources/Operations/Subscriptions/IncrementingSubscription.graphql.swift @@ -16,7 +16,7 @@ public class IncrementingSubscription: GraphQLSubscription { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { SubscriptionAPI.Objects.Subscription } + public static var __parentType: any ApolloAPI.ParentType { SubscriptionAPI.Objects.Subscription } public static var __selections: [ApolloAPI.Selection] { [ .field("numberIncremented", Int?.self), ] } diff --git a/Sources/SubscriptionAPI/SubscriptionAPI/Sources/Schema/SchemaMetadata.graphql.swift b/Sources/SubscriptionAPI/SubscriptionAPI/Sources/Schema/SchemaMetadata.graphql.swift index 2d0d6463f..4d8d20d21 100644 --- a/Sources/SubscriptionAPI/SubscriptionAPI/Sources/Schema/SchemaMetadata.graphql.swift +++ b/Sources/SubscriptionAPI/SubscriptionAPI/Sources/Schema/SchemaMetadata.graphql.swift @@ -16,7 +16,7 @@ public protocol MutableInlineFragment: ApolloAPI.MutableSelectionSet & ApolloAPI where Schema == SubscriptionAPI.SchemaMetadata {} public enum SchemaMetadata: ApolloAPI.SchemaMetadata { - public static let configuration: ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self + public static let configuration: any ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self public static func objectType(forTypename typename: String) -> ApolloAPI.Object? { switch typename { diff --git a/Sources/UploadAPI/UploadAPI/Sources/Operations/Mutations/UploadMultipleFilesToDifferentParametersMutation.graphql.swift b/Sources/UploadAPI/UploadAPI/Sources/Operations/Mutations/UploadMultipleFilesToDifferentParametersMutation.graphql.swift index 9df31f640..a40c90c8d 100644 --- a/Sources/UploadAPI/UploadAPI/Sources/Operations/Mutations/UploadMultipleFilesToDifferentParametersMutation.graphql.swift +++ b/Sources/UploadAPI/UploadAPI/Sources/Operations/Mutations/UploadMultipleFilesToDifferentParametersMutation.graphql.swift @@ -30,7 +30,7 @@ public class UploadMultipleFilesToDifferentParametersMutation: GraphQLMutation { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { UploadAPI.Objects.Mutation } + public static var __parentType: any ApolloAPI.ParentType { UploadAPI.Objects.Mutation } public static var __selections: [ApolloAPI.Selection] { [ .field("multipleParameterUpload", [MultipleParameterUpload].self, arguments: [ "singleFile": .variable("singleFile"), @@ -47,7 +47,7 @@ public class UploadMultipleFilesToDifferentParametersMutation: GraphQLMutation { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { UploadAPI.Objects.File } + public static var __parentType: any ApolloAPI.ParentType { UploadAPI.Objects.File } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("id", UploadAPI.ID.self), diff --git a/Sources/UploadAPI/UploadAPI/Sources/Operations/Mutations/UploadMultipleFilesToTheSameParameterMutation.graphql.swift b/Sources/UploadAPI/UploadAPI/Sources/Operations/Mutations/UploadMultipleFilesToTheSameParameterMutation.graphql.swift index 13f29b501..9d15578d1 100644 --- a/Sources/UploadAPI/UploadAPI/Sources/Operations/Mutations/UploadMultipleFilesToTheSameParameterMutation.graphql.swift +++ b/Sources/UploadAPI/UploadAPI/Sources/Operations/Mutations/UploadMultipleFilesToTheSameParameterMutation.graphql.swift @@ -22,7 +22,7 @@ public class UploadMultipleFilesToTheSameParameterMutation: GraphQLMutation { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { UploadAPI.Objects.Mutation } + public static var __parentType: any ApolloAPI.ParentType { UploadAPI.Objects.Mutation } public static var __selections: [ApolloAPI.Selection] { [ .field("multipleUpload", [MultipleUpload].self, arguments: ["files": .variable("files")]), ] } @@ -36,7 +36,7 @@ public class UploadMultipleFilesToTheSameParameterMutation: GraphQLMutation { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { UploadAPI.Objects.File } + public static var __parentType: any ApolloAPI.ParentType { UploadAPI.Objects.File } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("id", UploadAPI.ID.self), diff --git a/Sources/UploadAPI/UploadAPI/Sources/Operations/Mutations/UploadOneFileMutation.graphql.swift b/Sources/UploadAPI/UploadAPI/Sources/Operations/Mutations/UploadOneFileMutation.graphql.swift index 6442fa8c2..36ab4e948 100644 --- a/Sources/UploadAPI/UploadAPI/Sources/Operations/Mutations/UploadOneFileMutation.graphql.swift +++ b/Sources/UploadAPI/UploadAPI/Sources/Operations/Mutations/UploadOneFileMutation.graphql.swift @@ -22,7 +22,7 @@ public class UploadOneFileMutation: GraphQLMutation { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { UploadAPI.Objects.Mutation } + public static var __parentType: any ApolloAPI.ParentType { UploadAPI.Objects.Mutation } public static var __selections: [ApolloAPI.Selection] { [ .field("singleUpload", SingleUpload.self, arguments: ["file": .variable("file")]), ] } @@ -36,7 +36,7 @@ public class UploadOneFileMutation: GraphQLMutation { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { UploadAPI.Objects.File } + public static var __parentType: any ApolloAPI.ParentType { UploadAPI.Objects.File } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("id", UploadAPI.ID.self), diff --git a/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaMetadata.graphql.swift b/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaMetadata.graphql.swift index 2a579781f..90bbb308e 100644 --- a/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaMetadata.graphql.swift +++ b/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaMetadata.graphql.swift @@ -16,7 +16,7 @@ public protocol MutableInlineFragment: ApolloAPI.MutableSelectionSet & ApolloAPI where Schema == UploadAPI.SchemaMetadata {} public enum SchemaMetadata: ApolloAPI.SchemaMetadata { - public static let configuration: ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self + public static let configuration: any ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self public static func objectType(forTypename typename: String) -> ApolloAPI.Object? { switch typename { diff --git a/Tests/ApolloCodegenInternalTestHelpers/IRTestWrapper.swift b/Tests/ApolloCodegenInternalTestHelpers/IRTestWrapper.swift index 7ac1f2bee..e07793432 100644 --- a/Tests/ApolloCodegenInternalTestHelpers/IRTestWrapper.swift +++ b/Tests/ApolloCodegenInternalTestHelpers/IRTestWrapper.swift @@ -40,7 +40,7 @@ public class IRTestWrapper: CustomDebugStringCo fileprivate func childSelectionSet( with conditions: IR.ScopeCondition ) -> SelectionSetTestWrapper? { - guard let irObject = irObject as? ScopedChildSelectionSetAccessible else { + guard let irObject = irObject as? (any ScopedChildSelectionSetAccessible) else { return nil } diff --git a/Tests/ApolloCodegenInternalTestHelpers/MockFileGenerator.swift b/Tests/ApolloCodegenInternalTestHelpers/MockFileGenerator.swift index d30bd3be5..100fd705f 100644 --- a/Tests/ApolloCodegenInternalTestHelpers/MockFileGenerator.swift +++ b/Tests/ApolloCodegenInternalTestHelpers/MockFileGenerator.swift @@ -2,13 +2,13 @@ import Foundation @testable import ApolloCodegenLib public struct MockFileGenerator: FileGenerator { - public var template: TemplateRenderer + public var template: any TemplateRenderer public var target: FileTarget public var fileName: String public var fileExtension: String public static func mock( - template: TemplateRenderer, + template: any TemplateRenderer, target: FileTarget, filename: String, extension: String = "graphql.swift" diff --git a/Tests/ApolloCodegenInternalTestHelpers/MockNetworkSession.swift b/Tests/ApolloCodegenInternalTestHelpers/MockNetworkSession.swift index 1d0a7b300..6308437cb 100644 --- a/Tests/ApolloCodegenInternalTestHelpers/MockNetworkSession.swift +++ b/Tests/ApolloCodegenInternalTestHelpers/MockNetworkSession.swift @@ -4,17 +4,17 @@ import Foundation public final class MockNetworkSession: NetworkSession { let statusCode: Int let data: Data? - let error: Error? + let error: (any Error)? let abandon: Bool - public init(statusCode: Int, data: Data? = nil, error: Error? = nil, abandon: Bool = false) { + public init(statusCode: Int, data: Data? = nil, error: (any Error)? = nil, abandon: Bool = false) { self.statusCode = statusCode self.data = data self.error = error self.abandon = abandon } - public func loadData(with urlRequest: URLRequest, completionHandler: @escaping (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask? { + public func loadData(with urlRequest: URLRequest, completionHandler: @escaping (Data?, URLResponse?, (any Error)?) -> Void) -> URLSessionDataTask? { guard !abandon else { return nil } let response = HTTPURLResponse(url: urlRequest.url!, statusCode: statusCode, httpVersion: nil, headerFields: nil) diff --git a/Tests/ApolloCodegenTests/CodeGeneration/Templates/CustomScalarTemplateTests.swift b/Tests/ApolloCodegenTests/CodeGeneration/Templates/CustomScalarTemplateTests.swift index 07ca04ef3..4cbe9a6e3 100644 --- a/Tests/ApolloCodegenTests/CodeGeneration/Templates/CustomScalarTemplateTests.swift +++ b/Tests/ApolloCodegenTests/CodeGeneration/Templates/CustomScalarTemplateTests.swift @@ -7,7 +7,7 @@ import GraphQLCompiler class CustomScalarTemplateTests: XCTestCase { // Since the base protocol is actually used, Use TemplateRenderer. This can be confirmed that no unintended implementation is using. - var subject: TemplateRenderer! + var subject: (any TemplateRenderer)! // MARK: Helpers diff --git a/Tests/ApolloCodegenTests/CodeGeneration/Templates/FragmentTemplateTests.swift b/Tests/ApolloCodegenTests/CodeGeneration/Templates/FragmentTemplateTests.swift index 72cbef648..62c333071 100644 --- a/Tests/ApolloCodegenTests/CodeGeneration/Templates/FragmentTemplateTests.swift +++ b/Tests/ApolloCodegenTests/CodeGeneration/Templates/FragmentTemplateTests.swift @@ -208,7 +208,7 @@ class FragmentTemplateTests: XCTestCase { """ let expected = """ - static var __parentType: ApolloAPI.ParentType { TestSchema.Objects.Animal } + static var __parentType: any ApolloAPI.ParentType { TestSchema.Objects.Animal } """ // when @@ -238,7 +238,7 @@ class FragmentTemplateTests: XCTestCase { """ let expected = """ - static var __parentType: ApolloAPI.ParentType { TestSchema.Interfaces.Animal } + static var __parentType: any ApolloAPI.ParentType { TestSchema.Interfaces.Animal } """ // when @@ -272,7 +272,7 @@ class FragmentTemplateTests: XCTestCase { """ let expected = """ - static var __parentType: ApolloAPI.ParentType { TestSchema.Unions.Animal } + static var __parentType: any ApolloAPI.ParentType { TestSchema.Unions.Animal } """ // when @@ -302,7 +302,7 @@ class FragmentTemplateTests: XCTestCase { let __data: DataDict init(_dataDict: DataDict) { __data = _dataDict } - static var __parentType: ApolloAPI.ParentType { TestSchema.Objects.Query } + static var __parentType: any ApolloAPI.ParentType { TestSchema.Objects.Query } } """ @@ -333,7 +333,7 @@ class FragmentTemplateTests: XCTestCase { let __data: DataDict init(_dataDict: DataDict) { __data = _dataDict } - static var __parentType: ApolloAPI.ParentType { TestSchema.Objects.Animal } + static var __parentType: any ApolloAPI.ParentType { TestSchema.Objects.Animal } static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), ] } @@ -690,7 +690,7 @@ class FragmentTemplateTests: XCTestCase { var __data: DataDict init(_dataDict: DataDict) { __data = _dataDict } - static var __parentType: ApolloAPI.ParentType { TestSchema.Objects.Query } + static var __parentType: any ApolloAPI.ParentType { TestSchema.Objects.Query } static var __selections: [ApolloAPI.Selection] { [ .field("allAnimals", [AllAnimal]?.self), ] } diff --git a/Tests/ApolloCodegenTests/CodeGeneration/Templates/MockObjectTemplateTests.swift b/Tests/ApolloCodegenTests/CodeGeneration/Templates/MockObjectTemplateTests.swift index a25357753..206061ae7 100644 --- a/Tests/ApolloCodegenTests/CodeGeneration/Templates/MockObjectTemplateTests.swift +++ b/Tests/ApolloCodegenTests/CodeGeneration/Templates/MockObjectTemplateTests.swift @@ -485,10 +485,10 @@ class MockObjectTemplateTests: XCTestCase { enumList: [GraphQLEnum]? = nil, enumOptionalList: [GraphQLEnum]? = nil, enumType: GraphQLEnum? = nil, - interface: AnyMock? = nil, - interfaceList: [AnyMock]? = nil, - interfaceNestedList: [[AnyMock]]? = nil, - interfaceOptionalList: [AnyMock?]? = nil, + interface: (any AnyMock)? = nil, + interfaceList: [(any AnyMock)]? = nil, + interfaceNestedList: [[(any AnyMock)]]? = nil, + interfaceOptionalList: [(any AnyMock)?]? = nil, object: Mock? = nil, objectList: [Mock]? = nil, objectNestedList: [[Mock]]? = nil, @@ -498,10 +498,10 @@ class MockObjectTemplateTests: XCTestCase { stringList: [String]? = nil, stringNestedList: [[String]]? = nil, stringOptionalList: [String]? = nil, - union: AnyMock? = nil, - unionList: [AnyMock]? = nil, - unionNestedList: [[AnyMock]]? = nil, - unionOptionalList: [AnyMock?]? = nil + union: (any AnyMock)? = nil, + unionList: [(any AnyMock)]? = nil, + unionNestedList: [[(any AnyMock)]]? = nil, + unionOptionalList: [(any AnyMock)?]? = nil ) { self.init() _setScalar(customScalar, for: \\.customScalar) diff --git a/Tests/ApolloCodegenTests/CodeGeneration/Templates/OperationDefinitionTemplateTests.swift b/Tests/ApolloCodegenTests/CodeGeneration/Templates/OperationDefinitionTemplateTests.swift index 75fdec1a3..daa8f320f 100644 --- a/Tests/ApolloCodegenTests/CodeGeneration/Templates/OperationDefinitionTemplateTests.swift +++ b/Tests/ApolloCodegenTests/CodeGeneration/Templates/OperationDefinitionTemplateTests.swift @@ -461,7 +461,7 @@ class OperationDefinitionTemplateTests: XCTestCase { let __data: DataDict init(_dataDict: DataDict) { __data = _dataDict } - static var __parentType: ApolloAPI.ParentType { TestSchema.Objects.Query } + static var __parentType: any ApolloAPI.ParentType { TestSchema.Objects.Query } """ // when diff --git a/Tests/ApolloCodegenTests/CodeGeneration/Templates/SchemaMetadataTemplateTests.swift b/Tests/ApolloCodegenTests/CodeGeneration/Templates/SchemaMetadataTemplateTests.swift index 09c9aa470..34f09a246 100644 --- a/Tests/ApolloCodegenTests/CodeGeneration/Templates/SchemaMetadataTemplateTests.swift +++ b/Tests/ApolloCodegenTests/CodeGeneration/Templates/SchemaMetadataTemplateTests.swift @@ -238,7 +238,7 @@ class SchemaMetadataTemplateTests: XCTestCase { let expected = """ enum SchemaMetadata: ApolloAPI.SchemaMetadata { - static let configuration: ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self + static let configuration: any ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self """ // when @@ -254,7 +254,7 @@ class SchemaMetadataTemplateTests: XCTestCase { let expected = """ enum SchemaMetadata: ApolloAPI.SchemaMetadata { - public static let configuration: ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self + public static let configuration: any ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self """ // when @@ -270,7 +270,7 @@ class SchemaMetadataTemplateTests: XCTestCase { let expected = """ public enum SchemaMetadata: ApolloAPI.SchemaMetadata { - public static let configuration: ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self + public static let configuration: any ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self """ // when @@ -286,7 +286,7 @@ class SchemaMetadataTemplateTests: XCTestCase { let expected = """ public enum SchemaMetadata: ApolloAPI.SchemaMetadata { - public static let configuration: ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self + public static let configuration: any ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self """ // when @@ -302,7 +302,7 @@ class SchemaMetadataTemplateTests: XCTestCase { let expected = """ enum SchemaMetadata: Apollo.SchemaMetadata { - static let configuration: Apollo.SchemaConfiguration.Type = SchemaConfiguration.self + static let configuration: any Apollo.SchemaConfiguration.Type = SchemaConfiguration.self """ // when diff --git a/Tests/ApolloCodegenTests/CodeGeneration/Templates/SelectionSet/SelectionSetTemplateTests.swift b/Tests/ApolloCodegenTests/CodeGeneration/Templates/SelectionSet/SelectionSetTemplateTests.swift index 6eea0fe8e..6169c493d 100644 --- a/Tests/ApolloCodegenTests/CodeGeneration/Templates/SelectionSet/SelectionSetTemplateTests.swift +++ b/Tests/ApolloCodegenTests/CodeGeneration/Templates/SelectionSet/SelectionSetTemplateTests.swift @@ -122,7 +122,7 @@ class SelectionSetTemplateTests: XCTestCase { """ let expected = """ - public static var __parentType: ApolloAPI.ParentType { TestSchema.Objects.Animal } + public static var __parentType: any ApolloAPI.ParentType { TestSchema.Objects.Animal } """ // when @@ -159,7 +159,7 @@ class SelectionSetTemplateTests: XCTestCase { """ let expected = """ - public static var __parentType: ApolloAPI.ParentType { TestSchema.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { TestSchema.Interfaces.Animal } """ // when @@ -199,7 +199,7 @@ class SelectionSetTemplateTests: XCTestCase { """ let expected = """ - public static var __parentType: ApolloAPI.ParentType { TestSchema.Unions.Animal } + public static var __parentType: any ApolloAPI.ParentType { TestSchema.Unions.Animal } """ // when @@ -239,7 +239,7 @@ class SelectionSetTemplateTests: XCTestCase { """ let expected = """ - public static var __parentType: Apollo.ParentType { TestSchema.Unions.Animal } + public static var __parentType: any Apollo.ParentType { TestSchema.Unions.Animal } """ // when @@ -340,7 +340,7 @@ class SelectionSetTemplateTests: XCTestCase { """ let expected = """ - public static var __parentType: ApolloAPI.ParentType { TestSchema.Objects.Nested } + public static var __parentType: any ApolloAPI.ParentType { TestSchema.Objects.Nested } public var a: Int { __data["a"] } """ @@ -1521,7 +1521,7 @@ class SelectionSetTemplateTests: XCTestCase { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = TestOperationQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { TestSchema.Objects.AnimalObject } + public static var __parentType: any ApolloAPI.ParentType { TestSchema.Objects.AnimalObject } } """ @@ -5866,7 +5866,7 @@ class SelectionSetTemplateTests: XCTestCase { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { TestSchema.Objects.Badge } + public static var __parentType: any ApolloAPI.ParentType { TestSchema.Objects.Badge } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("a", String?.self), @@ -5880,7 +5880,7 @@ class SelectionSetTemplateTests: XCTestCase { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { TestSchema.Objects.ProductBadge } + public static var __parentType: any ApolloAPI.ParentType { TestSchema.Objects.ProductBadge } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("b", String?.self), @@ -5942,7 +5942,7 @@ class SelectionSetTemplateTests: XCTestCase { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { TestSchema.Objects.Badge } + public static var __parentType: any ApolloAPI.ParentType { TestSchema.Objects.Badge } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("a", String?.self), @@ -5956,7 +5956,7 @@ class SelectionSetTemplateTests: XCTestCase { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { TestSchema.Objects.ProductBadge } + public static var __parentType: any ApolloAPI.ParentType { TestSchema.Objects.ProductBadge } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("b", String?.self), @@ -6669,7 +6669,7 @@ class SelectionSetTemplateTests: XCTestCase { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { TestSchema.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { TestSchema.Interfaces.Animal } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("species", String.self), @@ -8323,7 +8323,7 @@ class SelectionSetTemplateTests: XCTestCase { """ let expected = """ - public static var __parentType: ApolloAPI.ParentType { TestSchema.Interfaces.Type_Interface } + public static var __parentType: any ApolloAPI.ParentType { TestSchema.Interfaces.Type_Interface } """ // when @@ -8373,7 +8373,7 @@ class SelectionSetTemplateTests: XCTestCase { """ let expected = """ - public static var __parentType: ApolloAPI.ParentType { TestSchema.Unions.Type_Union } + public static var __parentType: any ApolloAPI.ParentType { TestSchema.Unions.Type_Union } """ // when @@ -8410,7 +8410,7 @@ class SelectionSetTemplateTests: XCTestCase { """ let expected = """ - public static var __parentType: ApolloAPI.ParentType { TestSchema.Objects.Type_Object } + public static var __parentType: any ApolloAPI.ParentType { TestSchema.Objects.Type_Object } """ // when diff --git a/Tests/ApolloCodegenTests/FileManagerExtensionTests.swift b/Tests/ApolloCodegenTests/FileManagerExtensionTests.swift index 8d6659120..8313d1fa2 100644 --- a/Tests/ApolloCodegenTests/FileManagerExtensionTests.swift +++ b/Tests/ApolloCodegenTests/FileManagerExtensionTests.swift @@ -8,7 +8,7 @@ import Nimble class FileManagerExtensionTests: XCTestCase { var uniquePath: String { testFilePathBuilder.testIsolatedOutputFolder.path } - lazy var uniqueError: Error! = { + lazy var uniqueError: (any Error)! = { NSError(domain: "FileManagerExtensionTest", code: Int.random(in: 1...100)) }() diff --git a/Tests/ApolloCodegenTests/URLDownloaderTests.swift b/Tests/ApolloCodegenTests/URLDownloaderTests.swift index 5a1691578..08ab33b03 100644 --- a/Tests/ApolloCodegenTests/URLDownloaderTests.swift +++ b/Tests/ApolloCodegenTests/URLDownloaderTests.swift @@ -4,7 +4,7 @@ import ApolloCodegenInternalTestHelpers import XCTest fileprivate class FailingNetworkSession: NetworkSession { - func loadData(with urlRequest: URLRequest, completionHandler: @escaping (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask? { + func loadData(with urlRequest: URLRequest, completionHandler: @escaping (Data?, URLResponse?, (any Error)?) -> Void) -> URLSessionDataTask? { XCTFail("You must call setRequestHandler before using downloader!") return nil @@ -16,7 +16,7 @@ class URLDownloaderTests: XCTestCase { let downloadURL = URL(string: "file://anywhere/nowhere/somewhere")! let defaultTimeout = 0.5 var downloader: URLDownloader! - var session: NetworkSession! + var session: (any NetworkSession)! override func setUp() { downloader = URLDownloader(session: FailingNetworkSession()) @@ -28,7 +28,7 @@ class URLDownloaderTests: XCTestCase { session = nil } - private func setRequestHandler(statusCode: Int, data: Data? = nil, error: Error? = nil, abandon: Bool = false) { + private func setRequestHandler(statusCode: Int, data: Data? = nil, error: (any Error)? = nil, abandon: Bool = false) { session = MockNetworkSession(statusCode: statusCode, data: data, error: error, abandon: abandon) downloader = URLDownloader(session: session) } @@ -102,7 +102,7 @@ class URLDownloaderTests: XCTestCase { func testDownloadError_withIncorrectResponseType_shouldThrow() throws { class CustomNetworkSession: NetworkSession { - func loadData(with urlRequest: URLRequest, completionHandler: @escaping (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask? { + func loadData(with urlRequest: URLRequest, completionHandler: @escaping (Data?, URLResponse?, (any Error)?) -> Void) -> URLSessionDataTask? { completionHandler(nil, URLResponse(), nil) return nil diff --git a/Tests/ApolloInternalTestHelpers/ConcurrentTaskContainer.swift b/Tests/ApolloInternalTestHelpers/ConcurrentTaskContainer.swift index 51b723901..307bcb837 100644 --- a/Tests/ApolloInternalTestHelpers/ConcurrentTaskContainer.swift +++ b/Tests/ApolloInternalTestHelpers/ConcurrentTaskContainer.swift @@ -4,7 +4,7 @@ public class ConcurrentTaskContainer { private let actor = Actor() private actor Actor { - private var tasks = [UUID: Task]() + private var tasks = [UUID: Task]() private var waitForAllTaskContinuations = [CheckedContinuation]() deinit { @@ -48,7 +48,7 @@ public class ConcurrentTaskContainer { @discardableResult public func dispatch( _ operation: @escaping @Sendable () async throws -> Void - ) -> Task { + ) -> Task { return Task { await actor.dispatch(operation) } diff --git a/Tests/ApolloInternalTestHelpers/InterceptorTester.swift b/Tests/ApolloInternalTestHelpers/InterceptorTester.swift index 4cdf758a0..66e586c18 100644 --- a/Tests/ApolloInternalTestHelpers/InterceptorTester.swift +++ b/Tests/ApolloInternalTestHelpers/InterceptorTester.swift @@ -14,7 +14,7 @@ public class InterceptorTester { public func intercept( request: Apollo.HTTPRequest, response: Apollo.HTTPResponse? = nil, - completion: @escaping (Result) -> Void + completion: @escaping (Result) -> Void ) { let requestChain = ResponseCaptureRequestChain({ result in completion(result) @@ -29,21 +29,21 @@ public class InterceptorTester { fileprivate class ResponseCaptureRequestChain: RequestChain { var isCancelled: Bool = false - let completion: (Result) -> Void + let completion: (Result) -> Void - init(_ completion: @escaping (Result) -> Void) { + init(_ completion: @escaping (Result) -> Void) { self.completion = completion } func kickoff( request: Apollo.HTTPRequest, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) {} func proceedAsync( request: Apollo.HTTPRequest, response: Apollo.HTTPResponse?, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) { self.completion(.success(response?.rawData)) } @@ -52,7 +52,7 @@ fileprivate class ResponseCaptureRequestChain: RequestChain { request: HTTPRequest, response: HTTPResponse?, interceptor: any ApolloInterceptor, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) { self.completion(.success(response?.rawData)) } @@ -61,14 +61,14 @@ fileprivate class ResponseCaptureRequestChain: RequestChain { func retry( request: Apollo.HTTPRequest, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) {} func handleErrorAsync( - _ error: Error, + _ error: any Error, request: Apollo.HTTPRequest, response: Apollo.HTTPResponse?, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) { self.completion(.failure(error)) } @@ -76,6 +76,6 @@ fileprivate class ResponseCaptureRequestChain: RequestChain { func returnValueAsync( for request: Apollo.HTTPRequest, value: Apollo.GraphQLResult, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) {} } diff --git a/Tests/ApolloInternalTestHelpers/Matchable.swift b/Tests/ApolloInternalTestHelpers/Matchable.swift index 3e368b524..76c4eeaa1 100644 --- a/Tests/ApolloInternalTestHelpers/Matchable.swift +++ b/Tests/ApolloInternalTestHelpers/Matchable.swift @@ -8,7 +8,7 @@ public protocol Matchable { extension JSONDecodingError: Matchable { public typealias Base = Error - public static func ~=(pattern: JSONDecodingError, value: Error) -> Bool { + public static func ~=(pattern: JSONDecodingError, value: any Error) -> Bool { guard let value = value as? JSONDecodingError else { return false } diff --git a/Tests/ApolloInternalTestHelpers/MockApolloStore.swift b/Tests/ApolloInternalTestHelpers/MockApolloStore.swift index e5d29c87a..00a181eaf 100644 --- a/Tests/ApolloInternalTestHelpers/MockApolloStore.swift +++ b/Tests/ApolloInternalTestHelpers/MockApolloStore.swift @@ -3,7 +3,7 @@ import ApolloAPI extension ApolloStore { - public static func mock(cache: NormalizedCache = NoCache()) -> ApolloStore { + public static func mock(cache: any NormalizedCache = NoCache()) -> ApolloStore { ApolloStore(cache: cache) } diff --git a/Tests/ApolloInternalTestHelpers/MockGraphQLServer.swift b/Tests/ApolloInternalTestHelpers/MockGraphQLServer.swift index 29500913e..480941ac8 100644 --- a/Tests/ApolloInternalTestHelpers/MockGraphQLServer.swift +++ b/Tests/ApolloInternalTestHelpers/MockGraphQLServer.swift @@ -109,7 +109,7 @@ public class MockGraphQLServer { } } - func serve(request: HTTPRequest, completionHandler: @escaping (Result) -> Void) where Operation: GraphQLOperation { + func serve(request: HTTPRequest, completionHandler: @escaping (Result) -> Void) where Operation: GraphQLOperation { let operationType = type(of: request.operation) if let expectation = self[request.operation] ?? self[operationType] { diff --git a/Tests/ApolloInternalTestHelpers/MockLocalCacheMutation.swift b/Tests/ApolloInternalTestHelpers/MockLocalCacheMutation.swift index 534ad168e..f816b6b12 100644 --- a/Tests/ApolloInternalTestHelpers/MockLocalCacheMutation.swift +++ b/Tests/ApolloInternalTestHelpers/MockLocalCacheMutation.swift @@ -26,7 +26,7 @@ public protocol MockMutableRootSelectionSet: MutableRootSelectionSet where Schema == MockSchemaMetadata {} public extension MockMutableRootSelectionSet { - static var __parentType: ParentType { Object.mock } + static var __parentType: any ParentType { Object.mock } init() { self.init(_dataDict: DataDict( diff --git a/Tests/ApolloInternalTestHelpers/MockNetworkTransport.swift b/Tests/ApolloInternalTestHelpers/MockNetworkTransport.swift index 59390e32b..c94b14f0d 100644 --- a/Tests/ApolloInternalTestHelpers/MockNetworkTransport.swift +++ b/Tests/ApolloInternalTestHelpers/MockNetworkTransport.swift @@ -50,7 +50,7 @@ private class MockGraphQLServerInterceptor: ApolloInterceptor { self.server = server } - public func interceptAsync(chain: RequestChain, request: HTTPRequest, response: HTTPResponse?, completion: @escaping (Result, Error>) -> Void) where Operation: GraphQLOperation { + public func interceptAsync(chain: any RequestChain, request: HTTPRequest, response: HTTPResponse?, completion: @escaping (Result, any Error>) -> Void) where Operation: GraphQLOperation { server.serve(request: request) { result in let httpResponse = HTTPURLResponse(url: TestURL.mockServer.url, statusCode: 200, @@ -90,10 +90,10 @@ public class MockWebSocketTransport: NetworkTransport { operation: Operation, cachePolicy: CachePolicy, contextIdentifier: UUID?, - context: RequestContext?, + context: (any RequestContext)?, callbackQueue: DispatchQueue, - completionHandler: @escaping (Result, Error>) -> Void - ) -> Cancellable where Operation : GraphQLOperation { + completionHandler: @escaping (Result, any Error>) -> Void + ) -> any Cancellable where Operation : GraphQLOperation { return MockTask() } } diff --git a/Tests/ApolloInternalTestHelpers/MockOperation.swift b/Tests/ApolloInternalTestHelpers/MockOperation.swift index a6d05beab..506a0a207 100644 --- a/Tests/ApolloInternalTestHelpers/MockOperation.swift +++ b/Tests/ApolloInternalTestHelpers/MockOperation.swift @@ -61,7 +61,7 @@ open class AbstractMockSelectionSet: RootSelectionSet, Has public typealias Fragments = F open class var __selections: [Selection] { [] } - open class var __parentType: ParentType { Object.mock } + open class var __parentType: any ParentType { Object.mock } public var __data: DataDict = .empty() diff --git a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift index 115acf7b3..16a67f466 100644 --- a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift +++ b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift @@ -9,7 +9,7 @@ public class MockSchemaMetadata: SchemaMetadata { public init() { } public static var _configuration: SchemaConfiguration.Type = SchemaConfiguration.self - public static var configuration: ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self + public static var configuration: any ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self private static let testObserver = TestObserver() { _ in stub_objectTypeForTypeName = nil @@ -83,7 +83,7 @@ public struct MockCacheKeyProvider { // MARK: - Custom Mock Schemas public enum MockSchema1: SchemaMetadata { - public static var configuration: SchemaConfiguration.Type = MockSchema1Configuration.self + public static var configuration: any SchemaConfiguration.Type = MockSchema1Configuration.self public static func objectType(forTypename __typename: String) -> Object? { Object(typename: __typename, implementedInterfaces: []) @@ -97,7 +97,7 @@ public enum MockSchema1Configuration: SchemaConfiguration { } public enum MockSchema2: SchemaMetadata { - public static var configuration: SchemaConfiguration.Type = MockSchema2Configuration.self + public static var configuration: any SchemaConfiguration.Type = MockSchema2Configuration.self public static func objectType(forTypename __typename: String) -> Object? { Object(typename: __typename, implementedInterfaces: []) diff --git a/Tests/ApolloInternalTestHelpers/MockURLProtocol.swift b/Tests/ApolloInternalTestHelpers/MockURLProtocol.swift index e70926bba..9cca0fe7a 100644 --- a/Tests/ApolloInternalTestHelpers/MockURLProtocol.swift +++ b/Tests/ApolloInternalTestHelpers/MockURLProtocol.swift @@ -49,7 +49,7 @@ public class MockURLProtocol: URLProtocol } public protocol MockRequestProvider { - typealias MockRequestHandler = ((URLRequest) throws -> Result<(HTTPURLResponse, Data?), Error>) + typealias MockRequestHandler = ((URLRequest) throws -> Result<(HTTPURLResponse, Data?), any Error>) // Dictionary of mock request handlers where the `key` is the URL of the request. static var requestHandlers: [URL: MockRequestHandler] { get set } diff --git a/Tests/ApolloInternalTestHelpers/MockURLSession.swift b/Tests/ApolloInternalTestHelpers/MockURLSession.swift index 6ff9bb219..d1b9d44bf 100644 --- a/Tests/ApolloInternalTestHelpers/MockURLSession.swift +++ b/Tests/ApolloInternalTestHelpers/MockURLSession.swift @@ -17,7 +17,7 @@ public final class MockURLSessionClient: URLSessionClient { return nil } public var response: HTTPURLResponse? - public var error: Error? + public var error: (any Error)? private let callbackQueue: DispatchQueue @@ -56,7 +56,7 @@ public final class MockURLSessionClient: URLSessionClient { } } - let mockTaskType: URLSessionDataTaskMockProtocol.Type = URLSessionDataTaskMock.self + let mockTaskType: any URLSessionDataTaskMockProtocol.Type = URLSessionDataTaskMock.self let mockTask = mockTaskType.init() as! URLSessionDataTaskMock return mockTask } diff --git a/Tests/ApolloInternalTestHelpers/MockWebSocket.swift b/Tests/ApolloInternalTestHelpers/MockWebSocket.swift index 09dc7f760..77aba3981 100644 --- a/Tests/ApolloInternalTestHelpers/MockWebSocket.swift +++ b/Tests/ApolloInternalTestHelpers/MockWebSocket.swift @@ -5,7 +5,7 @@ public class MockWebSocket: WebSocketClient { public var request: URLRequest public var callbackQueue: DispatchQueue = DispatchQueue.main - public var delegate: WebSocketClientDelegate? = nil + public var delegate: (any WebSocketClientDelegate)? = nil public var isConnected: Bool = false public required init(request: URLRequest, protocol: WebSocket.WSProtocol) { diff --git a/Tests/ApolloInternalTestHelpers/MockWebSocketDelegate.swift b/Tests/ApolloInternalTestHelpers/MockWebSocketDelegate.swift index 4c05c9760..a67e1fbc1 100644 --- a/Tests/ApolloInternalTestHelpers/MockWebSocketDelegate.swift +++ b/Tests/ApolloInternalTestHelpers/MockWebSocketDelegate.swift @@ -6,13 +6,13 @@ public class MockWebSocketDelegate: WebSocketClientDelegate { public init() {} - public func websocketDidConnect(socket: WebSocketClient) {} + public func websocketDidConnect(socket: any WebSocketClient) {} - public func websocketDidDisconnect(socket: WebSocketClient, error: Error?) {} + public func websocketDidDisconnect(socket: any WebSocketClient, error: (any Error)?) {} - public func websocketDidReceiveMessage(socket: WebSocketClient, text: String) { + public func websocketDidReceiveMessage(socket: any WebSocketClient, text: String) { didReceiveMessage?(text) } - public func websocketDidReceiveData(socket: WebSocketClient, data: Data) {} + public func websocketDidReceiveData(socket: any WebSocketClient, data: Data) {} } diff --git a/Tests/ApolloInternalTestHelpers/SQLiteTestCacheProvider.swift b/Tests/ApolloInternalTestHelpers/SQLiteTestCacheProvider.swift index 55bebd166..d82b214b9 100644 --- a/Tests/ApolloInternalTestHelpers/SQLiteTestCacheProvider.swift +++ b/Tests/ApolloInternalTestHelpers/SQLiteTestCacheProvider.swift @@ -5,7 +5,7 @@ import ApolloSQLite public class SQLiteTestCacheProvider: TestCacheProvider { /// Execute a test block rather than return a cache synchronously, since cache setup may be /// asynchronous at some point. - public static func withCache(initialRecords: RecordSet? = nil, fileURL: URL? = nil, execute test: (NormalizedCache) throws -> ()) throws { + public static func withCache(initialRecords: RecordSet? = nil, fileURL: URL? = nil, execute test: (any NormalizedCache) throws -> ()) throws { let fileURL = fileURL ?? temporarySQLiteFileURL() let cache = try! SQLiteNormalizedCache(fileURL: fileURL) if let initialRecords = initialRecords { @@ -14,7 +14,7 @@ public class SQLiteTestCacheProvider: TestCacheProvider { try test(cache) } - public static func makeNormalizedCache(_ completionHandler: (Result, Error>) -> ()) { + public static func makeNormalizedCache(_ completionHandler: (Result, any Error>) -> ()) { let fileURL = temporarySQLiteFileURL() let cache = try! SQLiteNormalizedCache(fileURL: fileURL) completionHandler(.success((cache, nil))) diff --git a/Tests/ApolloInternalTestHelpers/TestCacheProvider.swift b/Tests/ApolloInternalTestHelpers/TestCacheProvider.swift index 8341e89ad..1371a305e 100644 --- a/Tests/ApolloInternalTestHelpers/TestCacheProvider.swift +++ b/Tests/ApolloInternalTestHelpers/TestCacheProvider.swift @@ -5,24 +5,24 @@ public typealias TearDownHandler = () throws -> () public typealias TestDependency = (Resource, TearDownHandler?) public protocol TestCacheProvider: AnyObject { - static func makeNormalizedCache(_ completionHandler: (Result, Error>) -> ()) + static func makeNormalizedCache(_ completionHandler: (Result, any Error>) -> ()) } public class InMemoryTestCacheProvider: TestCacheProvider { - public static func makeNormalizedCache(_ completionHandler: (Result, Error>) -> ()) { + public static func makeNormalizedCache(_ completionHandler: (Result, any Error>) -> ()) { let cache = InMemoryNormalizedCache() completionHandler(.success((cache, nil))) } } public protocol CacheDependentTesting { - var cacheType: TestCacheProvider.Type { get } - var cache: NormalizedCache! { get } + var cacheType: any TestCacheProvider.Type { get } + var cache: (any NormalizedCache)! { get } } extension CacheDependentTesting where Self: XCTestCase { - public func makeNormalizedCache() throws -> NormalizedCache { - var result: Result = .failure(XCTestError(.timeoutWhileWaiting)) + public func makeNormalizedCache() throws -> any NormalizedCache { + var result: Result = .failure(XCTestError(.timeoutWhileWaiting)) let expectation = XCTestExpectation(description: "Initialized normalized cache") diff --git a/Tests/ApolloInternalTestHelpers/XCTAssertHelpers.swift b/Tests/ApolloInternalTestHelpers/XCTAssertHelpers.swift index 258ecf6be..4e7ca2d31 100644 --- a/Tests/ApolloInternalTestHelpers/XCTAssertHelpers.swift +++ b/Tests/ApolloInternalTestHelpers/XCTAssertHelpers.swift @@ -45,11 +45,11 @@ public func XCTAssertMatch(_ valueExpression: @autoclosure ( // We need overloaded versions instead of relying on default arguments // due to https://bugs.swift.org/browse/SR-1534 -public func XCTAssertSuccessResult(_ expression: @autoclosure () throws -> Result, file: StaticString = #file, line: UInt = #line) rethrows { +public func XCTAssertSuccessResult(_ expression: @autoclosure () throws -> Result, file: StaticString = #file, line: UInt = #line) rethrows { try XCTAssertSuccessResult(expression(), file: file, line: line, {_ in }) } -public func XCTAssertSuccessResult(_ expression: @autoclosure () throws -> Result, file: StaticString = #file, line: UInt = #line, _ successHandler: (_ value: Success) throws -> Void) rethrows { +public func XCTAssertSuccessResult(_ expression: @autoclosure () throws -> Result, file: StaticString = #file, line: UInt = #line, _ successHandler: (_ value: Success) throws -> Void) rethrows { let result = try expression() switch result { @@ -60,11 +60,11 @@ public func XCTAssertSuccessResult(_ expression: @autoclosure () throws } } -public func XCTAssertFailureResult(_ expression: @autoclosure () throws -> Result, file: StaticString = #file, line: UInt = #line) rethrows { +public func XCTAssertFailureResult(_ expression: @autoclosure () throws -> Result, file: StaticString = #file, line: UInt = #line) rethrows { try XCTAssertFailureResult(expression(), file: file, line: line, {_ in }) } -public func XCTAssertFailureResult(_ expression: @autoclosure () throws -> Result, file: StaticString = #file, line: UInt = #line, _ errorHandler: (_ error: Error) throws -> Void) rethrows { +public func XCTAssertFailureResult(_ expression: @autoclosure () throws -> Result, file: StaticString = #file, line: UInt = #line, _ errorHandler: (_ error: any Error) throws -> Void) rethrows { let result = try expression() switch result { diff --git a/Tests/ApolloInternalTestHelpers/XCTestCase+Helpers.swift b/Tests/ApolloInternalTestHelpers/XCTestCase+Helpers.swift index 38ddf06c9..5355f13e3 100644 --- a/Tests/ApolloInternalTestHelpers/XCTestCase+Helpers.swift +++ b/Tests/ApolloInternalTestHelpers/XCTestCase+Helpers.swift @@ -9,7 +9,7 @@ extension XCTestExpectation { public extension XCTestCase { /// Record the specified`error` as an `XCTIssue`. - func record(_ error: Error, compactDescription: String? = nil, file: StaticString = #filePath, line: UInt = #line) { + func record(_ error: any Error, compactDescription: String? = nil, file: StaticString = #filePath, line: UInt = #line) { var issue = XCTIssue(type: .thrownError, compactDescription: compactDescription ?? String(describing: error)) issue.associatedError = error @@ -35,7 +35,7 @@ public extension XCTestCase { } /// Wrapper around `XCTContext.runActivity` to allow for future extension. - func runActivity(_ name: String, perform: (XCTActivity) throws -> Result) rethrows -> Result { + func runActivity(_ name: String, perform: (any XCTActivity) throws -> Result) rethrows -> Result { return try XCTContext.runActivity(named: name, block: perform) } } @@ -45,7 +45,7 @@ import ApolloAPI public extension XCTestCase { /// Make an `AsyncResultObserver` for receiving results of the specified GraphQL operation. - func makeResultObserver(for operation: Operation, file: StaticString = #filePath, line: UInt = #line) -> AsyncResultObserver, Error> { + func makeResultObserver(for operation: Operation, file: StaticString = #filePath, line: UInt = #line) -> AsyncResultObserver, any Error> { return AsyncResultObserver(testCase: self, file: file, line: line) } } diff --git a/Tests/ApolloPaginationTests/AsyncGraphQLQueryPagerCoordinatorTests.swift b/Tests/ApolloPaginationTests/AsyncGraphQLQueryPagerCoordinatorTests.swift index 67f237c66..fd7937c5f 100644 --- a/Tests/ApolloPaginationTests/AsyncGraphQLQueryPagerCoordinatorTests.swift +++ b/Tests/ApolloPaginationTests/AsyncGraphQLQueryPagerCoordinatorTests.swift @@ -10,11 +10,11 @@ final class AsyncGraphQLQueryPagerCoordinatorTests: XCTestCase, CacheDependentTe private typealias ReverseQuery = MockQuery private typealias ForwardQuery = MockQuery - var cacheType: TestCacheProvider.Type { + var cacheType: any TestCacheProvider.Type { InMemoryTestCacheProvider.self } - var cache: NormalizedCache! + var cache: (any NormalizedCache)! var server: MockGraphQLServer! var client: ApolloClient! var cancellables: [AnyCancellable] = [] diff --git a/Tests/ApolloPaginationTests/BidirectionalPaginationTests.swift b/Tests/ApolloPaginationTests/BidirectionalPaginationTests.swift index 115b887fa..c62f29201 100644 --- a/Tests/ApolloPaginationTests/BidirectionalPaginationTests.swift +++ b/Tests/ApolloPaginationTests/BidirectionalPaginationTests.swift @@ -10,11 +10,11 @@ final class BidirectionalPaginationTests: XCTestCase, CacheDependentTesting { private typealias Query = MockQuery - var cacheType: TestCacheProvider.Type { + var cacheType: any TestCacheProvider.Type { InMemoryTestCacheProvider.self } - var cache: NormalizedCache! + var cache: (any NormalizedCache)! var server: MockGraphQLServer! var client: ApolloClient! var cancellables: [AnyCancellable] = [] @@ -92,7 +92,7 @@ final class BidirectionalPaginationTests: XCTestCase, CacheDependentTesting { let pager = createPager() let serverExpectation = Mocks.Hero.BidirectionalFriendsQuery.expectationForFirstFetchInMiddleOfList(server: server) - var results: [Result<(PaginationOutput, UpdateSource), Error>] = [] + var results: [Result<(PaginationOutput, UpdateSource), any Error>] = [] let firstPageExpectation = expectation(description: "First page") var subscription = await pager.subscribe(onUpdate: { _ in firstPageExpectation.fulfill() @@ -206,7 +206,7 @@ final class BidirectionalPaginationTests: XCTestCase, CacheDependentTesting { let pager = GraphQLQueryPagerCoordinator(pager: createPager()) let serverExpectation = Mocks.Hero.BidirectionalFriendsQuery.expectationForFirstFetchInMiddleOfList(server: server) - var results: [Result<(PaginationOutput, UpdateSource), Error>] = [] + var results: [Result<(PaginationOutput, UpdateSource), any Error>] = [] let firstPageExpectation = expectation(description: "First page") var subscription = await pager.publisher.sink { _ in firstPageExpectation.fulfill() diff --git a/Tests/ApolloPaginationTests/ConcurrencyTest.swift b/Tests/ApolloPaginationTests/ConcurrencyTest.swift index a293f78b7..7ce0270f1 100644 --- a/Tests/ApolloPaginationTests/ConcurrencyTest.swift +++ b/Tests/ApolloPaginationTests/ConcurrencyTest.swift @@ -137,7 +137,7 @@ final class ConcurrencyTests: XCTestCase { func test_concurrentFetches() async throws { let pager = createPager() - var results: [Result<(PaginationOutput, UpdateSource), Error>] = [] + var results: [Result<(PaginationOutput, UpdateSource), any Error>] = [] let resultsExpectation = expectation(description: "Results arrival") resultsExpectation.expectedFulfillmentCount = 2 await pager.subscribe { result in @@ -160,7 +160,7 @@ final class ConcurrencyTests: XCTestCase { func test_concurrentFetches_nonisolated() throws { let pager = createNonisolatedPager() - var results: [Result<(PaginationOutput, UpdateSource), Error>] = [] + var results: [Result<(PaginationOutput, UpdateSource), any Error>] = [] let initialExpectation = expectation(description: "Initial") initialExpectation.assertForOverFulfill = false let nextExpectation = expectation(description: "Next") diff --git a/Tests/ApolloPaginationTests/ForwardPaginationTests.swift b/Tests/ApolloPaginationTests/ForwardPaginationTests.swift index 17f59d4ab..b10144323 100644 --- a/Tests/ApolloPaginationTests/ForwardPaginationTests.swift +++ b/Tests/ApolloPaginationTests/ForwardPaginationTests.swift @@ -10,11 +10,11 @@ final class ForwardPaginationTests: XCTestCase, CacheDependentTesting { private typealias Query = MockQuery - var cacheType: TestCacheProvider.Type { + var cacheType: any TestCacheProvider.Type { InMemoryTestCacheProvider.self } - var cache: NormalizedCache! + var cache: (any NormalizedCache)! var server: MockGraphQLServer! var client: ApolloClient! var cancellables: [AnyCancellable] = [] @@ -47,7 +47,7 @@ final class ForwardPaginationTests: XCTestCase, CacheDependentTesting { let serverExpectation = Mocks.Hero.FriendsQuery.expectationForFirstPage(server: server) - var results: [Result<(PaginationOutput, UpdateSource), Error>] = [] + var results: [Result<(PaginationOutput, UpdateSource), any Error>] = [] let firstPageExpectation = expectation(description: "First page") var subscription = await pager.subscribe(onUpdate: { _ in firstPageExpectation.fulfill() diff --git a/Tests/ApolloPaginationTests/GraphQLQueryPagerCoordinatorTests.swift b/Tests/ApolloPaginationTests/GraphQLQueryPagerCoordinatorTests.swift index f8e8958e4..fe8531e27 100644 --- a/Tests/ApolloPaginationTests/GraphQLQueryPagerCoordinatorTests.swift +++ b/Tests/ApolloPaginationTests/GraphQLQueryPagerCoordinatorTests.swift @@ -9,11 +9,11 @@ import XCTest final class GraphQLQueryPagerCoordinatorTests: XCTestCase, CacheDependentTesting { private typealias ForwardQuery = MockQuery - var cacheType: TestCacheProvider.Type { + var cacheType: any TestCacheProvider.Type { InMemoryTestCacheProvider.self } - var cache: NormalizedCache! + var cache: (any NormalizedCache)! var server: MockGraphQLServer! var client: ApolloClient! var cancellables: [AnyCancellable] = [] @@ -96,7 +96,7 @@ final class GraphQLQueryPagerCoordinatorTests: XCTestCase, CacheDependentTesting server.customDelay = .milliseconds(1) let pager = GraphQLQueryPagerCoordinator(pager: createForwardPager()) let serverExpectation = Mocks.Hero.FriendsQuery.expectationForFirstPage(server: server) - var results: [Result<(PaginationOutput, UpdateSource), Error>] = [] + var results: [Result<(PaginationOutput, UpdateSource), any Error>] = [] var errors: [PaginationError?] = [] pager.fetch() @@ -127,7 +127,7 @@ final class GraphQLQueryPagerCoordinatorTests: XCTestCase, CacheDependentTesting server.customDelay = .milliseconds(1) var pager: GraphQLQueryPagerCoordinator! = GraphQLQueryPagerCoordinator(pager: createForwardPager()) let serverExpectation = Mocks.Hero.FriendsQuery.expectationForFirstPage(server: server) - var results: [Result<(PaginationOutput, UpdateSource), Error>] = [] + var results: [Result<(PaginationOutput, UpdateSource), any Error>] = [] var errors: [PaginationError?] = [] pager.fetch() diff --git a/Tests/ApolloPaginationTests/GraphQLQueryPagerTests.swift b/Tests/ApolloPaginationTests/GraphQLQueryPagerTests.swift index b26b4158f..2b3bdfd2e 100644 --- a/Tests/ApolloPaginationTests/GraphQLQueryPagerTests.swift +++ b/Tests/ApolloPaginationTests/GraphQLQueryPagerTests.swift @@ -91,7 +91,7 @@ final class GraphQLQueryPagerTests: XCTestCase { } // This is due to a timing issue in unit tests only wherein we deinit immediately after waiting for expectations - private func ignoringCancellations(error: Error?) { + private func ignoringCancellations(error: (any Error)?) { if PaginationError.isCancellation(error: error as? PaginationError) { return } else { diff --git a/Tests/ApolloPaginationTests/OffsetTests.swift b/Tests/ApolloPaginationTests/OffsetTests.swift index f33eca55e..81a442c38 100644 --- a/Tests/ApolloPaginationTests/OffsetTests.swift +++ b/Tests/ApolloPaginationTests/OffsetTests.swift @@ -62,7 +62,7 @@ final class OffsetTests: XCTestCase { } // This is due to a timing issue in unit tests only wherein we deinit immediately after waiting for expectations - private func ignoringCancellations(error: Error?) { + private func ignoringCancellations(error: (any Error)?) { if PaginationError.isCancellation(error: error as? PaginationError) { return } else { @@ -102,7 +102,7 @@ final class OffsetTests: XCTestCase { ViewModel(name: friend.name) } } - return Result<[ViewModel], Error>.success(friends) + return Result<[ViewModel], any Error>.success(friends) case .failure(let error): return .failure(error) } diff --git a/Tests/ApolloPaginationTests/ReversePaginationTests.swift b/Tests/ApolloPaginationTests/ReversePaginationTests.swift index 813716f58..83f76d62d 100644 --- a/Tests/ApolloPaginationTests/ReversePaginationTests.swift +++ b/Tests/ApolloPaginationTests/ReversePaginationTests.swift @@ -10,11 +10,11 @@ final class ReversePaginationTests: XCTestCase, CacheDependentTesting { private typealias Query = MockQuery - var cacheType: TestCacheProvider.Type { + var cacheType: any TestCacheProvider.Type { InMemoryTestCacheProvider.self } - var cache: NormalizedCache! + var cache: (any NormalizedCache)! var server: MockGraphQLServer! var client: ApolloClient! var cancellables: [AnyCancellable] = [] @@ -47,7 +47,7 @@ final class ReversePaginationTests: XCTestCase, CacheDependentTesting { let serverExpectation = Mocks.Hero.ReverseFriendsQuery.expectationForLastItem(server: server) - var results: [Result<(PaginationOutput, UpdateSource), Error>] = [] + var results: [Result<(PaginationOutput, UpdateSource), any Error>] = [] let firstPageExpectation = expectation(description: "First page") var subscription = await pager.subscribe(onUpdate: { _ in firstPageExpectation.fulfill() diff --git a/Tests/ApolloPaginationTests/SubscribeTests.swift b/Tests/ApolloPaginationTests/SubscribeTests.swift index d7ca500e5..552be1376 100644 --- a/Tests/ApolloPaginationTests/SubscribeTests.swift +++ b/Tests/ApolloPaginationTests/SubscribeTests.swift @@ -7,11 +7,11 @@ import XCTest @testable import ApolloPagination final class SubscribeTest: XCTestCase, CacheDependentTesting { - var cacheType: TestCacheProvider.Type { + var cacheType: any TestCacheProvider.Type { InMemoryTestCacheProvider.self } - var cache: NormalizedCache! + var cache: (any NormalizedCache)! var server: MockGraphQLServer! var client: ApolloClient! var cancellables: [AnyCancellable] = [] @@ -45,8 +45,8 @@ final class SubscribeTest: XCTestCase, CacheDependentTesting { let initialFetchExpectation = expectation(description: "Results") initialFetchExpectation.assertForOverFulfill = false - var results: [Result<(PaginationOutput, UpdateSource), Error>] = [] - var otherResults: [Result<(PaginationOutput, UpdateSource), Error>] = [] + var results: [Result<(PaginationOutput, UpdateSource), any Error>] = [] + var otherResults: [Result<(PaginationOutput, UpdateSource), any Error>] = [] await pager.$currentValue.compactMap({ $0 }).sink { result in results.append(result) initialFetchExpectation.fulfill() diff --git a/Tests/ApolloPaginationTests/XCTAssert+Async.swift b/Tests/ApolloPaginationTests/XCTAssert+Async.swift index f98101a28..94bd3a545 100644 --- a/Tests/ApolloPaginationTests/XCTAssert+Async.swift +++ b/Tests/ApolloPaginationTests/XCTAssert+Async.swift @@ -3,7 +3,7 @@ import XCTest public func XCTAssertThrowsError( _ expression: @autoclosure () async throws -> T, _ message: @autoclosure () -> String = "", - _ errorHandler: (_ error: Error) -> Void = { _ in } + _ errorHandler: (_ error: any Error) -> Void = { _ in } ) async { do { _ = try await expression() diff --git a/Tests/ApolloPerformanceTests/SelectionSetInitializerPerformanceTests.swift b/Tests/ApolloPerformanceTests/SelectionSetInitializerPerformanceTests.swift index 9b7d192c1..538766aed 100644 --- a/Tests/ApolloPerformanceTests/SelectionSetInitializerPerformanceTests.swift +++ b/Tests/ApolloPerformanceTests/SelectionSetInitializerPerformanceTests.swift @@ -12,6 +12,7 @@ class SelectionSetInitializerPerformanceTests: XCTestCase { for _ in 0..<1_000 { let animal = AllAnimalsQuery.Data.AllAnimal.AsDog( favoriteToy: "Milk Bone", + id: "1", height: .init(feet: 3, meters: 1, relativeSize: .case(.small), centimeters: 100), species: "Canine", predators: [], diff --git a/Tests/ApolloPerformanceTests/TypeCaseConversionPerformanceTests.swift b/Tests/ApolloPerformanceTests/TypeCaseConversionPerformanceTests.swift index 60944ab37..abfdc87e8 100644 --- a/Tests/ApolloPerformanceTests/TypeCaseConversionPerformanceTests.swift +++ b/Tests/ApolloPerformanceTests/TypeCaseConversionPerformanceTests.swift @@ -10,6 +10,7 @@ class TypeCaseConversionPerformanceTests: XCTestCase { func testPerformance_typeConversion_checkTypeConformsToInterface() { let animal = AllAnimalsQuery.Data.AllAnimal.AsDog( favoriteToy: "Milk Bone", + id: "1", height: .init(feet: 3, meters: 1, relativeSize: .case(.small), centimeters: 100), species: "Canine", predators: [], diff --git a/Tests/ApolloServerIntegrationTests/StarWarsServerCachingRoundtripTests.swift b/Tests/ApolloServerIntegrationTests/StarWarsServerCachingRoundtripTests.swift index b9bd4f359..b4d25ffed 100644 --- a/Tests/ApolloServerIntegrationTests/StarWarsServerCachingRoundtripTests.swift +++ b/Tests/ApolloServerIntegrationTests/StarWarsServerCachingRoundtripTests.swift @@ -5,19 +5,19 @@ import StarWarsAPI import ApolloAPI class SQLiteStarWarsServerCachingRoundtripTests: StarWarsServerCachingRoundtripTests { - override var cacheType: TestCacheProvider.Type { + override var cacheType: any TestCacheProvider.Type { SQLiteTestCacheProvider.self } } class StarWarsServerCachingRoundtripTests: XCTestCase, CacheDependentTesting { - var cacheType: TestCacheProvider.Type { + var cacheType: any TestCacheProvider.Type { InMemoryTestCacheProvider.self } static let defaultWaitTimeout: TimeInterval = 5 - var cache: NormalizedCache! + var cache: (any NormalizedCache)! var store: ApolloStore! var client: ApolloClient! diff --git a/Tests/ApolloServerIntegrationTests/StarWarsServerTests.swift b/Tests/ApolloServerIntegrationTests/StarWarsServerTests.swift index 2b415bbe8..10fcdb5cd 100644 --- a/Tests/ApolloServerIntegrationTests/StarWarsServerTests.swift +++ b/Tests/ApolloServerIntegrationTests/StarWarsServerTests.swift @@ -19,33 +19,33 @@ class StarWarsServerAPQsTests: StarWarsServerTests { } class SQLiteStarWarsServerAPQsGetMethodTests: StarWarsServerAPQsGetMethodTests { - override var cacheType: TestCacheProvider.Type { + override var cacheType: any TestCacheProvider.Type { SQLiteTestCacheProvider.self } } class SQLiteStarWarsServerAPQsTests: StarWarsServerAPQsTests { - override var cacheType: TestCacheProvider.Type { + override var cacheType: any TestCacheProvider.Type { SQLiteTestCacheProvider.self } } class SQLiteStarWarsServerTests: StarWarsServerTests { - override var cacheType: TestCacheProvider.Type { + override var cacheType: any TestCacheProvider.Type { SQLiteTestCacheProvider.self } } class StarWarsServerTests: XCTestCase, CacheDependentTesting { - var config: TestConfig! - - var cacheType: TestCacheProvider.Type { + var config: (any TestConfig)! + + var cacheType: any TestCacheProvider.Type { InMemoryTestCacheProvider.self } static let defaultWaitTimeout: TimeInterval = 5 - var cache: NormalizedCache! + var cache: (any NormalizedCache)! var client: ApolloClient! override func setUpWithError() throws { diff --git a/Tests/ApolloServerIntegrationTests/StarWarsSubscriptionTests.swift b/Tests/ApolloServerIntegrationTests/StarWarsSubscriptionTests.swift index a92100baa..d91cc88f3 100644 --- a/Tests/ApolloServerIntegrationTests/StarWarsSubscriptionTests.swift +++ b/Tests/ApolloServerIntegrationTests/StarWarsSubscriptionTests.swift @@ -352,8 +352,8 @@ class StarWarsSubscriptionTests: XCTestCase { let expectation = self.expectation(description: "Subscribers connected and received events") expectation.expectedFulfillmentCount = 2 - var sub1: Cancellable? - var sub2: Cancellable? + var sub1: (any Cancellable)? + var sub2: (any Cancellable)? concurrentQueue.async { sub1 = self.client.subscribe(subscription: firstSubscription) { _ in @@ -563,7 +563,7 @@ extension StarWarsSubscriptionTests: WebSocketTransportDelegate { self.reconnectedExpectation?.fulfill() } - func webSocketTransport(_ webSocketTransport: WebSocketTransport, didDisconnectWithError error: Error?) { + func webSocketTransport(_ webSocketTransport: WebSocketTransport, didDisconnectWithError error: (any Error)?) { self.disconnectedExpectation?.fulfill() } } diff --git a/Tests/ApolloServerIntegrationTests/StarWarsWebSocketTests.swift b/Tests/ApolloServerIntegrationTests/StarWarsWebSocketTests.swift index 912761a63..0f38c5851 100755 --- a/Tests/ApolloServerIntegrationTests/StarWarsWebSocketTests.swift +++ b/Tests/ApolloServerIntegrationTests/StarWarsWebSocketTests.swift @@ -7,13 +7,13 @@ import ApolloAPI class StarWarsWebSocketTests: XCTestCase, CacheDependentTesting { - var cacheType: TestCacheProvider.Type { + var cacheType: any TestCacheProvider.Type { InMemoryTestCacheProvider.self } static let defaultWaitTimeout: TimeInterval = 5 - var cache: NormalizedCache! + var cache: (any NormalizedCache)! var client: ApolloClient! override func setUpWithError() throws { diff --git a/Tests/ApolloServerIntegrationTests/SubscriptionTests.swift b/Tests/ApolloServerIntegrationTests/SubscriptionTests.swift index b32fc34b8..354961a74 100644 --- a/Tests/ApolloServerIntegrationTests/SubscriptionTests.swift +++ b/Tests/ApolloServerIntegrationTests/SubscriptionTests.swift @@ -52,7 +52,7 @@ extension SubscriptionTests: WebSocketTransportDelegate { connectionState = .connected } - func webSocketTransport(_ webSocketTransport: WebSocketTransport, didDisconnectWithError error:Error?) { + func webSocketTransport(_ webSocketTransport: WebSocketTransport, didDisconnectWithError error: (any Error)?) { connectionState = .disconnected } } diff --git a/Tests/ApolloServerIntegrationTests/TestHelpers/TestConfigs.swift b/Tests/ApolloServerIntegrationTests/TestHelpers/TestConfigs.swift index 4f55d2cf5..cfaf86023 100644 --- a/Tests/ApolloServerIntegrationTests/TestHelpers/TestConfigs.swift +++ b/Tests/ApolloServerIntegrationTests/TestHelpers/TestConfigs.swift @@ -1,39 +1,39 @@ @testable import Apollo protocol TestConfig { - func network(store: ApolloStore) -> NetworkTransport + func network(store: ApolloStore) -> any NetworkTransport } class DefaultConfig: TestConfig { - func transport(with store: ApolloStore) -> NetworkTransport { + func transport(with store: ApolloStore) -> any NetworkTransport { let provider = DefaultInterceptorProvider(store: store) return RequestChainNetworkTransport(interceptorProvider: provider, endpointURL: TestServerURL.starWarsServer.url) } - func network(store: ApolloStore) -> NetworkTransport { + func network(store: ApolloStore) -> any NetworkTransport { return transport(with: store) } } class APQsConfig: TestConfig { - func transport(with store: ApolloStore) -> NetworkTransport { + func transport(with store: ApolloStore) -> any NetworkTransport { let provider = DefaultInterceptorProvider(store: store) return RequestChainNetworkTransport(interceptorProvider: provider, endpointURL: TestServerURL.starWarsServer.url, autoPersistQueries: true) } - func network(store: ApolloStore) -> NetworkTransport { + func network(store: ApolloStore) -> any NetworkTransport { return transport(with: store) } } class APQsWithGetMethodConfig: TestConfig { - func transport(with store: ApolloStore) -> NetworkTransport { + func transport(with store: ApolloStore) -> any NetworkTransport { let provider = DefaultInterceptorProvider(store: store) return RequestChainNetworkTransport(interceptorProvider: provider, endpointURL: TestServerURL.starWarsServer.url, @@ -41,7 +41,7 @@ class APQsWithGetMethodConfig: TestConfig { useGETForPersistedQueryRetry: true) } - func network(store: ApolloStore) -> NetworkTransport { + func network(store: ApolloStore) -> any NetworkTransport { return transport(with: store) } } diff --git a/Tests/ApolloTests/ApolloClientOperationTests.swift b/Tests/ApolloTests/ApolloClientOperationTests.swift index f615da8a6..2f23f764f 100644 --- a/Tests/ApolloTests/ApolloClientOperationTests.swift +++ b/Tests/ApolloTests/ApolloClientOperationTests.swift @@ -36,7 +36,7 @@ final class ApolloClientOperationTests: XCTestCase { super.init(cache: NoCache()) } - override func publish(records: RecordSet, identifier: UUID? = nil, callbackQueue: DispatchQueue = .main, completion: ((Result) -> Void)? = nil) { + override func publish(records: RecordSet, identifier: UUID? = nil, callbackQueue: DispatchQueue = .main, completion: ((Result) -> Void)? = nil) { publishedRecordSets.append(records) } } diff --git a/Tests/ApolloTests/BatchedLoadTests.swift b/Tests/ApolloTests/BatchedLoadTests.swift index bd3409691..2d869cd11 100644 --- a/Tests/ApolloTests/BatchedLoadTests.swift +++ b/Tests/ApolloTests/BatchedLoadTests.swift @@ -22,7 +22,7 @@ private final class MockBatchedNormalizedCache: NormalizedCache { func loadRecords(forKeys keys: [CacheKey], callbackQueue: DispatchQueue?, - completion: @escaping (Result<[Record?], Error>) -> Void) { + completion: @escaping (Result<[Record?], any Error>) -> Void) { $numberOfBatchLoads.increment() DispatchQueue.global().asyncAfter(deadline: .now() + .milliseconds(1)) { @@ -47,7 +47,7 @@ private final class MockBatchedNormalizedCache: NormalizedCache { func merge(records: RecordSet, callbackQueue: DispatchQueue?, - completion: @escaping (Result, Error>) -> Void) { + completion: @escaping (Result, any Error>) -> Void) { DispatchQueue.global().asyncAfter(deadline: .now() + .milliseconds(1)) { let changedKeys = self.records.merge(records: records) DispatchQueue.returnResultAsyncIfNeeded(on: callbackQueue, @@ -56,7 +56,7 @@ private final class MockBatchedNormalizedCache: NormalizedCache { } } - func clear(callbackQueue: DispatchQueue?, completion: ((Result) -> Void)?) { + func clear(callbackQueue: DispatchQueue?, completion: ((Result) -> Void)?) { DispatchQueue.global().asyncAfter(deadline: .now() + .milliseconds(1)) { self.records.clear() DispatchQueue.returnResultAsyncIfNeeded(on: callbackQueue, diff --git a/Tests/ApolloTests/BlindRetryingTestInterceptor.swift b/Tests/ApolloTests/BlindRetryingTestInterceptor.swift index c35eeaad7..c509c6eed 100644 --- a/Tests/ApolloTests/BlindRetryingTestInterceptor.swift +++ b/Tests/ApolloTests/BlindRetryingTestInterceptor.swift @@ -10,10 +10,10 @@ class BlindRetryingTestInterceptor: ApolloInterceptor { public var id: String = UUID().uuidString func interceptAsync( - chain: RequestChain, + chain: any RequestChain, request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void) { + completion: @escaping (Result, any Error>) -> Void) { self.hitCount += 1 chain.retry(request: request, completion: completion) diff --git a/Tests/ApolloTests/Cache/CacheDependentInterceptorTests.swift b/Tests/ApolloTests/Cache/CacheDependentInterceptorTests.swift index d075d71a0..91d464dbd 100644 --- a/Tests/ApolloTests/Cache/CacheDependentInterceptorTests.swift +++ b/Tests/ApolloTests/Cache/CacheDependentInterceptorTests.swift @@ -4,11 +4,11 @@ import ApolloAPI import ApolloInternalTestHelpers class CacheDependentInterceptorTests: XCTestCase, CacheDependentTesting { - var cacheType: TestCacheProvider.Type { + var cacheType: any TestCacheProvider.Type { InMemoryTestCacheProvider.self } - var cache: NormalizedCache! + var cache: (any NormalizedCache)! var store: ApolloStore! override func setUpWithError() throws { @@ -48,14 +48,14 @@ class CacheDependentInterceptorTests: XCTestCase, CacheDependentTesting { /// This interceptor will reroute anything that fails with a response code error to retry hitting only the cache class RerouteToCacheErrorInterceptor: ApolloErrorInterceptor { - var handledError: Error? + var handledError: (any Error)? func handleErrorAsync( - error: Error, - chain: RequestChain, + error: any Error, + chain: any RequestChain, request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void) { + completion: @escaping (Result, any Error>) -> Void) { self.handledError = error @@ -88,7 +88,7 @@ class CacheDependentInterceptorTests: XCTestCase, CacheDependentTesting { let additionalInterceptor = RerouteToCacheErrorInterceptor() - override func additionalErrorInterceptor(for operation: Operation) -> ApolloErrorInterceptor? { + override func additionalErrorInterceptor(for operation: Operation) -> (any ApolloErrorInterceptor)? { self.additionalInterceptor } } diff --git a/Tests/ApolloTests/Cache/FetchQueryTests.swift b/Tests/ApolloTests/Cache/FetchQueryTests.swift index 5b693d281..1f01ae83a 100644 --- a/Tests/ApolloTests/Cache/FetchQueryTests.swift +++ b/Tests/ApolloTests/Cache/FetchQueryTests.swift @@ -5,13 +5,13 @@ import ApolloInternalTestHelpers class FetchQueryTests: XCTestCase, CacheDependentTesting { - var cacheType: TestCacheProvider.Type { + var cacheType: any TestCacheProvider.Type { InMemoryTestCacheProvider.self } static let defaultWaitTimeout: TimeInterval = 1 - var cache: NormalizedCache! + var cache: (any NormalizedCache)! var server: MockGraphQLServer! var client: ApolloClient! diff --git a/Tests/ApolloTests/Cache/LoadQueryFromStoreTests.swift b/Tests/ApolloTests/Cache/LoadQueryFromStoreTests.swift index 3d92cbb50..2cde09a01 100644 --- a/Tests/ApolloTests/Cache/LoadQueryFromStoreTests.swift +++ b/Tests/ApolloTests/Cache/LoadQueryFromStoreTests.swift @@ -7,13 +7,13 @@ import ApolloSQLite import ApolloInternalTestHelpers class LoadQueryFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { - var cacheType: TestCacheProvider.Type { + var cacheType: any TestCacheProvider.Type { InMemoryTestCacheProvider.self } static let defaultWaitTimeout: TimeInterval = 5.0 - var cache: NormalizedCache! + var cache: (any NormalizedCache)! var store: ApolloStore! override func setUpWithError() throws { diff --git a/Tests/ApolloTests/Cache/ReadWriteFromStoreTests.swift b/Tests/ApolloTests/Cache/ReadWriteFromStoreTests.swift index a159cb668..87325d8d4 100644 --- a/Tests/ApolloTests/Cache/ReadWriteFromStoreTests.swift +++ b/Tests/ApolloTests/Cache/ReadWriteFromStoreTests.swift @@ -6,13 +6,13 @@ import ApolloInternalTestHelpers class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { - var cacheType: TestCacheProvider.Type { + var cacheType: any TestCacheProvider.Type { InMemoryTestCacheProvider.self } static let defaultWaitTimeout: TimeInterval = 5.0 - var cache: NormalizedCache! + var cache: (any NormalizedCache)! var store: ApolloStore! override func setUpWithError() throws { @@ -276,7 +276,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { class AsDroid: MockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Droid } + override class var __parentType: any ParentType { Types.Droid } override class var __selections: [Selection] { [ .field("primaryFunction", String.self), @@ -332,7 +332,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { class AsDroid: MockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Droid } + override class var __parentType: any ParentType { Types.Droid } override class var __selections: [Selection] { [ .field("primaryFunction", String.self), @@ -913,7 +913,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { public var __data: DataDict = .empty() public typealias RootEntityType = Hero - static let __parentType: ParentType = Types.Droid + static let __parentType: any ParentType = Types.Droid init(_dataDict: DataDict) { __data = _dataDict } static var __selections: [Selection] { [ @@ -1002,7 +1002,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { struct AsDroid: MockMutableInlineFragment { public var __data: DataDict = .empty() public typealias RootEntityType = GivenFragment - static let __parentType: ParentType = Types.Droid + static let __parentType: any ParentType = Types.Droid init(_dataDict: DataDict) { __data = _dataDict } static var __selections: [Selection] { [ @@ -1134,7 +1134,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { struct AsDroid: MockMutableInlineFragment { public var __data: DataDict = .empty() public typealias RootEntityType = GivenFragment - static let __parentType: ParentType = Types.Droid + static let __parentType: any ParentType = Types.Droid init(_dataDict: DataDict) { __data = _dataDict } static var __selections: [Selection] { [ @@ -1184,7 +1184,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { struct AsDroid: MockMutableInlineFragment { public var __data: DataDict = .empty() public typealias RootEntityType = GivenFragment - static let __parentType: ParentType = Types.Droid + static let __parentType: any ParentType = Types.Droid init(_dataDict: DataDict) { __data = _dataDict } static var __selections: [Selection] { [ @@ -1715,7 +1715,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { class Data: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Query } + override class var __parentType: any ParentType { Types.Query } override class var __selections: [Selection] {[ .field("name", String?.self) ]} @@ -1781,7 +1781,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { class Data: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Query } + override class var __parentType: any ParentType { Types.Query } override class var __selections: [Selection] {[ .field("hero", Hero.self) ]} @@ -1800,7 +1800,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { class Hero: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("__typename", String.self), .include(if: "a", .inlineFragment(IfA.self)), @@ -1812,7 +1812,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { class IfA: ConcreteMockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("name", String.self), .include(if: !"c", .field("friend", Friend.self)), @@ -1841,7 +1841,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { class Friend: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("__typename", String.self), .field("name", String.self) @@ -1863,7 +1863,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { class IfB: ConcreteMockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ ]} convenience init() { @@ -1936,7 +1936,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { class GivenQuery: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Query } + override class var __parentType: any ParentType { Types.Query } override class var __selections: [Selection] {[ .field("hero", Hero.self) ]} @@ -1955,7 +1955,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { class Hero: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .inlineFragment(AsCharacter.self) ]} @@ -1964,7 +1964,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { class AsCharacter: ConcreteMockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Character } + override class var __parentType: any ParentType { Types.Character } override class var __selections: [Selection] {[ .field("name", String.self) ]} @@ -2034,7 +2034,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { public var __data: DataDict = .empty() init(_dataDict: DataDict) { __data = _dataDict } - static var __parentType: ParentType { Types.Query } + static var __parentType: any ParentType { Types.Query } static var __selections: [Selection] { [ .field("hero", Hero.self) ]} @@ -2057,7 +2057,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { public var __data: DataDict = .empty() init(_dataDict: DataDict) { __data = _dataDict } - static var __parentType: ParentType { Types.Human } + static var __parentType: any ParentType { Types.Human } static var __selections: [Selection] { [ .field("name", String.self) ]} @@ -2081,7 +2081,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { class GivenQuery: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Query } + override class var __parentType: any ParentType { Types.Query } override class var __selections: [Selection] {[ .include(if: "a", [.inlineFragment(IfA.self)]) ]} @@ -2096,7 +2096,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { class IfA: ConcreteMockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Query } + override class var __parentType: any ParentType { Types.Query } override class var __selections: [Selection] {[ .fragment(GivenFragment.self) ]} @@ -2218,7 +2218,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { class GivenQuery: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Query } + override class var __parentType: any ParentType { Types.Query } override class var __selections: [Selection] {[ .include(if: "a", [.inlineFragment(IfA.self)]) ]} @@ -2233,7 +2233,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { class IfA: ConcreteMockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Query } + override class var __parentType: any ParentType { Types.Query } override class var __selections: [Selection] {[ .fragment(GivenFragment.self) ]} @@ -2832,7 +2832,7 @@ class ReadWriteFromStoreTests: XCTestCase, CacheDependentTesting, StoreLoading { // MARK: Helpers fileprivate func expectJSONMissingValueError( - _ result: Result, + _ result: Result, atPath path: ResponsePath, file: Nimble.FileString = #file, line: UInt = #line ) { diff --git a/Tests/ApolloTests/Cache/SQLite/SQLiteCacheTests.swift b/Tests/ApolloTests/Cache/SQLite/SQLiteCacheTests.swift index 3a76b0cab..a3eb4b2ac 100644 --- a/Tests/ApolloTests/Cache/SQLite/SQLiteCacheTests.swift +++ b/Tests/ApolloTests/Cache/SQLite/SQLiteCacheTests.swift @@ -4,25 +4,25 @@ import ApolloInternalTestHelpers // These test cases inherit all tests from their superclasses. class SQLiteFetchQueryTests: FetchQueryTests { - override var cacheType: TestCacheProvider.Type { + override var cacheType: any TestCacheProvider.Type { SQLiteTestCacheProvider.self } } class SQLiteLoadQueryFromStoreTests: LoadQueryFromStoreTests { - override var cacheType: TestCacheProvider.Type { + override var cacheType: any TestCacheProvider.Type { SQLiteTestCacheProvider.self } } class SQLiteReadWriteFromStoreTests: ReadWriteFromStoreTests { - override var cacheType: TestCacheProvider.Type { + override var cacheType: any TestCacheProvider.Type { SQLiteTestCacheProvider.self } } class SQLiteWatchQueryTests: WatchQueryTests { - override var cacheType: TestCacheProvider.Type { + override var cacheType: any TestCacheProvider.Type { SQLiteTestCacheProvider.self } } diff --git a/Tests/ApolloTests/Cache/StoreConcurrencyTests.swift b/Tests/ApolloTests/Cache/StoreConcurrencyTests.swift index 2d90b256a..121ed462f 100644 --- a/Tests/ApolloTests/Cache/StoreConcurrencyTests.swift +++ b/Tests/ApolloTests/Cache/StoreConcurrencyTests.swift @@ -5,13 +5,13 @@ import ApolloInternalTestHelpers class StoreConcurrencyTests: XCTestCase, CacheDependentTesting { - var cacheType: TestCacheProvider.Type { + var cacheType: any TestCacheProvider.Type { InMemoryTestCacheProvider.self } var defaultWaitTimeout: TimeInterval = 60 - var cache: NormalizedCache! + var cache: (any NormalizedCache)! var store: ApolloStore! override func setUpWithError() throws { diff --git a/Tests/ApolloTests/Cache/WatchQueryTests.swift b/Tests/ApolloTests/Cache/WatchQueryTests.swift index 44f44dd05..38b05997d 100644 --- a/Tests/ApolloTests/Cache/WatchQueryTests.swift +++ b/Tests/ApolloTests/Cache/WatchQueryTests.swift @@ -6,13 +6,13 @@ import ApolloInternalTestHelpers class WatchQueryTests: XCTestCase, CacheDependentTesting { - var cacheType: TestCacheProvider.Type { + var cacheType: any TestCacheProvider.Type { InMemoryTestCacheProvider.self } static let defaultWaitTimeout: TimeInterval = 1 - var cache: NormalizedCache! + var cache: (any NormalizedCache)! var server: MockGraphQLServer! var client: ApolloClient! diff --git a/Tests/ApolloTests/CancellationHandlingInterceptor.swift b/Tests/ApolloTests/CancellationHandlingInterceptor.swift index 9955ea7a2..8da7dbefb 100644 --- a/Tests/ApolloTests/CancellationHandlingInterceptor.swift +++ b/Tests/ApolloTests/CancellationHandlingInterceptor.swift @@ -16,10 +16,10 @@ class CancellationHandlingInterceptor: ApolloInterceptor, Cancellable { public var id: String = UUID().uuidString func interceptAsync( - chain: RequestChain, + chain: any RequestChain, request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void) { + completion: @escaping (Result, any Error>) -> Void) { guard !self.hasBeenCancelled else { return diff --git a/Tests/ApolloTests/ClearCacheTests.swift b/Tests/ApolloTests/ClearCacheTests.swift index 54cc2578a..0be378ca0 100644 --- a/Tests/ApolloTests/ClearCacheTests.swift +++ b/Tests/ApolloTests/ClearCacheTests.swift @@ -7,7 +7,7 @@ class ClearCacheTests: XCTestCase { var store: ApolloStore! var server: MockGraphQLServer! - var transport: NetworkTransport! + var transport: (any NetworkTransport)! var client: ApolloClient! override func setUp() { diff --git a/Tests/ApolloTests/GraphQLExecutor_ResultNormalizer_FromResponse_Tests.swift b/Tests/ApolloTests/GraphQLExecutor_ResultNormalizer_FromResponse_Tests.swift index 9d9600f96..4f888c5c1 100644 --- a/Tests/ApolloTests/GraphQLExecutor_ResultNormalizer_FromResponse_Tests.swift +++ b/Tests/ApolloTests/GraphQLExecutor_ResultNormalizer_FromResponse_Tests.swift @@ -303,14 +303,14 @@ class GraphQLExecutor_ResultNormalizer_FromResponse_Tests: XCTestCase { ]} class AsHuman: MockTypeCase { - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("name", alias: "property", String.self) ]} } class AsDroid: MockTypeCase { - override class var __parentType: ParentType { Types.Droid } + override class var __parentType: any ParentType { Types.Droid } override class var __selections: [Selection] {[ .field("primaryFunction", alias: "property", String.self) ]} @@ -359,7 +359,7 @@ class GraphQLExecutor_ResultNormalizer_FromResponse_Tests: XCTestCase { ]} class AsHuman: MockTypeCase { - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("__typename", String.self), .field("name", alias: "property", String.self) @@ -367,7 +367,7 @@ class GraphQLExecutor_ResultNormalizer_FromResponse_Tests: XCTestCase { } class AsDroid: MockTypeCase { - override class var __parentType: ParentType { Types.Droid } + override class var __parentType: any ParentType { Types.Droid } override class var __selections: [Selection] {[ .field("__typename", String.self), .field("primaryFunction", alias: "property", String.self) @@ -417,7 +417,7 @@ class GraphQLExecutor_ResultNormalizer_FromResponse_Tests: XCTestCase { ]} class AsHuman: MockTypeCase { - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("friend", Friend.self), ]} @@ -430,7 +430,7 @@ class GraphQLExecutor_ResultNormalizer_FromResponse_Tests: XCTestCase { } class AsDroid: MockTypeCase { - override class var __parentType: ParentType { Types.Droid } + override class var __parentType: any ParentType { Types.Droid } override class var __selections: [Selection] {[ .field("friend", Friend.self), ]} @@ -490,7 +490,7 @@ class GraphQLExecutor_ResultNormalizer_FromResponse_Tests: XCTestCase { ]} class AsHuman: MockTypeCase { - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("friend", Friend.self), ]} @@ -503,7 +503,7 @@ class GraphQLExecutor_ResultNormalizer_FromResponse_Tests: XCTestCase { } class AsDroid: MockTypeCase { - override class var __parentType: ParentType { Types.Droid } + override class var __parentType: any ParentType { Types.Droid } override class var __selections: [Selection] {[ .field("friend", Friend.self), ]} diff --git a/Tests/ApolloTests/GraphQLExecutor_SelectionSetMapper_FromResponse_Tests.swift b/Tests/ApolloTests/GraphQLExecutor_SelectionSetMapper_FromResponse_Tests.swift index 9dd1bcad5..cf13826ba 100644 --- a/Tests/ApolloTests/GraphQLExecutor_SelectionSetMapper_FromResponse_Tests.swift +++ b/Tests/ApolloTests/GraphQLExecutor_SelectionSetMapper_FromResponse_Tests.swift @@ -847,7 +847,7 @@ class GraphQLExecutor_SelectionSetMapper_FromResponse_Tests: XCTestCase { class GivenSelectionSet: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Object.mock } + override class var __parentType: any ParentType { Object.mock } override class var __selections: [Selection] {[ .field("child", Child.self), ]} @@ -855,14 +855,14 @@ class GraphQLExecutor_SelectionSetMapper_FromResponse_Tests: XCTestCase { class Child: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.MockChildObject } + override class var __parentType: any ParentType { Types.MockChildObject } override class var __selections: [Selection] {[ .field("__typename", String.self), .inlineFragment(AsHuman.self) ]} class AsHuman: MockTypeCase { - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("name", String.self), ]} @@ -904,7 +904,7 @@ class GraphQLExecutor_SelectionSetMapper_FromResponse_Tests: XCTestCase { } class GivenFragment: MockFragment { - override class var __parentType: ParentType { Types.MockChildObject } + override class var __parentType: any ParentType { Types.MockChildObject } override class var __selections: [Selection] {[ .field("child", Child.self) ]} @@ -917,7 +917,7 @@ class GraphQLExecutor_SelectionSetMapper_FromResponse_Tests: XCTestCase { } class GivenSelectionSet: AbstractMockSelectionSet { - override class var __parentType: ParentType { Types.MockChildObject } + override class var __parentType: any ParentType { Types.MockChildObject } override class var __selections: [Selection] {[ .fragment(GivenFragment.self) ]} @@ -1162,7 +1162,7 @@ class GraphQLExecutor_SelectionSetMapper_FromResponse_Tests: XCTestCase { ]} class AsPerson: MockTypeCase { - override class var __parentType: ParentType { Types.Person } + override class var __parentType: any ParentType { Types.Person } override class var __selections: [Selection] {[ .field("name", String.self), ]} @@ -1196,7 +1196,7 @@ class GraphQLExecutor_SelectionSetMapper_FromResponse_Tests: XCTestCase { ]} class AsPerson: MockTypeCase { - override class var __parentType: ParentType { Types.Person } + override class var __parentType: any ParentType { Types.Person } override class var __selections: [Selection] {[ .field("name", String.self), ]} @@ -1230,7 +1230,7 @@ class GraphQLExecutor_SelectionSetMapper_FromResponse_Tests: XCTestCase { ]} class AsPerson: MockTypeCase { - override class var __parentType: ParentType { Types.Person } + override class var __parentType: any ParentType { Types.Person } override class var __selections: [Selection] {[ .field("name", String.self), ]} @@ -1264,7 +1264,7 @@ class GraphQLExecutor_SelectionSetMapper_FromResponse_Tests: XCTestCase { ]} class AsPerson: MockTypeCase { - override class var __parentType: ParentType { Types.Person } + override class var __parentType: any ParentType { Types.Person } override class var __selections: [Selection] {[ .include(if: "variable", .field("name", String.self)), ]} @@ -1298,7 +1298,7 @@ class GraphQLExecutor_SelectionSetMapper_FromResponse_Tests: XCTestCase { ]} class AsPerson: MockTypeCase { - override class var __parentType: ParentType { Types.Person } + override class var __parentType: any ParentType { Types.Person } override class var __selections: [Selection] {[ .include(if: "variable", .field("name", String.self)), ]} @@ -1337,7 +1337,7 @@ class GraphQLExecutor_SelectionSetMapper_FromResponse_Tests: XCTestCase { ]} class AsPerson: MockTypeCase { - override class var __parentType: ParentType { Types.Person } + override class var __parentType: any ParentType { Types.Person } override class var __selections: [Selection] {[ .fragment(GivenFragment.self), ]} @@ -1787,7 +1787,7 @@ class GraphQLExecutor_SelectionSetMapper_FromResponse_Tests: XCTestCase { class Character: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Character } + override class var __parentType: any ParentType { Types.Character } override class var __selections: [Selection] {[ .field("__typename", String.self), .field("friend", Friend.self), @@ -1799,7 +1799,7 @@ class GraphQLExecutor_SelectionSetMapper_FromResponse_Tests: XCTestCase { class Friend: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Character } + override class var __parentType: any ParentType { Types.Character } override class var __selections: [Selection] {[ .field("__typename", String.self), ]} @@ -1808,7 +1808,7 @@ class GraphQLExecutor_SelectionSetMapper_FromResponse_Tests: XCTestCase { class AsHero: ConcreteMockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Hero } + override class var __parentType: any ParentType { Types.Hero } override class var __selections: [Selection] {[ .field("friend", Friend.self), ]} @@ -1818,7 +1818,7 @@ class GraphQLExecutor_SelectionSetMapper_FromResponse_Tests: XCTestCase { class Friend: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Character } + override class var __parentType: any ParentType { Types.Character } override class var __selections: [Selection] {[ .field("heroName", String.self), ]} diff --git a/Tests/ApolloTests/JSONValueMatcher.swift b/Tests/ApolloTests/JSONValueMatcher.swift index 29beb8f4c..177a5a21b 100644 --- a/Tests/ApolloTests/JSONValueMatcher.swift +++ b/Tests/ApolloTests/JSONValueMatcher.swift @@ -2,7 +2,7 @@ import Nimble import Apollo import ApolloAPI -public func equalJSONValue(_ expectedValue: JSONEncodable?) -> Matcher { +public func equalJSONValue(_ expectedValue: (any JSONEncodable)?) -> Matcher { return Matcher { actual in let msg = ExpectationMessage.expectedActualValueTo("equal <\(stringify(expectedValue))>") if let actualValue = try actual.evaluate(), let expectedValue = expectedValue { diff --git a/Tests/ApolloTests/RequestBodyCreatorTests.swift b/Tests/ApolloTests/RequestBodyCreatorTests.swift index 69c0ccd67..098dc251a 100644 --- a/Tests/ApolloTests/RequestBodyCreatorTests.swift +++ b/Tests/ApolloTests/RequestBodyCreatorTests.swift @@ -15,7 +15,7 @@ import ApolloInternalTestHelpers class RequestBodyCreatorTests: XCTestCase { func create( - with creator: RequestBodyCreator, + with creator: any RequestBodyCreator, for operation: Operation ) -> JSONEncodableDictionary { creator.requestBody(for: operation, diff --git a/Tests/ApolloTests/RequestChainTests.swift b/Tests/ApolloTests/RequestChainTests.swift index e78e4e997..bc4f65064 100644 --- a/Tests/ApolloTests/RequestChainTests.swift +++ b/Tests/ApolloTests/RequestChainTests.swift @@ -73,14 +73,14 @@ class RequestChainTests: XCTestCase { func test__send__ErrorInterceptorGetsCalledAfterAnErrorIsReceived() { class ErrorInterceptor: ApolloErrorInterceptor { - var error: Error? = nil + var error: (any Error)? = nil func handleErrorAsync( - error: Error, - chain: RequestChain, + error: any Error, + chain: any RequestChain, request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void) { + completion: @escaping (Result, any Error>) -> Void) { self.error = error completion(.failure(error)) @@ -98,7 +98,7 @@ class RequestChainTests: XCTestCase { ] } - func additionalErrorInterceptor(for operation: Operation) -> ApolloErrorInterceptor? { + func additionalErrorInterceptor(for operation: Operation) -> (any ApolloErrorInterceptor)? { return self.errorInterceptor } } @@ -145,14 +145,14 @@ class RequestChainTests: XCTestCase { func test__upload__ErrorInterceptorGetsCalledAfterAnErrorIsReceived() throws { class ErrorInterceptor: ApolloErrorInterceptor { - var error: Error? = nil + var error: (any Error)? = nil func handleErrorAsync( - error: Error, - chain: RequestChain, + error: any Error, + chain: any RequestChain, request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void) { + completion: @escaping (Result, any Error>) -> Void) { self.error = error completion(.failure(error)) @@ -170,7 +170,7 @@ class RequestChainTests: XCTestCase { ] } - func additionalErrorInterceptor(for operation: Operation) -> ApolloErrorInterceptor? { + func additionalErrorInterceptor(for operation: Operation) -> (any ApolloErrorInterceptor)? { return self.errorInterceptor } } @@ -224,14 +224,14 @@ class RequestChainTests: XCTestCase { func testErrorInterceptorGetsCalledInDefaultInterceptorProviderSubclass() { class ErrorInterceptor: ApolloErrorInterceptor { - var error: Error? = nil + var error: (any Error)? = nil func handleErrorAsync( - error: Error, - chain: RequestChain, + error: any Error, + chain: any RequestChain, request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void) { + completion: @escaping (Result, any Error>) -> Void) { self.error = error completion(.failure(error)) @@ -250,7 +250,7 @@ class RequestChainTests: XCTestCase { ] } - override func additionalErrorInterceptor(for operation: Operation) -> ApolloErrorInterceptor? { + override func additionalErrorInterceptor(for operation: Operation) -> (any ApolloErrorInterceptor)? { return self.errorInterceptor } } @@ -307,10 +307,10 @@ class RequestChainTests: XCTestCase { } func interceptAsync( - chain: RequestChain, + chain: any RequestChain, request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error> + completion: @escaping (Result, any Error> ) -> Void) { callback(try! request.toURLRequest()) } @@ -495,10 +495,10 @@ class RequestChainTests: XCTestCase { } func interceptAsync( - chain: RequestChain, + chain: any RequestChain, request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error> + completion: @escaping (Result, any Error> ) -> Void) { DispatchQueue.main.asyncAfter(wallDeadline: DispatchWallTime.now() + seconds) { chain.proceedAsync( @@ -530,11 +530,11 @@ class RequestChainTests: XCTestCase { """.data(using: .utf8) ) - var requestChain: RequestChain? = InterceptorRequestChain(interceptors: [ + var requestChain: (any RequestChain)? = InterceptorRequestChain(interceptors: [ NetworkFetchInterceptor(client: client), JSONResponseParsingInterceptor() ]) - weak var weakRequestChain: RequestChain? = requestChain + weak var weakRequestChain: (any RequestChain)? = requestChain let expectedData = try Hero(data: [ "__typename": "Hero", @@ -608,12 +608,12 @@ class RequestChainTests: XCTestCase { """.crlfFormattedData() ) - var requestChain: RequestChain? = InterceptorRequestChain(interceptors: [ + var requestChain: (any RequestChain)? = InterceptorRequestChain(interceptors: [ NetworkFetchInterceptor(client: client), MultipartResponseParsingInterceptor(), JSONResponseParsingInterceptor() ]) - weak var weakRequestChain: RequestChain? = requestChain + weak var weakRequestChain: (any RequestChain)? = requestChain let expectedData = try Hero(data: [ "__typename": "Hero", @@ -773,12 +773,12 @@ class RequestChainTests: XCTestCase { data: nil ) - var requestChain: RequestChain? = InterceptorRequestChain(interceptors: [ + var requestChain: (any RequestChain)? = InterceptorRequestChain(interceptors: [ CacheReadInterceptor(store: store), NetworkFetchInterceptor(client: client), JSONResponseParsingInterceptor() ]) - weak var weakRequestChain: RequestChain? = requestChain + weak var weakRequestChain: (any RequestChain)? = requestChain let expectedData = try Hero(data: [ "__typename": "Hero", @@ -829,13 +829,13 @@ class RequestChainTests: XCTestCase { data: nil ) - var requestChain: RequestChain? = InterceptorRequestChain(interceptors: [ + var requestChain: (any RequestChain)? = InterceptorRequestChain(interceptors: [ CacheReadInterceptor(store: ApolloStore()), NetworkFetchInterceptor(client: client), JSONResponseParsingInterceptor() ]) - weak var weakRequestChain: RequestChain? = requestChain + weak var weakRequestChain: (any RequestChain)? = requestChain let expectation = expectation(description: "Response received") @@ -895,12 +895,12 @@ class RequestChainTests: XCTestCase { """.data(using: .utf8) ) - var requestChain: RequestChain? = InterceptorRequestChain(interceptors: [ + var requestChain: (any RequestChain)? = InterceptorRequestChain(interceptors: [ CacheReadInterceptor(store: store), NetworkFetchInterceptor(client: client), JSONResponseParsingInterceptor() ]) - weak var weakRequestChain: RequestChain? = requestChain + weak var weakRequestChain: (any RequestChain)? = requestChain let expectedData = try Hero(data: [ "__typename": "Hero", @@ -954,13 +954,13 @@ class RequestChainTests: XCTestCase { data: nil ) - var requestChain: RequestChain? = InterceptorRequestChain(interceptors: [ + var requestChain: (any RequestChain)? = InterceptorRequestChain(interceptors: [ CacheReadInterceptor(store: store), NetworkFetchInterceptor(client: client), JSONResponseParsingInterceptor() ]) - weak var weakRequestChain: RequestChain? = requestChain + weak var weakRequestChain: (any RequestChain)? = requestChain let expectation = expectation(description: "Response received") expectation.expectedFulfillmentCount = 2 @@ -1028,10 +1028,10 @@ class RequestChainTests: XCTestCase { let expectation: XCTestExpectation func interceptAsync( - chain: Apollo.RequestChain, + chain: any Apollo.RequestChain, request: Apollo.HTTPRequest, response: Apollo.HTTPResponse?, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) { expectation.fulfill() @@ -1045,10 +1045,10 @@ class RequestChainTests: XCTestCase { let expectation: XCTestExpectation func interceptAsync( - chain: Apollo.RequestChain, + chain: any Apollo.RequestChain, request: Apollo.HTTPRequest, response: Apollo.HTTPResponse?, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) { expectation.fulfill() diff --git a/Tests/ApolloTests/RetryToCountThenSucceedInterceptor.swift b/Tests/ApolloTests/RetryToCountThenSucceedInterceptor.swift index 062c396d7..bc19bcdb7 100644 --- a/Tests/ApolloTests/RetryToCountThenSucceedInterceptor.swift +++ b/Tests/ApolloTests/RetryToCountThenSucceedInterceptor.swift @@ -21,10 +21,10 @@ class RetryToCountThenSucceedInterceptor: ApolloInterceptor { } func interceptAsync( - chain: RequestChain, + chain: any RequestChain, request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void) { + completion: @escaping (Result, any Error>) -> Void) { if self.timesRetryHasBeenCalled < self.timesToCallRetry { self.timesRetryHasBeenCalled += 1 chain.retry(request: request, diff --git a/Tests/ApolloTests/SelectionSetTests.swift b/Tests/ApolloTests/SelectionSetTests.swift index c9e988c4b..7fdff67b9 100644 --- a/Tests/ApolloTests/SelectionSetTests.swift +++ b/Tests/ApolloTests/SelectionSetTests.swift @@ -650,7 +650,7 @@ class SelectionSetTests: XCTestCase { class AsHuman: MockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("name", String?.self) ]} @@ -659,7 +659,7 @@ class SelectionSetTests: XCTestCase { class AsDroid: MockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Droid } + override class var __parentType: any ParentType { Types.Droid } override class var __selections: [Selection] {[ .field("primaryFunction", String?.self) ]} @@ -706,7 +706,7 @@ class SelectionSetTests: XCTestCase { class AsHumanoid: MockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Humanoid } + override class var __parentType: any ParentType { Types.Humanoid } override class var __selections: [Selection] {[ .field("name", String.self) ]} @@ -753,7 +753,7 @@ class SelectionSetTests: XCTestCase { class AsHumanoid: MockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Humanoid } + override class var __parentType: any ParentType { Types.Humanoid } override class var __selections: [Selection] {[ .field("name", String.self) ]} @@ -800,7 +800,7 @@ class SelectionSetTests: XCTestCase { class AsCharacter: MockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Character } + override class var __parentType: any ParentType { Types.Character } override class var __selections: [Selection] {[ .field("name", String.self) ]} @@ -846,7 +846,7 @@ class SelectionSetTests: XCTestCase { class AsCharacter: MockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Character } + override class var __parentType: any ParentType { Types.Character } override class var __selections: [Selection] {[ .field("name", String.self) ]} @@ -882,7 +882,7 @@ class SelectionSetTests: XCTestCase { class RootData: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Query } + override class var __parentType: any ParentType { Types.Query } override class var __selections: [Selection] {[ .inlineFragment(AsAdminQuery.self), ]} @@ -892,7 +892,7 @@ class SelectionSetTests: XCTestCase { class AsAdminQuery: MockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.AdminQuery } + override class var __parentType: any ParentType { Types.AdminQuery } override class var __selections: [Selection] {[ .field("name", String.self) ]} @@ -994,7 +994,7 @@ class SelectionSetTests: XCTestCase { class Hero: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .inlineFragment(AsAnimal.self) ]} @@ -1004,7 +1004,7 @@ class SelectionSetTests: XCTestCase { class AsAnimal: ConcreteMockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Animal } + override class var __parentType: any ParentType { Types.Animal } override class var __selections: [Selection] {[ .field("name", String.self) ]} @@ -1052,7 +1052,7 @@ class SelectionSetTests: XCTestCase { class Data: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Query } + override class var __parentType: any ParentType { Types.Query } override class var __selections: [Selection] {[ .field("hero", Hero.self) ]} @@ -1071,7 +1071,7 @@ class SelectionSetTests: XCTestCase { class Hero: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .inlineFragment(AsAnimal.self) ]} @@ -1081,7 +1081,7 @@ class SelectionSetTests: XCTestCase { class AsAnimal: ConcreteMockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Animal } + override class var __parentType: any ParentType { Types.Animal } override class var __selections: [Selection] {[ .field("name", String.self) ]} @@ -1128,7 +1128,7 @@ class SelectionSetTests: XCTestCase { class Hero: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .include(if: "a", .inlineFragment(IfA.self)) ]} @@ -1139,7 +1139,7 @@ class SelectionSetTests: XCTestCase { typealias Schema = MockSchemaMetadata typealias RootEntityType = Hero - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("name", String.self) ]} @@ -1183,7 +1183,7 @@ class SelectionSetTests: XCTestCase { class Hero: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .include(if: "a", .inlineFragment(IfA.self)), .include(if: "b", .inlineFragment(IfB.self)) @@ -1194,7 +1194,7 @@ class SelectionSetTests: XCTestCase { class IfA: ConcreteMockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("name", String.self) ]} @@ -1214,7 +1214,7 @@ class SelectionSetTests: XCTestCase { } class IfB: ConcreteMockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ ]} } @@ -1245,7 +1245,7 @@ class SelectionSetTests: XCTestCase { class Data: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Query } + override class var __parentType: any ParentType { Types.Query } override class var __selections: [Selection] {[ .field("hero", Hero.self) ]} @@ -1264,7 +1264,7 @@ class SelectionSetTests: XCTestCase { class Hero: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .include(if: "a", .inlineFragment(IfA.self)), .include(if: "b", .inlineFragment(IfB.self)) @@ -1275,7 +1275,7 @@ class SelectionSetTests: XCTestCase { class IfA: ConcreteMockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("name", String.self), .field("friend", Friend.self) @@ -1300,7 +1300,7 @@ class SelectionSetTests: XCTestCase { class Friend: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .include(if: !"c", .inlineFragment(IfNotC.self)) ]} @@ -1309,7 +1309,7 @@ class SelectionSetTests: XCTestCase { class IfNotC: ConcreteMockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("name", String.self) ]} @@ -1332,7 +1332,7 @@ class SelectionSetTests: XCTestCase { class IfB: ConcreteMockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[]} convenience init() { @@ -1377,7 +1377,7 @@ class SelectionSetTests: XCTestCase { class Hero: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .include(if: "a", .inlineFragment(IfA.self)) ]} @@ -1386,7 +1386,7 @@ class SelectionSetTests: XCTestCase { class IfA: ConcreteMockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("name", String.self) ]} @@ -1432,7 +1432,7 @@ class SelectionSetTests: XCTestCase { class Hero: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("name", String?.self) ]} @@ -1493,7 +1493,7 @@ class SelectionSetTests: XCTestCase { class Hero: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("child", Child?.self) ]} @@ -1512,7 +1512,7 @@ class SelectionSetTests: XCTestCase { class Child: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("name", String?.self) ]} @@ -1575,7 +1575,7 @@ class SelectionSetTests: XCTestCase { class Hero: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("friends", [Friend?]?.self) ]} @@ -1594,7 +1594,7 @@ class SelectionSetTests: XCTestCase { class Friend: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("name", String.self) ]} @@ -1640,7 +1640,7 @@ class SelectionSetTests: XCTestCase { class Hero: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("names", [String?]?.self) ]} diff --git a/Tests/ApolloTests/SelectionSet_JSONInitializerTests.swift b/Tests/ApolloTests/SelectionSet_JSONInitializerTests.swift index 0683bafda..8767bbdfa 100644 --- a/Tests/ApolloTests/SelectionSet_JSONInitializerTests.swift +++ b/Tests/ApolloTests/SelectionSet_JSONInitializerTests.swift @@ -20,7 +20,7 @@ class SelectionSet_JSONInitializerTests: XCTestCase { } class GivenFragment: MockFragment { - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("height", Float.self) ]} @@ -30,7 +30,7 @@ class SelectionSet_JSONInitializerTests: XCTestCase { class Hero: AbstractMockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("__typename", String.self), .field("name", String?.self), @@ -72,7 +72,7 @@ class SelectionSet_JSONInitializerTests: XCTestCase { class Hero: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("__typename", String.self), .include(if: "includeName", .field("name", String.self)), @@ -107,7 +107,7 @@ class SelectionSet_JSONInitializerTests: XCTestCase { class Hero: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("__typename", String.self), .include(if: "includeName", .field("name", String.self)), @@ -144,7 +144,7 @@ class SelectionSet_JSONInitializerTests: XCTestCase { class Character: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Character } + override class var __parentType: any ParentType { Types.Character } override class var __selections: [Selection] {[ .field("__typename", String.self), .field("friend", Friend.self), @@ -159,7 +159,7 @@ class SelectionSet_JSONInitializerTests: XCTestCase { class Friend: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Character } + override class var __parentType: any ParentType { Types.Character } override class var __selections: [Selection] {[ .field("__typename", String.self), .inlineFragment(AsHuman.self), @@ -170,7 +170,7 @@ class SelectionSet_JSONInitializerTests: XCTestCase { class AsHuman: ConcreteMockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("name", String.self), ]} @@ -182,7 +182,7 @@ class SelectionSet_JSONInitializerTests: XCTestCase { class AsHero: ConcreteMockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Hero } + override class var __parentType: any ParentType { Types.Hero } override class var __selections: [Selection] {[ .field("friend", Friend.self), ]} @@ -192,7 +192,7 @@ class SelectionSet_JSONInitializerTests: XCTestCase { class Friend: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Character } + override class var __parentType: any ParentType { Types.Character } override class var __selections: [Selection] {[ .field("heroName", String.self), ]} @@ -204,7 +204,7 @@ class SelectionSet_JSONInitializerTests: XCTestCase { class AsHuman: MockTypeCase { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } override class var __selections: [Selection] {[ .field("name", String.self), ]} @@ -215,7 +215,7 @@ class SelectionSet_JSONInitializerTests: XCTestCase { class Friend: MockSelectionSet { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Character } + override class var __parentType: any ParentType { Types.Character } var heroName: String? { __data["heroName"] } var asHuman: AsHuman? { _asInlineFragment() } @@ -223,7 +223,7 @@ class SelectionSet_JSONInitializerTests: XCTestCase { class AsHuman: ConcreteMockTypeCase, CompositeInlineFragment { typealias Schema = MockSchemaMetadata - override class var __parentType: ParentType { Types.Human } + override class var __parentType: any ParentType { Types.Human } class var __mergedSources: [any SelectionSet.Type] { [ Character.Friend.AsHuman.self, Character.AsHero.Friend.self diff --git a/Tests/ApolloTests/TestMockTests.swift b/Tests/ApolloTests/TestMockTests.swift index b05f28af2..63a2e743d 100644 --- a/Tests/ApolloTests/TestMockTests.swift +++ b/Tests/ApolloTests/TestMockTests.swift @@ -175,15 +175,15 @@ class TestMockTests: XCTestCase { let cat2 = Mock() let dog1 = Mock() - let list: [AnyMock] = [cat1, cat2, dog1] + let list: [any AnyMock] = [cat1, cat2, dog1] let expected = NSArray(array: list) // when mock.listOfInterfaces = list // then - expect(expected.isEqual(mock._data["listOfInterfaces"] as? [AnyMock])).to(beTrue()) - expect(expected.isEqual(mock.listOfInterfaces as [AnyMock]?)).to(beTrue()) + expect(expected.isEqual(mock._data["listOfInterfaces"] as? [any AnyMock])).to(beTrue()) + expect(expected.isEqual(mock.listOfInterfaces as [any AnyMock]?)).to(beTrue()) } func test__mock__setNestedListOfInterfacesField__fieldIsSet() throws { @@ -193,15 +193,15 @@ class TestMockTests: XCTestCase { let cat2 = Mock() let dog1 = Mock() - let list: [[AnyMock]] = [[cat1, cat2, dog1]] + let list: [[any AnyMock]] = [[cat1, cat2, dog1]] let expected = NSArray(array: list) // when mock.nestedListOfInterfaces = list // then - expect(expected.isEqual(mock._data["nestedListOfInterfaces"] as? [[AnyMock]])).to(beTrue()) - expect(expected.isEqual(mock.nestedListOfInterfaces as [[AnyMock]]?)).to(beTrue()) + expect(expected.isEqual(mock._data["nestedListOfInterfaces"] as? [[any AnyMock]])).to(beTrue()) + expect(expected.isEqual(mock.nestedListOfInterfaces as [[any AnyMock]]?)).to(beTrue()) } func test__mock__setListOfOptionalInterfacesField__fieldIsSet() throws { @@ -210,15 +210,15 @@ class TestMockTests: XCTestCase { let cat1 = Mock() let cat2 = Mock() - let list: [AnyMock?] = [cat1, nil, cat2, nil] + let list: [(any AnyMock)?] = [cat1, nil, cat2, nil] let expected = NSArray(array: list as [Any]) // when mock.listOfOptionalInterfaces = list // then - expect(expected.isEqual(mock._data["listOfOptionalInterfaces"] as? [AnyMock?])).to(beTrue()) - expect(expected.isEqual(mock.listOfOptionalInterfaces as [AnyMock?]?)).to(beTrue()) + expect(expected.isEqual(mock._data["listOfOptionalInterfaces"] as? [(any AnyMock)?])).to(beTrue()) + expect(expected.isEqual(mock.listOfOptionalInterfaces as [(any AnyMock)?]?)).to(beTrue()) } func test__mock__givenFieldNamedHash_whenValueSetWithInitializer_shouldBuildAndFieldIsSet() throws { @@ -346,7 +346,7 @@ class TestMockTests: XCTestCase { func test__convertToSelectionSet_givenSelectionSetWithVariableForInclusionCondition_isTrue_canAccessConditionalField() throws { // given class Animal: TestMockSchema.MockSelectionSet { - override class var __parentType: ParentType { TestMockSchema.Interfaces.Animal } + override class var __parentType: any ParentType { TestMockSchema.Interfaces.Animal } override class var __selections: [Selection] {[ .include(if: "a", .inlineFragment(IfA.self)), ]} @@ -354,7 +354,7 @@ class TestMockTests: XCTestCase { var ifA: IfA? { _asInlineFragment() } class IfA: TestMockSchema.ConcreteMockTypeCase { - override class var __parentType: ParentType { TestMockSchema.Interfaces.Animal } + override class var __parentType: any ParentType { TestMockSchema.Interfaces.Animal } override class var __selections: [Selection] {[ .field("species", String.self), ]} @@ -376,7 +376,7 @@ class TestMockTests: XCTestCase { func test__convertToSelectionSet_givenSelectionSetWithVariableForInclusionCondition_isFalse_canNotAccessConditionalField() throws { // given class Animal: TestMockSchema.MockSelectionSet { - override class var __parentType: ParentType { TestMockSchema.Interfaces.Animal } + override class var __parentType: any ParentType { TestMockSchema.Interfaces.Animal } override class var __selections: [Selection] {[ .include(if: "a", .inlineFragment(IfA.self)), ]} @@ -384,7 +384,7 @@ class TestMockTests: XCTestCase { var ifA: IfA? { _asInlineFragment() } class IfA: TestMockSchema.ConcreteMockTypeCase { - override class var __parentType: ParentType { TestMockSchema.Interfaces.Animal } + override class var __parentType: any ParentType { TestMockSchema.Interfaces.Animal } override class var __selections: [Selection] {[ .field("species", String.self), ]} @@ -406,7 +406,7 @@ class TestMockTests: XCTestCase { func test__convertToSelectionSet_givenSelectionSetWithTypeCondition_canConvert_canAccessConditionalField() throws { // given class Animal: TestMockSchema.MockSelectionSet { - override class var __parentType: ParentType { TestMockSchema.Interfaces.Animal } + override class var __parentType: any ParentType { TestMockSchema.Interfaces.Animal } override class var __selections: [Selection] {[ .inlineFragment(AsDog.self), ]} @@ -414,7 +414,7 @@ class TestMockTests: XCTestCase { var asDog: AsDog? { _asInlineFragment() } class AsDog: TestMockSchema.ConcreteMockTypeCase { - override class var __parentType: ParentType { TestMockSchema.Types.Dog } + override class var __parentType: any ParentType { TestMockSchema.Types.Dog } override class var __selections: [Selection] {[ .field("species", String.self), ]} @@ -436,7 +436,7 @@ class TestMockTests: XCTestCase { func test__convertToSelectionSet_givenSelectionSetWithTypeCondition_canNotConvert_canNotAccessConditionalField() throws { // given class Animal: TestMockSchema.MockSelectionSet { - override class var __parentType: ParentType { TestMockSchema.Interfaces.Animal } + override class var __parentType: any ParentType { TestMockSchema.Interfaces.Animal } override class var __selections: [Selection] {[ .inlineFragment(AsDog.self), ]} @@ -444,7 +444,7 @@ class TestMockTests: XCTestCase { var asDog: AsDog? { _asInlineFragment() } class AsDog: TestMockSchema.ConcreteMockTypeCase { - override class var __parentType: ParentType { TestMockSchema.Types.Dog } + override class var __parentType: any ParentType { TestMockSchema.Types.Dog } override class var __selections: [Selection] {[ .field("species", String.self), ]} @@ -466,7 +466,7 @@ class TestMockTests: XCTestCase { func test__convertToSelectionSet_givenRequiredFieldNotInitialized_doesNotThrow() throws { // given class Animal: TestMockSchema.MockSelectionSet { - override class var __parentType: ParentType { TestMockSchema.Interfaces.Animal } + override class var __parentType: any ParentType { TestMockSchema.Interfaces.Animal } override class var __selections: [Selection] {[ .field("species", String.self), ]} @@ -486,7 +486,7 @@ class TestMockTests: XCTestCase { func test__convertToSelectionSet__givenGraphQLEnumField__canAccessField() throws { // given class Animal: TestMockSchema.MockSelectionSet { - override class var __parentType: ParentType { TestMockSchema.Interfaces.Animal } + override class var __parentType: any ParentType { TestMockSchema.Interfaces.Animal } override class var __selections: [Selection] {[ .field("speciesType", GraphQLEnum.self), ]} @@ -507,7 +507,7 @@ class TestMockTests: XCTestCase { func test__convertToSelectionSet__setNestedListOfObjectsField__canAccessField() throws { // given class Animal: TestMockSchema.MockSelectionSet { - override class var __parentType: ParentType { TestMockSchema.Interfaces.Animal } + override class var __parentType: any ParentType { TestMockSchema.Interfaces.Animal } override class var __selections: [Selection] {[ .field("nestedListOfObjects", [[CatData]].self), ]} @@ -515,7 +515,7 @@ class TestMockTests: XCTestCase { var nestedListOfObjects: [[CatData]] { __data["nestedListOfObjects"] } class CatData: TestMockSchema.MockSelectionSet { - override class var __parentType: ParentType { TestMockSchema.Types.Cat } + override class var __parentType: any ParentType { TestMockSchema.Types.Cat } override class var __selections: [Selection] {[ .field("species", String.self), ]} @@ -555,7 +555,7 @@ enum TestMockSchema: SchemaMetadata { } } - static var configuration: SchemaConfiguration.Type { Configuration.self } + static var configuration: any SchemaConfiguration.Type { Configuration.self } enum Configuration: SchemaConfiguration { static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? { diff --git a/Tests/CodegenCLITests/Matchers/ErrorMatchers.swift b/Tests/CodegenCLITests/Matchers/ErrorMatchers.swift index 90ff5edae..808ab6e4a 100644 --- a/Tests/CodegenCLITests/Matchers/ErrorMatchers.swift +++ b/Tests/CodegenCLITests/Matchers/ErrorMatchers.swift @@ -6,7 +6,7 @@ public func throwUserValidationError( _ expectedError: ValidationError ) -> Nimble.Matcher { return Matcher { actualExpression in - var actualError: Error? + var actualError: (any Error)? do { _ = try actualExpression.evaluate() } catch { @@ -43,7 +43,7 @@ public func throwUserValidationError( public func throwUnknownOptionError() -> Nimble.Matcher { return Matcher { actualExpression in - var actualError: Error? + var actualError: (any Error)? do { _ = try actualExpression.evaluate() } catch { @@ -79,7 +79,7 @@ public func throwError( ignoringExtraCharacters: Bool = false ) -> Nimble.Matcher { return Matcher { actualExpression in - var actualError: Error? + var actualError: (any Error)? do { _ = try actualExpression.evaluate() } catch { diff --git a/Tests/CodegenCLITests/Support/MockApolloSchemaDownloader.swift b/Tests/CodegenCLITests/Support/MockApolloSchemaDownloader.swift index eab9b157c..fa636730e 100644 --- a/Tests/CodegenCLITests/Support/MockApolloSchemaDownloader.swift +++ b/Tests/CodegenCLITests/Support/MockApolloSchemaDownloader.swift @@ -8,7 +8,7 @@ class MockApolloSchemaDownloader: SchemaDownloadProvider { static func fetch( configuration: ApolloSchemaDownloadConfiguration, withRootURL rootURL: URL?, - session: NetworkSession? + session: (any NetworkSession)? ) throws { guard let handler = fetchHandler else { fatalError("You must set fetchHandler before calling \(#function)!") diff --git a/Tests/CodegenCLITests/Support/MockLogLevelSetter.swift b/Tests/CodegenCLITests/Support/MockLogLevelSetter.swift index 5ffaf7f73..d518dda01 100644 --- a/Tests/CodegenCLITests/Support/MockLogLevelSetter.swift +++ b/Tests/CodegenCLITests/Support/MockLogLevelSetter.swift @@ -3,7 +3,7 @@ import CodegenCLI import ApolloCodegenLib extension LogLevelSetter { - static var mock: LogLevelSetter.Type { + static var mock: any LogLevelSetter.Type { MockLogLevelSetter.self } } diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework.xcodeproj/project.pbxproj b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework.xcodeproj/project.pbxproj index 95e53dd6e..649bac19b 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework.xcodeproj/project.pbxproj +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework.xcodeproj/project.pbxproj @@ -3,16 +3,100 @@ archiveVersion = 1; classes = { }; - objectVersion = 56; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ - 665BDB642B03DE8C004DD21F /* MyAPI in Resources */ = {isa = PBXBuildFile; fileRef = 665BDB632B03DE8C004DD21F /* MyAPI */; }; + DE4790F42C10D8F700939CCC /* ClassroomPetDetails.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790BE2C10D8E000939CCC /* ClassroomPetDetails.graphql.swift */; }; + DE4790F52C10D8FA00939CCC /* CrocodileFragment.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790BF2C10D8E000939CCC /* CrocodileFragment.graphql.swift */; }; + DE4790F62C10D8FC00939CCC /* DogFragment.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790C02C10D8E000939CCC /* DogFragment.graphql.swift */; }; + DE4790F72C10D8FF00939CCC /* HeightInMeters.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790C12C10D8E000939CCC /* HeightInMeters.graphql.swift */; }; + DE4790F82C10D90300939CCC /* PetDetails.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790C22C10D8E000939CCC /* PetDetails.graphql.swift */; }; + DE4790F92C10D90500939CCC /* WarmBloodedDetails.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790C32C10D8E000939CCC /* WarmBloodedDetails.graphql.swift */; }; + DE4790FA2C10D90800939CCC /* AllAnimalsLocalCacheMutation.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790C52C10D8E000939CCC /* AllAnimalsLocalCacheMutation.graphql.swift */; }; + DE4790FB2C10D90A00939CCC /* PetDetailsMutation.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790C62C10D8E000939CCC /* PetDetailsMutation.graphql.swift */; }; + DE4790FC2C10D90B00939CCC /* PetSearchLocalCacheMutation.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790C72C10D8E000939CCC /* PetSearchLocalCacheMutation.graphql.swift */; }; + DE4790FD2C10D91000939CCC /* PetAdoptionMutation.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790C92C10D8E000939CCC /* PetAdoptionMutation.graphql.swift */; }; + DE4790FE2C10D91200939CCC /* AllAnimalsIncludeSkipQuery.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790CB2C10D8E000939CCC /* AllAnimalsIncludeSkipQuery.graphql.swift */; }; + DE4790FF2C10D91400939CCC /* AllAnimalsQuery.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790CC2C10D8E000939CCC /* AllAnimalsQuery.graphql.swift */; }; + DE4791002C10D91500939CCC /* ClassroomPetsQuery.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790CD2C10D8E000939CCC /* ClassroomPetsQuery.graphql.swift */; }; + DE4791012C10D91600939CCC /* DogQuery.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790CE2C10D8E000939CCC /* DogQuery.graphql.swift */; }; + DE4791022C10D91700939CCC /* PetSearchQuery.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790CF2C10D8E000939CCC /* PetSearchQuery.graphql.swift */; }; + DE4791032C10D91A00939CCC /* MyAPI.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790F22C10D8E000939CCC /* MyAPI.graphql.swift */; }; + DE4791042C10D91D00939CCC /* CustomDate.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790D22C10D8E000939CCC /* CustomDate.swift */; }; + DE4791052C10D91F00939CCC /* Object.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790D32C10D8E000939CCC /* Object.swift */; }; + DE4791062C10D92600939CCC /* RelativeSize.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790D52C10D8E000939CCC /* RelativeSize.graphql.swift */; }; + DE4791072C10D92700939CCC /* SkinCovering.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790D62C10D8E000939CCC /* SkinCovering.graphql.swift */; }; + DE4791082C10D92900939CCC /* MeasurementsInput.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790D82C10D8E000939CCC /* MeasurementsInput.graphql.swift */; }; + DE4791092C10D92E00939CCC /* PetSearchFilters.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790DA2C10D8E000939CCC /* PetSearchFilters.graphql.swift */; }; + DE47910A2C10D93700939CCC /* PetAdoptionInput.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790D92C10D8E000939CCC /* PetAdoptionInput.graphql.swift */; }; + DE47910B2C10D93D00939CCC /* Animal.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790DC2C10D8E000939CCC /* Animal.graphql.swift */; }; + DE47910C2C10D93E00939CCC /* HousePet.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790DD2C10D8E000939CCC /* HousePet.graphql.swift */; }; + DE47910D2C10D93F00939CCC /* Pet.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790DE2C10D8E000939CCC /* Pet.graphql.swift */; }; + DE47910E2C10D94000939CCC /* WarmBlooded.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790DF2C10D8E000939CCC /* WarmBlooded.graphql.swift */; }; + DE4791102C10D96B00939CCC /* Bird.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790E12C10D8E000939CCC /* Bird.graphql.swift */; }; + DE4791112C10D96D00939CCC /* Cat.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790E22C10D8E000939CCC /* Cat.graphql.swift */; }; + DE4791122C10D97000939CCC /* Crocodile.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790E32C10D8E000939CCC /* Crocodile.graphql.swift */; }; + DE4791132C10D97100939CCC /* Dog.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790E42C10D8E000939CCC /* Dog.graphql.swift */; }; + DE4791142C10D97300939CCC /* Fish.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790E52C10D8E000939CCC /* Fish.graphql.swift */; }; + DE4791152C10D97400939CCC /* Height.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790E62C10D8E000939CCC /* Height.graphql.swift */; }; + DE4791162C10D97500939CCC /* Human.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790E72C10D8E000939CCC /* Human.graphql.swift */; }; + DE4791172C10D97700939CCC /* Mutation.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790E82C10D8E000939CCC /* Mutation.graphql.swift */; }; + DE4791182C10D97900939CCC /* PetRock.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790E92C10D8E000939CCC /* PetRock.graphql.swift */; }; + DE4791192C10D97C00939CCC /* Query.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790EA2C10D8E000939CCC /* Query.graphql.swift */; }; + DE47911A2C10D97E00939CCC /* Rat.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790EB2C10D8E000939CCC /* Rat.graphql.swift */; }; + DE47911B2C10D98200939CCC /* ClassroomPet.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790ED2C10D8E000939CCC /* ClassroomPet.graphql.swift */; }; + DE47911C2C10D98300939CCC /* SchemaConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790EF2C10D8E000939CCC /* SchemaConfiguration.swift */; }; + DE47911D2C10D98400939CCC /* SchemaMetadata.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4790F02C10D8E000939CCC /* SchemaMetadata.graphql.swift */; }; + DE4791202C10DDF900939CCC /* Apollo in Frameworks */ = {isa = PBXBuildFile; productRef = DE47911F2C10DDF900939CCC /* Apollo */; }; + DE4791222C10DDF900939CCC /* ApolloAPI in Frameworks */ = {isa = PBXBuildFile; productRef = DE4791212C10DDF900939CCC /* ApolloAPI */; }; + DE4791242C10E91500939CCC /* ID.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4791232C10E91500939CCC /* ID.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 665BDB592B029D6F004DD21F /* CodegenXCFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CodegenXCFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 665BDB632B03DE8C004DD21F /* MyAPI */ = {isa = PBXFileReference; lastKnownFileType = folder; path = MyAPI; sourceTree = ""; }; + DE4790BE2C10D8E000939CCC /* ClassroomPetDetails.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClassroomPetDetails.graphql.swift; sourceTree = ""; }; + DE4790BF2C10D8E000939CCC /* CrocodileFragment.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrocodileFragment.graphql.swift; sourceTree = ""; }; + DE4790C02C10D8E000939CCC /* DogFragment.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DogFragment.graphql.swift; sourceTree = ""; }; + DE4790C12C10D8E000939CCC /* HeightInMeters.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeightInMeters.graphql.swift; sourceTree = ""; }; + DE4790C22C10D8E000939CCC /* PetDetails.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PetDetails.graphql.swift; sourceTree = ""; }; + DE4790C32C10D8E000939CCC /* WarmBloodedDetails.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WarmBloodedDetails.graphql.swift; sourceTree = ""; }; + DE4790C52C10D8E000939CCC /* AllAnimalsLocalCacheMutation.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllAnimalsLocalCacheMutation.graphql.swift; sourceTree = ""; }; + DE4790C62C10D8E000939CCC /* PetDetailsMutation.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PetDetailsMutation.graphql.swift; sourceTree = ""; }; + DE4790C72C10D8E000939CCC /* PetSearchLocalCacheMutation.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PetSearchLocalCacheMutation.graphql.swift; sourceTree = ""; }; + DE4790C92C10D8E000939CCC /* PetAdoptionMutation.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PetAdoptionMutation.graphql.swift; sourceTree = ""; }; + DE4790CB2C10D8E000939CCC /* AllAnimalsIncludeSkipQuery.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllAnimalsIncludeSkipQuery.graphql.swift; sourceTree = ""; }; + DE4790CC2C10D8E000939CCC /* AllAnimalsQuery.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllAnimalsQuery.graphql.swift; sourceTree = ""; }; + DE4790CD2C10D8E000939CCC /* ClassroomPetsQuery.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClassroomPetsQuery.graphql.swift; sourceTree = ""; }; + DE4790CE2C10D8E000939CCC /* DogQuery.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DogQuery.graphql.swift; sourceTree = ""; }; + DE4790CF2C10D8E000939CCC /* PetSearchQuery.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PetSearchQuery.graphql.swift; sourceTree = ""; }; + DE4790D22C10D8E000939CCC /* CustomDate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomDate.swift; sourceTree = ""; }; + DE4790D32C10D8E000939CCC /* Object.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Object.swift; sourceTree = ""; }; + DE4790D52C10D8E000939CCC /* RelativeSize.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RelativeSize.graphql.swift; sourceTree = ""; }; + DE4790D62C10D8E000939CCC /* SkinCovering.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SkinCovering.graphql.swift; sourceTree = ""; }; + DE4790D82C10D8E000939CCC /* MeasurementsInput.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeasurementsInput.graphql.swift; sourceTree = ""; }; + DE4790D92C10D8E000939CCC /* PetAdoptionInput.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PetAdoptionInput.graphql.swift; sourceTree = ""; }; + DE4790DA2C10D8E000939CCC /* PetSearchFilters.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PetSearchFilters.graphql.swift; sourceTree = ""; }; + DE4790DC2C10D8E000939CCC /* Animal.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Animal.graphql.swift; sourceTree = ""; }; + DE4790DD2C10D8E000939CCC /* HousePet.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HousePet.graphql.swift; sourceTree = ""; }; + DE4790DE2C10D8E000939CCC /* Pet.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pet.graphql.swift; sourceTree = ""; }; + DE4790DF2C10D8E000939CCC /* WarmBlooded.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WarmBlooded.graphql.swift; sourceTree = ""; }; + DE4790E12C10D8E000939CCC /* Bird.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Bird.graphql.swift; sourceTree = ""; }; + DE4790E22C10D8E000939CCC /* Cat.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cat.graphql.swift; sourceTree = ""; }; + DE4790E32C10D8E000939CCC /* Crocodile.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Crocodile.graphql.swift; sourceTree = ""; }; + DE4790E42C10D8E000939CCC /* Dog.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dog.graphql.swift; sourceTree = ""; }; + DE4790E52C10D8E000939CCC /* Fish.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Fish.graphql.swift; sourceTree = ""; }; + DE4790E62C10D8E000939CCC /* Height.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Height.graphql.swift; sourceTree = ""; }; + DE4790E72C10D8E000939CCC /* Human.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Human.graphql.swift; sourceTree = ""; }; + DE4790E82C10D8E000939CCC /* Mutation.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Mutation.graphql.swift; sourceTree = ""; }; + DE4790E92C10D8E000939CCC /* PetRock.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PetRock.graphql.swift; sourceTree = ""; }; + DE4790EA2C10D8E000939CCC /* Query.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Query.graphql.swift; sourceTree = ""; }; + DE4790EB2C10D8E000939CCC /* Rat.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Rat.graphql.swift; sourceTree = ""; }; + DE4790ED2C10D8E000939CCC /* ClassroomPet.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClassroomPet.graphql.swift; sourceTree = ""; }; + DE4790EF2C10D8E000939CCC /* SchemaConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SchemaConfiguration.swift; sourceTree = ""; }; + DE4790F02C10D8E000939CCC /* SchemaMetadata.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SchemaMetadata.graphql.swift; sourceTree = ""; }; + DE4790F22C10D8E000939CCC /* MyAPI.graphql.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyAPI.graphql.swift; sourceTree = ""; }; + DE4791232C10E91500939CCC /* ID.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ID.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -20,6 +104,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + DE4791222C10DDF900939CCC /* ApolloAPI in Frameworks */, + DE4791202C10DDF900939CCC /* Apollo in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -29,7 +115,7 @@ 665BDB4F2B029D6F004DD21F = { isa = PBXGroup; children = ( - 665BDB5B2B029D6F004DD21F /* CodegenXCFramework */, + DE4790F32C10D8E000939CCC /* MyAPI */, 665BDB5A2B029D6F004DD21F /* Products */, ); sourceTree = ""; @@ -42,12 +128,150 @@ name = Products; sourceTree = ""; }; - 665BDB5B2B029D6F004DD21F /* CodegenXCFramework */ = { + DE4790C42C10D8E000939CCC /* Fragments */ = { isa = PBXGroup; children = ( - 665BDB632B03DE8C004DD21F /* MyAPI */, + DE4790BE2C10D8E000939CCC /* ClassroomPetDetails.graphql.swift */, + DE4790BF2C10D8E000939CCC /* CrocodileFragment.graphql.swift */, + DE4790C02C10D8E000939CCC /* DogFragment.graphql.swift */, + DE4790C12C10D8E000939CCC /* HeightInMeters.graphql.swift */, + DE4790C22C10D8E000939CCC /* PetDetails.graphql.swift */, + DE4790C32C10D8E000939CCC /* WarmBloodedDetails.graphql.swift */, ); - path = CodegenXCFramework; + path = Fragments; + sourceTree = ""; + }; + DE4790C82C10D8E000939CCC /* LocalCacheMutations */ = { + isa = PBXGroup; + children = ( + DE4790C52C10D8E000939CCC /* AllAnimalsLocalCacheMutation.graphql.swift */, + DE4790C62C10D8E000939CCC /* PetDetailsMutation.graphql.swift */, + DE4790C72C10D8E000939CCC /* PetSearchLocalCacheMutation.graphql.swift */, + ); + path = LocalCacheMutations; + sourceTree = ""; + }; + DE4790CA2C10D8E000939CCC /* Mutations */ = { + isa = PBXGroup; + children = ( + DE4790C92C10D8E000939CCC /* PetAdoptionMutation.graphql.swift */, + ); + path = Mutations; + sourceTree = ""; + }; + DE4790D02C10D8E000939CCC /* Queries */ = { + isa = PBXGroup; + children = ( + DE4790CB2C10D8E000939CCC /* AllAnimalsIncludeSkipQuery.graphql.swift */, + DE4790CC2C10D8E000939CCC /* AllAnimalsQuery.graphql.swift */, + DE4790CD2C10D8E000939CCC /* ClassroomPetsQuery.graphql.swift */, + DE4790CE2C10D8E000939CCC /* DogQuery.graphql.swift */, + DE4790CF2C10D8E000939CCC /* PetSearchQuery.graphql.swift */, + ); + path = Queries; + sourceTree = ""; + }; + DE4790D12C10D8E000939CCC /* Operations */ = { + isa = PBXGroup; + children = ( + DE4790CA2C10D8E000939CCC /* Mutations */, + DE4790D02C10D8E000939CCC /* Queries */, + ); + path = Operations; + sourceTree = ""; + }; + DE4790D42C10D8E000939CCC /* CustomScalars */ = { + isa = PBXGroup; + children = ( + DE4790D22C10D8E000939CCC /* CustomDate.swift */, + DE4791232C10E91500939CCC /* ID.swift */, + DE4790D32C10D8E000939CCC /* Object.swift */, + ); + path = CustomScalars; + sourceTree = ""; + }; + DE4790D72C10D8E000939CCC /* Enums */ = { + isa = PBXGroup; + children = ( + DE4790D52C10D8E000939CCC /* RelativeSize.graphql.swift */, + DE4790D62C10D8E000939CCC /* SkinCovering.graphql.swift */, + ); + path = Enums; + sourceTree = ""; + }; + DE4790DB2C10D8E000939CCC /* InputObjects */ = { + isa = PBXGroup; + children = ( + DE4790D82C10D8E000939CCC /* MeasurementsInput.graphql.swift */, + DE4790D92C10D8E000939CCC /* PetAdoptionInput.graphql.swift */, + DE4790DA2C10D8E000939CCC /* PetSearchFilters.graphql.swift */, + ); + path = InputObjects; + sourceTree = ""; + }; + DE4790E02C10D8E000939CCC /* Interfaces */ = { + isa = PBXGroup; + children = ( + DE4790DC2C10D8E000939CCC /* Animal.graphql.swift */, + DE4790DD2C10D8E000939CCC /* HousePet.graphql.swift */, + DE4790DE2C10D8E000939CCC /* Pet.graphql.swift */, + DE4790DF2C10D8E000939CCC /* WarmBlooded.graphql.swift */, + ); + path = Interfaces; + sourceTree = ""; + }; + DE4790EC2C10D8E000939CCC /* Objects */ = { + isa = PBXGroup; + children = ( + DE4790E12C10D8E000939CCC /* Bird.graphql.swift */, + DE4790E22C10D8E000939CCC /* Cat.graphql.swift */, + DE4790E32C10D8E000939CCC /* Crocodile.graphql.swift */, + DE4790E42C10D8E000939CCC /* Dog.graphql.swift */, + DE4790E52C10D8E000939CCC /* Fish.graphql.swift */, + DE4790E62C10D8E000939CCC /* Height.graphql.swift */, + DE4790E72C10D8E000939CCC /* Human.graphql.swift */, + DE4790E82C10D8E000939CCC /* Mutation.graphql.swift */, + DE4790E92C10D8E000939CCC /* PetRock.graphql.swift */, + DE4790EA2C10D8E000939CCC /* Query.graphql.swift */, + DE4790EB2C10D8E000939CCC /* Rat.graphql.swift */, + ); + path = Objects; + sourceTree = ""; + }; + DE4790EE2C10D8E000939CCC /* Unions */ = { + isa = PBXGroup; + children = ( + DE4790ED2C10D8E000939CCC /* ClassroomPet.graphql.swift */, + ); + path = Unions; + sourceTree = ""; + }; + DE4790F12C10D8E000939CCC /* Schema */ = { + isa = PBXGroup; + children = ( + DE4790D42C10D8E000939CCC /* CustomScalars */, + DE4790D72C10D8E000939CCC /* Enums */, + DE4790DB2C10D8E000939CCC /* InputObjects */, + DE4790E02C10D8E000939CCC /* Interfaces */, + DE4790EC2C10D8E000939CCC /* Objects */, + DE4790EE2C10D8E000939CCC /* Unions */, + DE4790EF2C10D8E000939CCC /* SchemaConfiguration.swift */, + DE4790F02C10D8E000939CCC /* SchemaMetadata.graphql.swift */, + ); + path = Schema; + sourceTree = ""; + }; + DE4790F32C10D8E000939CCC /* MyAPI */ = { + isa = PBXGroup; + children = ( + DE4790C42C10D8E000939CCC /* Fragments */, + DE4790C82C10D8E000939CCC /* LocalCacheMutations */, + DE4790D12C10D8E000939CCC /* Operations */, + DE4790F12C10D8E000939CCC /* Schema */, + DE4790F22C10D8E000939CCC /* MyAPI.graphql.swift */, + ); + name = MyAPI; + path = CodegenXCFramework/MyAPI; sourceTree = ""; }; /* End PBXGroup section */ @@ -77,6 +301,10 @@ dependencies = ( ); name = CodegenXCFramework; + packageProductDependencies = ( + DE47911F2C10DDF900939CCC /* Apollo */, + DE4791212C10DDF900939CCC /* ApolloAPI */, + ); productName = CodegenXCFramework; productReference = 665BDB592B029D6F004DD21F /* CodegenXCFramework.framework */; productType = "com.apple.product-type.framework"; @@ -88,7 +316,7 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = 1; - LastUpgradeCheck = 1500; + LastUpgradeCheck = 1540; TargetAttributes = { 665BDB582B029D6F004DD21F = { CreatedOnToolsVersion = 15.0; @@ -104,6 +332,9 @@ Base, ); mainGroup = 665BDB4F2B029D6F004DD21F; + packageReferences = ( + DE47911E2C10DDF900939CCC /* XCLocalSwiftPackageReference "../../../apollo-ios" */, + ); productRefGroup = 665BDB5A2B029D6F004DD21F /* Products */; projectDirPath = ""; projectRoot = ""; @@ -118,7 +349,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 665BDB642B03DE8C004DD21F /* MyAPI in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -129,6 +359,48 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + DE4790FA2C10D90800939CCC /* AllAnimalsLocalCacheMutation.graphql.swift in Sources */, + DE4790F72C10D8FF00939CCC /* HeightInMeters.graphql.swift in Sources */, + DE4790F42C10D8F700939CCC /* ClassroomPetDetails.graphql.swift in Sources */, + DE4790FC2C10D90B00939CCC /* PetSearchLocalCacheMutation.graphql.swift in Sources */, + DE4790F82C10D90300939CCC /* PetDetails.graphql.swift in Sources */, + DE4790FD2C10D91000939CCC /* PetAdoptionMutation.graphql.swift in Sources */, + DE4790FE2C10D91200939CCC /* AllAnimalsIncludeSkipQuery.graphql.swift in Sources */, + DE4790FF2C10D91400939CCC /* AllAnimalsQuery.graphql.swift in Sources */, + DE4791002C10D91500939CCC /* ClassroomPetsQuery.graphql.swift in Sources */, + DE4791022C10D91700939CCC /* PetSearchQuery.graphql.swift in Sources */, + DE4791012C10D91600939CCC /* DogQuery.graphql.swift in Sources */, + DE4790FB2C10D90A00939CCC /* PetDetailsMutation.graphql.swift in Sources */, + DE4790F62C10D8FC00939CCC /* DogFragment.graphql.swift in Sources */, + DE4791052C10D91F00939CCC /* Object.swift in Sources */, + DE4791042C10D91D00939CCC /* CustomDate.swift in Sources */, + DE4790F92C10D90500939CCC /* WarmBloodedDetails.graphql.swift in Sources */, + DE47910A2C10D93700939CCC /* PetAdoptionInput.graphql.swift in Sources */, + DE4791082C10D92900939CCC /* MeasurementsInput.graphql.swift in Sources */, + DE47910B2C10D93D00939CCC /* Animal.graphql.swift in Sources */, + DE4791102C10D96B00939CCC /* Bird.graphql.swift in Sources */, + DE4791112C10D96D00939CCC /* Cat.graphql.swift in Sources */, + DE4791122C10D97000939CCC /* Crocodile.graphql.swift in Sources */, + DE4791132C10D97100939CCC /* Dog.graphql.swift in Sources */, + DE4791142C10D97300939CCC /* Fish.graphql.swift in Sources */, + DE4791152C10D97400939CCC /* Height.graphql.swift in Sources */, + DE4791162C10D97500939CCC /* Human.graphql.swift in Sources */, + DE4791172C10D97700939CCC /* Mutation.graphql.swift in Sources */, + DE47911D2C10D98400939CCC /* SchemaMetadata.graphql.swift in Sources */, + DE47911A2C10D97E00939CCC /* Rat.graphql.swift in Sources */, + DE47911C2C10D98300939CCC /* SchemaConfiguration.swift in Sources */, + DE4791192C10D97C00939CCC /* Query.graphql.swift in Sources */, + DE47911B2C10D98200939CCC /* ClassroomPet.graphql.swift in Sources */, + DE4791242C10E91500939CCC /* ID.swift in Sources */, + DE4791182C10D97900939CCC /* PetRock.graphql.swift in Sources */, + DE47910D2C10D93F00939CCC /* Pet.graphql.swift in Sources */, + DE4791092C10D92E00939CCC /* PetSearchFilters.graphql.swift in Sources */, + DE47910C2C10D93E00939CCC /* HousePet.graphql.swift in Sources */, + DE47910E2C10D94000939CCC /* WarmBlooded.graphql.swift in Sources */, + DE4791072C10D92700939CCC /* SkinCovering.graphql.swift in Sources */, + DE4791062C10D92600939CCC /* RelativeSize.graphql.swift in Sources */, + DE4790F52C10D8FA00939CCC /* CrocodileFragment.graphql.swift in Sources */, + DE4791032C10D91A00939CCC /* MyAPI.graphql.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -193,6 +465,7 @@ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; + OTHER_SWIFT_FLAGS = "-enable-upcoming-feature ExistentialAny"; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -252,6 +525,7 @@ LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; + OTHER_SWIFT_FLAGS = "-enable-upcoming-feature ExistentialAny"; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; VALIDATE_PRODUCT = YES; @@ -263,6 +537,7 @@ 665BDB612B029D6F004DD21F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; @@ -293,6 +568,7 @@ 665BDB622B029D6F004DD21F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; @@ -342,6 +618,24 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + DE47911E2C10DDF900939CCC /* XCLocalSwiftPackageReference "../../../apollo-ios" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = "../../../apollo-ios"; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + DE47911F2C10DDF900939CCC /* Apollo */ = { + isa = XCSwiftPackageProductDependency; + productName = Apollo; + }; + DE4791212C10DDF900939CCC /* ApolloAPI */ = { + isa = XCSwiftPackageProductDependency; + productName = ApolloAPI; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 665BDB502B029D6F004DD21F /* Project object */; } diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/ClassroomPetDetails.graphql.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/ClassroomPetDetails.graphql.swift index b0c555d8a..1e0b81baf 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/ClassroomPetDetails.graphql.swift +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/ClassroomPetDetails.graphql.swift @@ -12,7 +12,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Unions.ClassroomPet } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Unions.ClassroomPet } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .inlineFragment(AsAnimal.self), @@ -38,7 +38,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetDetails - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.Animal } public static var __selections: [ApolloAPI.Selection] { [ .field("species", String.self), ] } @@ -54,7 +54,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetDetails - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.Pet } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.Pet } public static var __selections: [ApolloAPI.Selection] { [ .field("humanName", String?.self), ] } @@ -70,7 +70,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetDetails - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.WarmBlooded } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.WarmBlooded } public static var __selections: [ApolloAPI.Selection] { [ .field("laysEggs", Bool.self), ] } @@ -87,7 +87,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetDetails - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Cat } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Cat } public static var __selections: [ApolloAPI.Selection] { [ .field("bodyTemperature", Int.self), .field("isJellicle", Bool.self), @@ -108,7 +108,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetDetails - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Bird } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Bird } public static var __selections: [ApolloAPI.Selection] { [ .field("wingspan", Double.self), ] } @@ -127,7 +127,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetDetails - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.PetRock } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.PetRock } public static var __selections: [ApolloAPI.Selection] { [ .field("favoriteToy", String.self), ] } diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/CrocodileFragment.graphql.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/CrocodileFragment.graphql.swift index f1270487e..e3371cec1 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/CrocodileFragment.graphql.swift +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/CrocodileFragment.graphql.swift @@ -12,7 +12,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Crocodile } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Crocodile } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("species", String.self), diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/DogFragment.graphql.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/DogFragment.graphql.swift index 6ce83a408..08c65c1a4 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/DogFragment.graphql.swift +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/DogFragment.graphql.swift @@ -12,7 +12,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Dog } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Dog } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("species", String.self), diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/HeightInMeters.graphql.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/HeightInMeters.graphql.swift index 3c8503e7c..07b614537 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/HeightInMeters.graphql.swift +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/HeightInMeters.graphql.swift @@ -12,7 +12,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.Animal } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("height", Height.self), @@ -27,7 +27,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Height } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("meters", Int.self), diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/PetDetails.graphql.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/PetDetails.graphql.swift index e2ce9b4cd..ba00ce926 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/PetDetails.graphql.swift +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/PetDetails.graphql.swift @@ -12,7 +12,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.Pet } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.Pet } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("humanName", String?.self), @@ -31,7 +31,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Human } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Human } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("firstName", String.self), diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/WarmBloodedDetails.graphql.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/WarmBloodedDetails.graphql.swift index c5ed09016..a9e0919ed 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/WarmBloodedDetails.graphql.swift +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Fragments/WarmBloodedDetails.graphql.swift @@ -12,7 +12,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.WarmBlooded } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.WarmBlooded } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("bodyTemperature", Int.self), diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/LocalCacheMutations/AllAnimalsLocalCacheMutation.graphql.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/LocalCacheMutations/AllAnimalsLocalCacheMutation.graphql.swift index 2222f7b4a..c40552f27 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/LocalCacheMutations/AllAnimalsLocalCacheMutation.graphql.swift +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/LocalCacheMutations/AllAnimalsLocalCacheMutation.graphql.swift @@ -13,7 +13,7 @@ public extension MyAPI { public var __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("allAnimals", [AllAnimal].self), ] } @@ -44,7 +44,7 @@ public extension MyAPI { public var __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.Animal } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("species", String.self), @@ -91,7 +91,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsLocalCacheMutation.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Bird } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Bird } public static var __selections: [ApolloAPI.Selection] { [ .field("wingspan", Double.self), ] } diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/LocalCacheMutations/PetDetailsMutation.graphql.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/LocalCacheMutations/PetDetailsMutation.graphql.swift index 27efd84cf..8af3c589b 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/LocalCacheMutations/PetDetailsMutation.graphql.swift +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/LocalCacheMutations/PetDetailsMutation.graphql.swift @@ -12,7 +12,7 @@ public extension MyAPI { public var __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.Pet } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.Pet } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("owner", Owner?.self), @@ -45,7 +45,7 @@ public extension MyAPI { public var __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Human } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Human } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("firstName", String.self), diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/LocalCacheMutations/PetSearchLocalCacheMutation.graphql.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/LocalCacheMutations/PetSearchLocalCacheMutation.graphql.swift index 4c0a3009f..4926589c9 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/LocalCacheMutations/PetSearchLocalCacheMutation.graphql.swift +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/LocalCacheMutations/PetSearchLocalCacheMutation.graphql.swift @@ -30,7 +30,7 @@ public extension MyAPI { public var __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("pets", [Pet].self, arguments: ["filters": .variable("filters")]), ] } @@ -61,7 +61,7 @@ public extension MyAPI { public var __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.Pet } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.Pet } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("id", MyAPI.ID.self), diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Mutations/PetAdoptionMutation.graphql.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Mutations/PetAdoptionMutation.graphql.swift index 29c649058..0f1988ba0 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Mutations/PetAdoptionMutation.graphql.swift +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Mutations/PetAdoptionMutation.graphql.swift @@ -23,7 +23,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Mutation } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Mutation } public static var __selections: [ApolloAPI.Selection] { [ .field("adoptPet", AdoptPet.self, arguments: ["input": .variable("input")]), ] } @@ -37,7 +37,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.Pet } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.Pet } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("id", MyAPI.ID.self), diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Queries/AllAnimalsIncludeSkipQuery.graphql.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Queries/AllAnimalsIncludeSkipQuery.graphql.swift index 072bd3be9..a99466680 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Queries/AllAnimalsIncludeSkipQuery.graphql.swift +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Queries/AllAnimalsIncludeSkipQuery.graphql.swift @@ -44,7 +44,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("allAnimals", [AllAnimal].self), ] } @@ -58,7 +58,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.Animal } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("height", Height.self), @@ -97,7 +97,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Height } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("feet", Int.self), @@ -115,7 +115,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.Animal } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .include(if: "includeSpecies", .field("species", String.self)), @@ -134,7 +134,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsIncludeSkipQuery.Data.AllAnimal.Predator - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.WarmBlooded } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.WarmBlooded } public static var __selections: [ApolloAPI.Selection] { [ .field("species", String.self), .fragment(WarmBloodedDetails.self), @@ -166,7 +166,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsIncludeSkipQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.Animal } public static var __selections: [ApolloAPI.Selection] { [ .fragment(HeightInMeters.self), ] } @@ -190,14 +190,12 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } public var meters: Int { __data["meters"] } } - - } /// AllAnimal.AsWarmBloodedIfGetWarmBlooded @@ -208,7 +206,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsIncludeSkipQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.WarmBlooded } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.WarmBlooded } public static var __selections: [ApolloAPI.Selection] { [ .fragment(WarmBloodedDetails.self), ] } @@ -234,14 +232,12 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } public var meters: Int { __data["meters"] } } - - } /// AllAnimal.AsPet @@ -252,7 +248,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsIncludeSkipQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.Pet } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.Pet } public static var __selections: [ApolloAPI.Selection] { [ .field("height", Height.self), .inlineFragment(AsWarmBlooded.self), @@ -284,7 +280,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Height } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .include(if: "varA", [ @@ -299,8 +295,6 @@ public extension MyAPI { public var inches: Int? { __data["inches"] } } - - public typealias Owner = PetDetails.Owner /// AllAnimal.AsPet.AsWarmBlooded @@ -311,7 +305,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsIncludeSkipQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.WarmBlooded } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.WarmBlooded } public static var __selections: [ApolloAPI.Selection] { [ .fragment(WarmBloodedDetails.self), ] } @@ -341,7 +335,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } @@ -350,8 +344,6 @@ public extension MyAPI { public var meters: Int { __data["meters"] } } - - public typealias Owner = PetDetails.Owner } } @@ -364,7 +356,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsIncludeSkipQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Cat } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Cat } public static var __selections: [ApolloAPI.Selection] { [ .field("isJellicle", Bool.self), ] } @@ -395,7 +387,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } @@ -404,8 +396,6 @@ public extension MyAPI { public var meters: Int { __data["meters"] } } - - public typealias Owner = PetDetails.Owner } @@ -417,7 +407,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsIncludeSkipQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { MyAPI.Unions.ClassroomPet } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Unions.ClassroomPet } public static var __selections: [ApolloAPI.Selection] { [ .inlineFragment(AsBird.self), ] } @@ -444,7 +434,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsIncludeSkipQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Bird } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Bird } public static var __selections: [ApolloAPI.Selection] { [ .field("wingspan", Double.self), ] } @@ -475,7 +465,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } @@ -484,8 +474,6 @@ public extension MyAPI { public var meters: Int { __data["meters"] } } - - public typealias Owner = PetDetails.Owner } } diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Queries/AllAnimalsQuery.graphql.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Queries/AllAnimalsQuery.graphql.swift index 5cc011b61..e5852e45a 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Queries/AllAnimalsQuery.graphql.swift +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Queries/AllAnimalsQuery.graphql.swift @@ -8,7 +8,7 @@ public extension MyAPI { public static let operationName: String = "AllAnimalsQuery" public static let operationDocument: ApolloAPI.OperationDocument = .init( definition: .init( - #"query AllAnimalsQuery { allAnimals { __typename height { __typename feet inches } ...HeightInMeters ...WarmBloodedDetails species skinCovering ... on Pet { ...PetDetails ...WarmBloodedDetails ... on Animal { height { __typename relativeSize centimeters } } } ... on Cat { isJellicle } ... on ClassroomPet { ... on Bird { wingspan } } ... on Dog { favoriteToy birthdate } predators { __typename species ... on WarmBlooded { predators { __typename species } ...WarmBloodedDetails laysEggs } } } }"#, + #"query AllAnimalsQuery { allAnimals { __typename id height { __typename feet inches } ...HeightInMeters ...WarmBloodedDetails species skinCovering ... on Pet { ...PetDetails ...WarmBloodedDetails ... on Animal { height { __typename relativeSize centimeters } } } ... on Cat { isJellicle } ... on ClassroomPet { ... on Bird { wingspan } } ... on Dog { favoriteToy birthdate } predators { __typename species ... on WarmBlooded { predators { __typename species } ...WarmBloodedDetails laysEggs } } } }"#, fragments: [HeightInMeters.self, PetDetails.self, WarmBloodedDetails.self] )) @@ -18,7 +18,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("allAnimals", [AllAnimal].self), ] } @@ -32,9 +32,10 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.Animal } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), + .field("id", MyAPI.ID.self), .field("height", Height.self), .field("species", String.self), .field("skinCovering", GraphQLEnum?.self), @@ -47,6 +48,7 @@ public extension MyAPI { .fragment(HeightInMeters.self), ] } + public var id: MyAPI.ID { __data["id"] } public var height: Height { __data["height"] } public var species: String { __data["species"] } public var skinCovering: GraphQLEnum? { __data["skinCovering"] } @@ -72,7 +74,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Height } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("feet", Int.self), @@ -91,7 +93,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.Animal } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("species", String.self), @@ -110,7 +112,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsQuery.Data.AllAnimal.Predator - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.WarmBlooded } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.WarmBlooded } public static var __selections: [ApolloAPI.Selection] { [ .field("predators", [Predator].self), .field("laysEggs", Bool.self), @@ -138,7 +140,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.Animal } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("species", String.self), @@ -159,11 +161,12 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.WarmBlooded } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.WarmBlooded } public static var __selections: [ApolloAPI.Selection] { [ .fragment(WarmBloodedDetails.self), ] } + public var id: MyAPI.ID { __data["id"] } public var height: Height { __data["height"] } public var species: String { __data["species"] } public var skinCovering: GraphQLEnum? { __data["skinCovering"] } @@ -185,14 +188,12 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } public var meters: Int { __data["meters"] } } - - } /// AllAnimal.AsPet @@ -203,7 +204,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.Pet } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.Pet } public static var __selections: [ApolloAPI.Selection] { [ .field("height", Height.self), .inlineFragment(AsWarmBlooded.self), @@ -211,6 +212,7 @@ public extension MyAPI { ] } public var height: Height { __data["height"] } + public var id: MyAPI.ID { __data["id"] } public var species: String { __data["species"] } public var skinCovering: GraphQLEnum? { __data["skinCovering"] } public var predators: [Predator] { __data["predators"] } @@ -235,7 +237,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Height } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("relativeSize", GraphQLEnum.self), @@ -249,8 +251,6 @@ public extension MyAPI { public var meters: Int { __data["meters"] } } - - public typealias Owner = PetDetails.Owner /// AllAnimal.AsPet.AsWarmBlooded @@ -261,11 +261,12 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.WarmBlooded } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.WarmBlooded } public static var __selections: [ApolloAPI.Selection] { [ .fragment(WarmBloodedDetails.self), ] } + public var id: MyAPI.ID { __data["id"] } public var height: Height { __data["height"] } public var species: String { __data["species"] } public var skinCovering: GraphQLEnum? { __data["skinCovering"] } @@ -291,7 +292,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } @@ -300,8 +301,6 @@ public extension MyAPI { public var centimeters: Double { __data["centimeters"] } } - - public typealias Owner = PetDetails.Owner } } @@ -314,12 +313,13 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Cat } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Cat } public static var __selections: [ApolloAPI.Selection] { [ .field("isJellicle", Bool.self), ] } public var isJellicle: Bool { __data["isJellicle"] } + public var id: MyAPI.ID { __data["id"] } public var height: Height { __data["height"] } public var species: String { __data["species"] } public var skinCovering: GraphQLEnum? { __data["skinCovering"] } @@ -345,7 +345,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } @@ -354,8 +354,6 @@ public extension MyAPI { public var centimeters: Double { __data["centimeters"] } } - - public typealias Owner = PetDetails.Owner } @@ -367,11 +365,12 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { MyAPI.Unions.ClassroomPet } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Unions.ClassroomPet } public static var __selections: [ApolloAPI.Selection] { [ .inlineFragment(AsBird.self), ] } + public var id: MyAPI.ID { __data["id"] } public var height: Height { __data["height"] } public var species: String { __data["species"] } public var skinCovering: GraphQLEnum? { __data["skinCovering"] } @@ -393,15 +392,13 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } public var meters: Int { __data["meters"] } } - - /// AllAnimal.AsClassroomPet.AsBird /// /// Parent Type: `Bird` @@ -410,12 +407,13 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Bird } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Bird } public static var __selections: [ApolloAPI.Selection] { [ .field("wingspan", Double.self), ] } public var wingspan: Double { __data["wingspan"] } + public var id: MyAPI.ID { __data["id"] } public var height: Height { __data["height"] } public var species: String { __data["species"] } public var skinCovering: GraphQLEnum? { __data["skinCovering"] } @@ -441,7 +439,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } @@ -450,8 +448,6 @@ public extension MyAPI { public var centimeters: Double { __data["centimeters"] } } - - public typealias Owner = PetDetails.Owner } } @@ -464,7 +460,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = AllAnimalsQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Dog } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Dog } public static var __selections: [ApolloAPI.Selection] { [ .field("favoriteToy", String.self), .field("birthdate", MyAPI.CustomDate?.self), @@ -472,6 +468,7 @@ public extension MyAPI { public var favoriteToy: String { __data["favoriteToy"] } public var birthdate: MyAPI.CustomDate? { __data["birthdate"] } + public var id: MyAPI.ID { __data["id"] } public var height: Height { __data["height"] } public var species: String { __data["species"] } public var skinCovering: GraphQLEnum? { __data["skinCovering"] } @@ -496,7 +493,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Height } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Height } public var feet: Int { __data["feet"] } public var inches: Int? { __data["inches"] } @@ -505,8 +502,6 @@ public extension MyAPI { public var centimeters: Double { __data["centimeters"] } } - - public typealias Owner = PetDetails.Owner } } diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Queries/ClassroomPetsQuery.graphql.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Queries/ClassroomPetsQuery.graphql.swift index 025231f22..92e147df6 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Queries/ClassroomPetsQuery.graphql.swift +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Queries/ClassroomPetsQuery.graphql.swift @@ -18,7 +18,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("classroomPets", [ClassroomPet?]?.self), ] } @@ -32,7 +32,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Unions.ClassroomPet } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Unions.ClassroomPet } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .fragment(ClassroomPetDetails.self), @@ -60,7 +60,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetsQuery.Data.ClassroomPet - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.Animal } public static var __mergedSources: [any ApolloAPI.SelectionSet.Type] { [ ClassroomPetsQuery.Data.ClassroomPet.self, ClassroomPetDetails.AsAnimal.self @@ -84,7 +84,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetsQuery.Data.ClassroomPet - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.Pet } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.Pet } public static var __mergedSources: [any ApolloAPI.SelectionSet.Type] { [ ClassroomPetsQuery.Data.ClassroomPet.self, ClassroomPetDetails.AsPet.self @@ -108,7 +108,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetsQuery.Data.ClassroomPet - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.WarmBlooded } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.WarmBlooded } public static var __mergedSources: [any ApolloAPI.SelectionSet.Type] { [ ClassroomPetsQuery.Data.ClassroomPet.self, ClassroomPetDetails.AsAnimal.self, @@ -134,7 +134,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetsQuery.Data.ClassroomPet - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Cat } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Cat } public static var __mergedSources: [any ApolloAPI.SelectionSet.Type] { [ ClassroomPetsQuery.Data.ClassroomPet.self, ClassroomPetDetails.AsAnimal.self, @@ -165,7 +165,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetsQuery.Data.ClassroomPet - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Bird } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Bird } public static var __mergedSources: [any ApolloAPI.SelectionSet.Type] { [ ClassroomPetsQuery.Data.ClassroomPet.self, ClassroomPetDetails.AsAnimal.self, @@ -195,7 +195,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = ClassroomPetsQuery.Data.ClassroomPet - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.PetRock } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.PetRock } public static var __mergedSources: [any ApolloAPI.SelectionSet.Type] { [ ClassroomPetsQuery.Data.ClassroomPet.self, ClassroomPetDetails.AsPet.self, diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Queries/DogQuery.graphql.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Queries/DogQuery.graphql.swift index dc03e3579..7f822bd8e 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Queries/DogQuery.graphql.swift +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Queries/DogQuery.graphql.swift @@ -18,7 +18,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("allAnimals", [AllAnimal].self), ] } @@ -32,7 +32,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.Animal } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.Animal } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("id", MyAPI.ID.self), @@ -53,7 +53,7 @@ public extension MyAPI { public init(_dataDict: DataDict) { __data = _dataDict } public typealias RootEntityType = DogQuery.Data.AllAnimal - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Dog } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Dog } public static var __selections: [ApolloAPI.Selection] { [ .field("houseDetails", MyAPI.Object?.self), .fragment(DogFragment.self), diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Queries/PetSearchQuery.graphql.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Queries/PetSearchQuery.graphql.swift index 82db5040f..66a924098 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Queries/PetSearchQuery.graphql.swift +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Operations/Queries/PetSearchQuery.graphql.swift @@ -34,7 +34,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Objects.Query } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Objects.Query } public static var __selections: [ApolloAPI.Selection] { [ .field("pets", [Pet].self, arguments: ["filters": .variable("filters")]), ] } @@ -48,7 +48,7 @@ public extension MyAPI { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public static var __parentType: ApolloAPI.ParentType { MyAPI.Interfaces.Pet } + public static var __parentType: any ApolloAPI.ParentType { MyAPI.Interfaces.Pet } public static var __selections: [ApolloAPI.Selection] { [ .field("__typename", String.self), .field("id", MyAPI.ID.self), diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/CustomScalars/ID.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/CustomScalars/ID.swift new file mode 100644 index 000000000..c89b5d138 --- /dev/null +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/CustomScalars/ID.swift @@ -0,0 +1,14 @@ +// @generated +// This file was automatically generated and can be edited to +// implement advanced custom scalar functionality. +// +// Any changes to this file will not be overwritten by future +// code generation execution. + +import ApolloAPI + +public extension MyAPI { + /// 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. + typealias ID = String + +} \ No newline at end of file diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/InputObjects/PetAdoptionInput.graphql.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/InputObjects/PetAdoptionInput.graphql.swift index e3445dc03..eaaf868e9 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/InputObjects/PetAdoptionInput.graphql.swift +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/InputObjects/PetAdoptionInput.graphql.swift @@ -16,7 +16,7 @@ public extension MyAPI { petID: ID, humanName: GraphQLNullable = nil, favoriteToy: String, - isSpayedOrNeutered: Bool?, + isSpayedOrNeutered: Bool? = nil, measurements: GraphQLNullable = nil ) { __data = InputDict([ diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/Interfaces/Animal.graphql.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/Interfaces/Animal.graphql.swift index 45b471271..2c58a0f65 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/Interfaces/Animal.graphql.swift +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/Interfaces/Animal.graphql.swift @@ -4,5 +4,5 @@ import ApolloAPI public extension MyAPI.Interfaces { - static let Animal = Interface(name: "Animal") + static let Animal = ApolloAPI.Interface(name: "Animal") } \ No newline at end of file diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/Interfaces/HousePet.graphql.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/Interfaces/HousePet.graphql.swift index ade974b45..6f2b36547 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/Interfaces/HousePet.graphql.swift +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/Interfaces/HousePet.graphql.swift @@ -4,5 +4,5 @@ import ApolloAPI public extension MyAPI.Interfaces { - static let HousePet = Interface(name: "HousePet") + static let HousePet = ApolloAPI.Interface(name: "HousePet") } \ No newline at end of file diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/Interfaces/Pet.graphql.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/Interfaces/Pet.graphql.swift index 75d337e21..7b7bc28bd 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/Interfaces/Pet.graphql.swift +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/Interfaces/Pet.graphql.swift @@ -4,5 +4,5 @@ import ApolloAPI public extension MyAPI.Interfaces { - static let Pet = Interface(name: "Pet") + static let Pet = ApolloAPI.Interface(name: "Pet") } \ No newline at end of file diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/Interfaces/WarmBlooded.graphql.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/Interfaces/WarmBlooded.graphql.swift index c93da8199..b9ecbb540 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/Interfaces/WarmBlooded.graphql.swift +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/Interfaces/WarmBlooded.graphql.swift @@ -4,5 +4,5 @@ import ApolloAPI public extension MyAPI.Interfaces { - static let WarmBlooded = Interface(name: "WarmBlooded") + static let WarmBlooded = ApolloAPI.Interface(name: "WarmBlooded") } \ No newline at end of file diff --git a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/SchemaMetadata.graphql.swift b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/SchemaMetadata.graphql.swift index 4cc56f443..f9bb451e3 100644 --- a/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/SchemaMetadata.graphql.swift +++ b/Tests/TestCodeGenConfigurations/CodegenXCFramework/CodegenXCFramework/MyAPI/Schema/SchemaMetadata.graphql.swift @@ -16,8 +16,6 @@ public protocol MyAPI_MutableInlineFragment: ApolloAPI.MutableSelectionSet & Apo where Schema == MyAPI.SchemaMetadata {} public extension MyAPI { - typealias ID = String - typealias SelectionSet = MyAPI_SelectionSet typealias InlineFragment = MyAPI_InlineFragment @@ -27,7 +25,7 @@ public extension MyAPI { typealias MutableInlineFragment = MyAPI_MutableInlineFragment enum SchemaMetadata: ApolloAPI.SchemaMetadata { - public static let configuration: ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self + public static let configuration: any ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self public static func objectType(forTypename typename: String) -> ApolloAPI.Object? { switch typename { diff --git a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/Package.swift b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/Package.swift index b43316073..8c5aa37ce 100644 --- a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/Package.swift +++ b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.7 +// swift-tools-version: 5.9 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription @@ -23,12 +23,16 @@ let package = Package( name: "TestApp", dependencies: [ .product(name: "ApolloAPI", package: "apollo-ios") - ]), + ], + swiftSettings: [.enableUpcomingFeature("ExistentialAny")] + ), .testTarget( name: "TestAppTests", dependencies: [ "TestApp", .product(name: "ApolloTestSupport", package: "apollo-ios"), - ]), + ], + swiftSettings: [.enableUpcomingFeature("ExistentialAny")] + ), ] ) diff --git a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/Tests/TestAppTests/TestAppTests.swift b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/Tests/TestAppTests/TestAppTests.swift index c4faae897..c9e870732 100644 --- a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/Tests/TestAppTests/TestAppTests.swift +++ b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/Tests/TestAppTests/TestAppTests.swift @@ -53,10 +53,10 @@ class MockNetworkTransport: NetworkTransport { operation: Operation, cachePolicy: CachePolicy, contextIdentifier: UUID?, - context: RequestContext?, + context: (any RequestContext)?, callbackQueue: DispatchQueue, - completionHandler: @escaping (Result, Error>) -> Void - ) -> Cancellable where Operation : GraphQLOperation { + completionHandler: @escaping (Result, any Error>) -> Void + ) -> any Cancellable where Operation : GraphQLOperation { return EmptyCancellable() } var clientName: String { "Mock" } diff --git a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageOne/Package.swift b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageOne/Package.swift index 04f08a310..1c993243d 100644 --- a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageOne/Package.swift +++ b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageOne/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.7 +// swift-tools-version: 5.9 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription @@ -37,20 +37,22 @@ let package = Package( "graphql/PetDetailsMutation.graphql", "graphql/ClassroomPets.graphql", "graphql/DogFragment.graphql", - "graphql/ccnGraphql/ClassroomPetsCCN.graphql", "graphql/PetSearchQuery.graphql", "graphql/AllAnimalsQuery.graphql", - "graphql/ccnGraphql/AllAnimalsCCN.graphql", "graphql/WarmBloodedDetails.graphql", "graphql/PetDetails.graphql", "graphql/AllAnimalsIncludeSkipQuery.graphql", "graphql/PetAdoptionMutation.graphql" - ]), + ], + swiftSettings: [.enableUpcomingFeature("ExistentialAny")] + ), .testTarget( name: "PackageOneTests", dependencies: [ "PackageOne", .product(name: "TestMocks", package: "PackageTwo") - ]), + ], + swiftSettings: [.enableUpcomingFeature("ExistentialAny")] + ), ] ) diff --git a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageOne/Sources/PackageOne/graphql/ccnGraphql/AllAnimalsCCN.graphql b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageOne/Sources/PackageOne/graphql/ccnGraphql/AllAnimalsCCN.graphql deleted file mode 100644 index 5d85c589e..000000000 --- a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageOne/Sources/PackageOne/graphql/ccnGraphql/AllAnimalsCCN.graphql +++ /dev/null @@ -1,8 +0,0 @@ -query AllAnimalsCCN { - allAnimals { - height? { - feet? - inches! - } - } -} diff --git a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageOne/Sources/PackageOne/graphql/ccnGraphql/ClassroomPetsCCN.graphql b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageOne/Sources/PackageOne/graphql/ccnGraphql/ClassroomPetsCCN.graphql deleted file mode 100644 index 41d16b593..000000000 --- a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageOne/Sources/PackageOne/graphql/ccnGraphql/ClassroomPetsCCN.graphql +++ /dev/null @@ -1,14 +0,0 @@ -query ClassroomPetsCCN { - classroomPets[!]? { - ...ClassroomPetDetailsCCN - } -} - -fragment ClassroomPetDetailsCCN on ClassroomPet { - ... on Animal { - height { - inches! - } - } -} - diff --git a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageTwo/Package.swift b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageTwo/Package.swift index 3ad6d14f2..f8acb2bd7 100644 --- a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageTwo/Package.swift +++ b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageTwo/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.6 +// swift-tools-version: 5.9 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription @@ -22,13 +22,17 @@ let package = Package( name: "PackageTwo", dependencies: [ .product(name: "ApolloAPI", package: "apollo-ios"), - ]), + ], + swiftSettings: [.enableUpcomingFeature("ExistentialAny")] + ), .target( name: "TestMocks", dependencies: [ "PackageTwo", .product(name: "ApolloTestSupport", package: "apollo-ios"), - ]), + ], + swiftSettings: [.enableUpcomingFeature("ExistentialAny")] + ), .testTarget( name: "PackageTwoTests", dependencies: [ @@ -36,6 +40,8 @@ let package = Package( "TestMocks", .product(name: "ApolloAPI", package: "apollo-ios"), .product(name: "ApolloTestSupport", package: "apollo-ios"), - ]), + ], + swiftSettings: [.enableUpcomingFeature("ExistentialAny")] + ), ] ) diff --git a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/apollo-codegen-config.json b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/apollo-codegen-config.json index 70ba0c255..6125aa6b5 100644 --- a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/apollo-codegen-config.json +++ b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/apollo-codegen-config.json @@ -17,7 +17,7 @@ }, "input" : { "operationSearchPaths" : [ - "PackageOne\/Sources\/PackageOne\/graphql\/*.graphql" + "PackageOne\/Sources\/PackageOne\/graphql\/**\/*.graphql" ], "schemaSearchPaths" : [ "PackageOne\/Sources\/PackageOne\/graphql\/AnimalSchema.graphqls" diff --git a/Tests/TestCodeGenConfigurations/Other-CocoaPods/CocoaPodsProject.xcodeproj/project.pbxproj b/Tests/TestCodeGenConfigurations/Other-CocoaPods/CocoaPodsProject.xcodeproj/project.pbxproj index 15458dbc1..e3430e5bc 100644 --- a/Tests/TestCodeGenConfigurations/Other-CocoaPods/CocoaPodsProject.xcodeproj/project.pbxproj +++ b/Tests/TestCodeGenConfigurations/Other-CocoaPods/CocoaPodsProject.xcodeproj/project.pbxproj @@ -704,6 +704,7 @@ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; + OTHER_SWIFT_FLAGS = "\"-enable-upcoming-feature ExistentialAny\""; SDKROOT = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -759,6 +760,7 @@ MACOSX_DEPLOYMENT_TARGET = 12.3; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; + OTHER_SWIFT_FLAGS = "\"-enable-upcoming-feature ExistentialAny\""; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; @@ -785,6 +787,7 @@ "@executable_path/../Frameworks", ); MARKETING_VERSION = 1.0; + OTHER_SWIFT_FLAGS = "-enable-upcoming-feature ExistentialAny"; PRODUCT_BUNDLE_IDENTIFIER = com.apollographql.CocoaPodsProject; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; @@ -812,6 +815,7 @@ "@executable_path/../Frameworks", ); MARKETING_VERSION = 1.0; + OTHER_SWIFT_FLAGS = "-enable-upcoming-feature ExistentialAny"; PRODUCT_BUNDLE_IDENTIFIER = com.apollographql.CocoaPodsProject; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; @@ -830,6 +834,7 @@ DEAD_CODE_STRIPPING = YES; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; + OTHER_SWIFT_FLAGS = "-enable-upcoming-feature ExistentialAny"; PRODUCT_BUNDLE_IDENTIFIER = com.apollographql.CocoaPodsProjectTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = NO; @@ -849,6 +854,7 @@ DEAD_CODE_STRIPPING = YES; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; + OTHER_SWIFT_FLAGS = "-enable-upcoming-feature ExistentialAny"; PRODUCT_BUNDLE_IDENTIFIER = com.apollographql.CocoaPodsProjectTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = NO; diff --git a/Tests/TestCodeGenConfigurations/Other-CustomTarget/CustomTargetProject.xcodeproj/project.pbxproj b/Tests/TestCodeGenConfigurations/Other-CustomTarget/CustomTargetProject.xcodeproj/project.pbxproj index f6551541a..27dfd1a97 100644 --- a/Tests/TestCodeGenConfigurations/Other-CustomTarget/CustomTargetProject.xcodeproj/project.pbxproj +++ b/Tests/TestCodeGenConfigurations/Other-CustomTarget/CustomTargetProject.xcodeproj/project.pbxproj @@ -505,7 +505,7 @@ attributes = { BuildIndependentTargetsInParallel = 1; LastSwiftUpdateCheck = 1420; - LastUpgradeCheck = 1400; + LastUpgradeCheck = 1540; TargetAttributes = { DE454BC828B43262009DC80E = { CreatedOnToolsVersion = 14.0; @@ -692,6 +692,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -712,6 +713,7 @@ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; + OTHER_SWIFT_FLAGS = "-enable-upcoming-feature ExistentialAny"; SDKROOT = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -758,6 +760,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; @@ -771,6 +774,7 @@ MACOSX_DEPLOYMENT_TARGET = 12.3; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; + OTHER_SWIFT_FLAGS = "-enable-upcoming-feature ExistentialAny"; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; @@ -783,12 +787,14 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -798,6 +804,7 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; PRODUCT_BUNDLE_IDENTIFIER = apollograpqhl.CustomTargetProject; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SDKROOT = iphoneos; @@ -815,12 +822,14 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -830,6 +839,7 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; PRODUCT_BUNDLE_IDENTIFIER = apollograpqhl.CustomTargetProject; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SDKROOT = iphoneos; @@ -854,6 +864,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -866,6 +877,8 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; + OTHER_SWIFT_FLAGS = "-enable-upcoming-feature ExistentialAny"; PRODUCT_BUNDLE_IDENTIFIER = com.apollographql.AnimalKingdomAPI; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SDKROOT = auto; @@ -887,6 +900,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -899,6 +913,8 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; + OTHER_SWIFT_FLAGS = "-enable-upcoming-feature ExistentialAny"; PRODUCT_BUNDLE_IDENTIFIER = com.apollographql.AnimalKingdomAPI; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SDKROOT = auto; diff --git a/Tests/TestCodeGenConfigurations/Other-CustomTarget/CustomTargetProject.xcodeproj/xcshareddata/xcschemes/AnimalKingdomAPI.xcscheme b/Tests/TestCodeGenConfigurations/Other-CustomTarget/CustomTargetProject.xcodeproj/xcshareddata/xcschemes/AnimalKingdomAPI.xcscheme index 5d0a46dc2..2016cab5c 100644 --- a/Tests/TestCodeGenConfigurations/Other-CustomTarget/CustomTargetProject.xcodeproj/xcshareddata/xcschemes/AnimalKingdomAPI.xcscheme +++ b/Tests/TestCodeGenConfigurations/Other-CustomTarget/CustomTargetProject.xcodeproj/xcshareddata/xcschemes/AnimalKingdomAPI.xcscheme @@ -1,6 +1,6 @@ Settings { - let configPath = Path("Configuration/Apollo/\(target.xcconfigName).xcconfig") - let debugConfig = Configuration.debug(name: .debug, xcconfig: configPath) - let releaseConfig = Configuration.release(name: .release, xcconfig: configPath) - let performanceTestingConfig = Configuration.release(name: .performanceTesting, xcconfig: configPath) - let settings = Settings.settings( - configurations: [ - debugConfig, - releaseConfig, - performanceTestingConfig - ], - defaultSettings: .none - ) - return settings - } - + + static func forTarget(_ target: ApolloTarget) -> Settings { + let configPath = Path("Configuration/Apollo/\(target.xcconfigName).xcconfig") + let debugConfig = Configuration.debug(name: .debug, xcconfig: configPath) + let releaseConfig = Configuration.release(name: .release, xcconfig: configPath) + let performanceTestingConfig = Configuration.release(name: .performanceTesting, xcconfig: configPath) + let settings = Settings.settings( + base: [ + "OTHER_SWIFT_FLAGS": .array(["-enable-upcoming-feature", "ExistentialAny"]) + ], + configurations: [ + debugConfig, + releaseConfig, + performanceTestingConfig + ], + defaultSettings: .none + ) + return settings + } + } diff --git a/apollo-ios-codegen/Package.swift b/apollo-ios-codegen/Package.swift index 3e4d10990..e794621f2 100644 --- a/apollo-ios-codegen/Package.swift +++ b/apollo-ios-codegen/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.7 +// swift-tools-version:5.9 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription @@ -33,7 +33,8 @@ let package = Package( "TemplateString", .product(name: "InflectorKit", package: "InflectorKit"), .product(name: "OrderedCollections", package: "swift-collections") - ] + ], + swiftSettings: [.enableUpcomingFeature("ExistentialAny")] ), .target( name: "GraphQLCompiler", @@ -43,7 +44,8 @@ let package = Package( ], exclude: [ "JavaScript" - ] + ], + swiftSettings: [.enableUpcomingFeature("ExistentialAny")] ), .target( name: "IR", @@ -52,15 +54,18 @@ let package = Package( "TemplateString", "Utilities", .product(name: "OrderedCollections", package: "swift-collections") - ] + ], + swiftSettings: [.enableUpcomingFeature("ExistentialAny")] ), .target( name: "TemplateString", - dependencies: [] + dependencies: [], + swiftSettings: [.enableUpcomingFeature("ExistentialAny")] ), .target( name: "Utilities", - dependencies: [] + dependencies: [], + swiftSettings: [.enableUpcomingFeature("ExistentialAny")] ), .executableTarget( name: "apollo-ios-cli", @@ -69,14 +74,16 @@ let package = Package( ], exclude: [ "README.md", - ] + ], + swiftSettings: [.enableUpcomingFeature("ExistentialAny")] ), .target( name: "CodegenCLI", dependencies: [ "ApolloCodegenLib", .product(name: "ArgumentParser", package: "swift-argument-parser"), - ] + ], + swiftSettings: [.enableUpcomingFeature("ExistentialAny")] ), ] ) diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/ApolloCodegen.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/ApolloCodegen.swift index eb98cc74c..58ef7a526 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/ApolloCodegen.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/ApolloCodegen.swift @@ -553,7 +553,7 @@ public class ApolloCodegen { extension ApolloCodegen { fileprivate func nonFatalErrorCollectingTaskGroup( - _ block: (inout ThrowingTaskGroup) async throws -> Void + _ block: (inout ThrowingTaskGroup) async throws -> Void ) async throws -> NonFatalErrors { return try await withThrowingTaskGroup( of: (NonFatalErrors.DefinitionEntry).self @@ -571,8 +571,8 @@ extension ApolloCodegen { } fileprivate func addFileGenerationTask( - for fileGenerator: FileGenerator, - to group: inout ThrowingTaskGroup, + for fileGenerator: any FileGenerator, + to group: inout ThrowingTaskGroup, fileManager: ApolloFileManager ) { let config = config diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/ApolloCodegenConfiguration.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/ApolloCodegenConfiguration.swift index 078b31df5..7b88933c5 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/ApolloCodegenConfiguration.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/ApolloCodegenConfiguration.swift @@ -210,7 +210,7 @@ public struct ApolloCodegenConfiguration: Codable, Equatable { /// `Decodable` implementation to allow for properties to be optional in the encoded JSON with /// specified defaults when not present. - public init(from decoder: Decoder) throws { + public init(from decoder: any Decoder) throws { let values = try decoder.container(keyedBy: CodingKeys.self) try throwIfContainsUnexpectedKey(container: values, type: Self.self, decoder: decoder) schemaTypes = try values.decode( @@ -232,7 +232,7 @@ public struct ApolloCodegenConfiguration: Codable, Equatable { ) } - public func encode(to encoder: Encoder) throws { + public func encode(to encoder: any Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(self.schemaTypes, forKey: .schemaTypes) @@ -294,7 +294,7 @@ public struct ApolloCodegenConfiguration: Codable, Equatable { /// location. case other - public init(from decoder: Decoder) throws { + public init(from decoder: any Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) guard let key = container.allKeys.first else { @@ -344,7 +344,7 @@ public struct ApolloCodegenConfiguration: Codable, Equatable { /// control the visibility of generated code, defaults to `.public`. case absolute(path: String, accessModifier: AccessModifier = .public) - public init(from decoder: Decoder) throws { + public init(from decoder: any Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) guard let key = container.allKeys.first else { @@ -414,7 +414,7 @@ public struct ApolloCodegenConfiguration: Codable, Equatable { /// will fail. case swiftPackage(targetName: String? = nil) - public init(from decoder: Decoder) throws { + public init(from decoder: any Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) guard let key = container.allKeys.first else { @@ -581,7 +581,7 @@ public struct ApolloCodegenConfiguration: Codable, Equatable { case markOperationDefinitionsAsFinal } - public init(from decoder: Decoder) throws { + public init(from decoder: any Decoder) throws { let values = try decoder.container(keyedBy: CodingKeys.self) try throwIfContainsUnexpectedKey(container: values, type: Self.self, decoder: decoder) @@ -641,7 +641,7 @@ public struct ApolloCodegenConfiguration: Codable, Equatable { ) ?? Default.markOperationDefinitionsAsFinal } - public func encode(to encoder: Encoder) throws { + public func encode(to encoder: any Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(self.additionalInflectionRules, forKey: .additionalInflectionRules) @@ -744,7 +744,7 @@ public struct ApolloCodegenConfiguration: Codable, Equatable { } @available(*, deprecated) // Deprecation attribute added to supress warning. - public init(from decoder: Decoder) throws { + public init(from decoder: any Decoder) throws { let values = try decoder.container(keyedBy: CodingKeys.self) guard values.allKeys.first != nil else { throw DecodingError.typeMismatch(Self.self, DecodingError.Context.init( @@ -804,7 +804,7 @@ public struct ApolloCodegenConfiguration: Codable, Equatable { case operationId } - public init(from decoder: Decoder) throws { + public init(from decoder: any Decoder) throws { self = OperationDocumentFormat(rawValue: 0) var container = try decoder.unkeyedContainer() @@ -828,7 +828,7 @@ public struct ApolloCodegenConfiguration: Codable, Equatable { } } - public func encode(to encoder: Encoder) throws { + public func encode(to encoder: any Encoder) throws { var container = encoder.unkeyedContainer() if self.contains(.definition) { try container.encode(CodingKeys.definition.rawValue) @@ -931,7 +931,7 @@ public struct ApolloCodegenConfiguration: Codable, Equatable { case legacySafelistingCompatibleOperations } - public init(from decoder: Decoder) throws { + public init(from decoder: any Decoder) throws { let values = try decoder.container(keyedBy: CodingKeys.self) legacySafelistingCompatibleOperations = try values.decodeIfPresent( @@ -1015,7 +1015,7 @@ public struct ApolloCodegenConfiguration: Codable, Equatable { case operationManifest } - public func encode(to encoder: Encoder) throws { + public func encode(to encoder: any Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(self.schemaNamespace, forKey: .schemaNamespace) @@ -1033,7 +1033,7 @@ public struct ApolloCodegenConfiguration: Codable, Equatable { } } - public init(from decoder: Decoder) throws { + public init(from decoder: any Decoder) throws { let values = try decoder.container(keyedBy: CodingKeys.self) try throwIfContainsUnexpectedKey(container: values, type: Self.self, decoder: decoder) @@ -1177,7 +1177,7 @@ extension ApolloCodegenConfiguration.SelectionSetInitializers { case definitionsNamed } - public init(from decoder: Decoder) throws { + public init(from decoder: any Decoder) throws { let values = try decoder.container(keyedBy: CodingKeys.self) try throwIfContainsUnexpectedKey(container: values, type: Self.self, decoder: decoder) var options: Options = [] @@ -1198,7 +1198,7 @@ extension ApolloCodegenConfiguration.SelectionSetInitializers { forKey: .definitionsNamed) ?? [] } - public func encode(to encoder: Encoder) throws { + public func encode(to encoder: any Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) func encodeIfPresent(option: Options, forKey key: CodingKeys) throws { @@ -1502,7 +1502,7 @@ private struct AnyCodingKey: CodingKey { func throwIfContainsUnexpectedKey( container: KeyedDecodingContainer, type: T.Type, - decoder: Decoder + decoder: any Decoder ) throws { // Map all keys from the input object let allKeys = Set(try decoder.container(keyedBy: AnyCodingKey.self).allKeys.map(\.stringValue)) diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/ApolloSchemaDownloadConfiguration.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/ApolloSchemaDownloadConfiguration.swift index b4b7f146f..05a63c51f 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/ApolloSchemaDownloadConfiguration.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/ApolloSchemaDownloadConfiguration.swift @@ -53,7 +53,7 @@ public struct ApolloSchemaDownloadConfiguration: Equatable, Codable { case variant } - public init(from decoder: Decoder) throws { + public init(from decoder: any Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.apiKey = try container.decode(String.self, forKey: .apiKey) @@ -185,7 +185,7 @@ public struct ApolloSchemaDownloadConfiguration: Equatable, Codable { case outputPath } - public init(from decoder: Decoder) throws { + public init(from decoder: any Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.downloadMethod = try container.decode(DownloadMethod.self, forKey: .downloadMethod) diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/ApolloSchemaDownloader.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/ApolloSchemaDownloader.swift index 46d861c4b..5ea9fa82e 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/ApolloSchemaDownloader.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/ApolloSchemaDownloader.swift @@ -8,13 +8,13 @@ import GraphQLCompiler public struct ApolloSchemaDownloader { public enum SchemaDownloadError: Swift.Error, LocalizedError { - case downloadedRegistryJSONFileNotFound(underlying: Error) - case downloadedIntrospectionJSONFileNotFound(underlying: Error) - case couldNotParseRegistryJSON(underlying: Error) + case downloadedRegistryJSONFileNotFound(underlying: any Error) + case downloadedIntrospectionJSONFileNotFound(underlying: any Error) + case couldNotParseRegistryJSON(underlying: any Error) case unexpectedRegistryJSONType case couldNotExtractSDLFromRegistryJSON case couldNotCreateSDLDataToWrite(schema: String) - case couldNotConvertIntrospectionJSONToSDL(underlying: Error) + case couldNotConvertIntrospectionJSONToSDL(underlying: any Error) case couldNotCreateURLComponentsFromEndpointURL(url: URL) case couldNotGetURLFromURLComponents(components: URLComponents) @@ -54,7 +54,7 @@ public struct ApolloSchemaDownloader { public static func fetch( configuration: ApolloSchemaDownloadConfiguration, withRootURL rootURL: URL? = nil, - session: NetworkSession? = nil + session: (any NetworkSession)? = nil ) async throws { try ApolloFileManager.default.createContainingDirectoryIfNeeded( forPath: configuration.outputPath @@ -143,7 +143,7 @@ public struct ApolloSchemaDownloader { registry: ApolloSchemaDownloadConfiguration.DownloadMethod.ApolloRegistrySettings, configuration: ApolloSchemaDownloadConfiguration, withRootURL rootURL: URL?, - session: NetworkSession? = nil + session: (any NetworkSession)? = nil ) async throws { CodegenLogger.log("Downloading schema from registry", logLevel: .debug) @@ -347,7 +347,7 @@ public struct ApolloSchemaDownloader { includeDeprecatedInputValues: Bool, configuration: ApolloSchemaDownloadConfiguration, withRootURL: URL?, - session: NetworkSession? = nil + session: (any NetworkSession)? = nil ) async throws { CodegenLogger.log("Downloading schema via introspection from \(endpoint)", logLevel: .debug) diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/CodegenConfiguration/ApolloCodegenConfiguration+OperationManifestConfiguration.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/CodegenConfiguration/ApolloCodegenConfiguration+OperationManifestConfiguration.swift index fef96343b..682c9f559 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/CodegenConfiguration/ApolloCodegenConfiguration+OperationManifestConfiguration.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/CodegenConfiguration/ApolloCodegenConfiguration+OperationManifestConfiguration.swift @@ -54,7 +54,7 @@ extension ApolloCodegenConfiguration { case generateManifestOnCodeGeneration } - public init(from decoder: Decoder) throws { + public init(from decoder: any Decoder) throws { let values = try decoder.container(keyedBy: CodingKeys.self) try throwIfContainsUnexpectedKey( container: values, @@ -78,7 +78,7 @@ extension ApolloCodegenConfiguration { ) } - public func encode(to encoder: Encoder) throws { + public func encode(to encoder: any Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(self.path, forKey: .path) diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/CustomScalarFileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/CustomScalarFileGenerator.swift index f3e16fd2d..6c096aa00 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/CustomScalarFileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/CustomScalarFileGenerator.swift @@ -8,7 +8,7 @@ struct CustomScalarFileGenerator: FileGenerator { /// Shared codegen configuration. let config: ApolloCodegen.ConfigurationContext - var template: TemplateRenderer { + var template: any TemplateRenderer { CustomScalarTemplate(graphqlScalar: graphqlScalar, config: config) } diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/EnumFileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/EnumFileGenerator.swift index 84c627c42..e8e156c23 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/EnumFileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/EnumFileGenerator.swift @@ -8,7 +8,7 @@ struct EnumFileGenerator: FileGenerator { /// Shared codegen configuration. let config: ApolloCodegen.ConfigurationContext - var template: TemplateRenderer { + var template: any TemplateRenderer { EnumTemplate(graphqlEnum: graphqlEnum, config: config) } diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/FileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/FileGenerator.swift index 83d24e976..beb58147f 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/FileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/FileGenerator.swift @@ -8,7 +8,7 @@ protocol FileGenerator { var fileName: String { get } var fileExtension: String { get } var overwrite: Bool { get } - var template: TemplateRenderer { get } + var template: any TemplateRenderer { get } var target: FileTarget { get } } diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/FragmentFileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/FragmentFileGenerator.swift index b3c806b27..1b8bd4472 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/FragmentFileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/FragmentFileGenerator.swift @@ -8,7 +8,7 @@ struct FragmentFileGenerator: FileGenerator { /// Shared codegen configuration. let config: ApolloCodegen.ConfigurationContext - var template: TemplateRenderer { FragmentTemplate( + var template: any TemplateRenderer { FragmentTemplate( fragment: irFragment, config: config ) } diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/InputObjectFileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/InputObjectFileGenerator.swift index 30a1610b9..1dddd3c34 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/InputObjectFileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/InputObjectFileGenerator.swift @@ -9,7 +9,7 @@ struct InputObjectFileGenerator: FileGenerator { /// Shared codegen configuration. let config: ApolloCodegen.ConfigurationContext - var template: TemplateRenderer { + var template: any TemplateRenderer { InputObjectTemplate(graphqlInputObject: graphqlInputObject, config: config) } var target: FileTarget { .inputObject } diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/InterfaceFileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/InterfaceFileGenerator.swift index fb256093d..871b569c7 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/InterfaceFileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/InterfaceFileGenerator.swift @@ -8,7 +8,7 @@ struct InterfaceFileGenerator: FileGenerator { /// Shared codegen configuration. let config: ApolloCodegen.ConfigurationContext - var template: TemplateRenderer { + var template: any TemplateRenderer { InterfaceTemplate(graphqlInterface: graphqlInterface, config: config) } diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/MockInterfacesFileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/MockInterfacesFileGenerator.swift index 1906845ef..0d7445630 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/MockInterfacesFileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/MockInterfacesFileGenerator.swift @@ -18,7 +18,7 @@ struct MockInterfacesFileGenerator: FileGenerator { self.config = config } - var template: TemplateRenderer { + var template: any TemplateRenderer { MockInterfacesTemplate( graphQLInterfaces: graphQLInterfaces, config: config diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/MockObjectFileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/MockObjectFileGenerator.swift index 61f915716..9403d9f70 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/MockObjectFileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/MockObjectFileGenerator.swift @@ -13,7 +13,7 @@ struct MockObjectFileGenerator: FileGenerator { let config: ApolloCodegen.ConfigurationContext - var template: TemplateRenderer { + var template: any TemplateRenderer { MockObjectTemplate( graphqlObject: graphqlObject, fields: fields, diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/MockUnionsFileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/MockUnionsFileGenerator.swift index 3e96e197c..577f68e63 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/MockUnionsFileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/MockUnionsFileGenerator.swift @@ -18,7 +18,7 @@ struct MockUnionsFileGenerator: FileGenerator { self.config = config } - var template: TemplateRenderer { + var template: any TemplateRenderer { MockUnionsTemplate( graphQLUnions: graphQLUnions, config: config diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/ObjectFileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/ObjectFileGenerator.swift index d5512796d..40eccabc8 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/ObjectFileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/ObjectFileGenerator.swift @@ -9,7 +9,7 @@ struct ObjectFileGenerator: FileGenerator { /// Shared codegen configuration. let config: ApolloCodegen.ConfigurationContext - var template: TemplateRenderer { + var template: any TemplateRenderer { ObjectTemplate(graphqlObject: graphqlObject, config: config) } diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/OperationFileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/OperationFileGenerator.swift index ae5ff9b70..f375235dd 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/OperationFileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/OperationFileGenerator.swift @@ -10,7 +10,7 @@ struct OperationFileGenerator: FileGenerator { /// Shared codegen configuration let config: ApolloCodegen.ConfigurationContext - var template: TemplateRenderer { + var template: any TemplateRenderer { irOperation.definition.isLocalCacheMutation ? LocalCacheMutationDefinitionTemplate( operation: irOperation, diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift index feccd14bb..8baa7f9ee 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift @@ -6,7 +6,7 @@ struct SchemaConfigurationFileGenerator: FileGenerator { /// Shared codegen configuration let config: ApolloCodegen.ConfigurationContext - var template: TemplateRenderer { SchemaConfigurationTemplate(config: config) } + var template: any TemplateRenderer { SchemaConfigurationTemplate(config: config) } var overwrite: Bool { false } var target: FileTarget { .schema } var fileName: String { "SchemaConfiguration" } diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaMetadataFileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaMetadataFileGenerator.swift index 8e3627cae..f0493ead2 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaMetadataFileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaMetadataFileGenerator.swift @@ -9,7 +9,7 @@ struct SchemaMetadataFileGenerator: FileGenerator { /// Shared codegen configuration let config: ApolloCodegen.ConfigurationContext - var template: TemplateRenderer { SchemaMetadataTemplate(schema: schema, config: config) } + var template: any TemplateRenderer { SchemaMetadataTemplate(schema: schema, config: config) } var target: FileTarget { .schema } var fileName: String { "SchemaMetadata" } } diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/UnionFileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/UnionFileGenerator.swift index 681d98241..e42d3507b 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/UnionFileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/UnionFileGenerator.swift @@ -8,7 +8,7 @@ struct UnionFileGenerator: FileGenerator { /// Shared codegen configuration. let config: ApolloCodegen.ConfigurationContext - var template: TemplateRenderer { UnionTemplate( + var template: any TemplateRenderer { UnionTemplate( graphqlUnion: graphqlUnion, config: config ) } diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/Glob.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/Glob.swift index 38184ecb9..a3096d72c 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/Glob.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/Glob.swift @@ -151,9 +151,9 @@ public struct Glob { do { let resourceKeys: [URLResourceKey] = [.isDirectoryKey] - var enumeratorError: Error? + var enumeratorError: (any Error)? - let errorHandler: ((URL, Error) -> Bool) = { url, error in + let errorHandler: ((URL, any Error) -> Bool) = { url, error in enumeratorError = error return false // aborts enumeration } diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/OperationIdentifierFactory.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/OperationIdentifierFactory.swift index 4c49e8222..5e1362636 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/OperationIdentifierFactory.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/OperationIdentifierFactory.swift @@ -10,7 +10,7 @@ public typealias OperationIdentifierProvider = (_ operation: OperationDescriptor actor OperationIdentifierFactory { private enum CacheEntry { - case inProgress(Task) + case inProgress(Task) case ready(String) } diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/MockObjectTemplate.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/MockObjectTemplate.swift index 684367a16..35807e9a1 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/MockObjectTemplate.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/MockObjectTemplate.swift @@ -126,7 +126,7 @@ struct MockObjectTemplate: TemplateRenderer { let mockType: String switch graphQLCompositeType { case is GraphQLInterfaceType, is GraphQLUnionType: - mockType = "AnyMock" + mockType = "(any AnyMock)" default: mockType = "Mock<\(graphQLCompositeType.formattedName)>" } diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SchemaMetadataTemplate.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SchemaMetadataTemplate.swift index 897008434..f91b66f14 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SchemaMetadataTemplate.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SchemaMetadataTemplate.swift @@ -37,7 +37,7 @@ struct SchemaMetadataTemplate: TemplateRenderer { \(documentation: schema.documentation, config: config) \(parentAccessLevel)enum SchemaMetadata: \(config.ApolloAPITargetName).SchemaMetadata { \(accessControlModifier(for: .member))\ - static let configuration: \(config.ApolloAPITargetName).SchemaConfiguration.Type = SchemaConfiguration.self + static let configuration: any \(config.ApolloAPITargetName).SchemaConfiguration.Type = SchemaConfiguration.self \(objectTypeFunction) } diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SelectionSetTemplate.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SelectionSetTemplate.swift index d8d0d0b44..b43909540 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SelectionSetTemplate.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SelectionSetTemplate.swift @@ -7,7 +7,7 @@ import Utilities struct SelectionSetTemplate { - let definition: IR.Definition + let definition: any IR.Definition let generateInitializers: Bool let config: ApolloCodegen.ConfigurationContext let nonFatalErrorRecorder: ApolloCodegen.NonFatalError.Recorder @@ -18,7 +18,7 @@ struct SelectionSetTemplate { var isMutable: Bool { definition.isMutable } init( - definition: IR.Definition, + definition: any IR.Definition, generateInitializers: Bool, config: ApolloCodegen.ConfigurationContext, nonFatalErrorRecorder: ApolloCodegen.NonFatalError.Recorder, @@ -236,7 +236,7 @@ struct SelectionSetTemplate { private func ParentTypeTemplate(_ type: GraphQLCompositeType) -> String { """ \(renderAccessControl())\ - static var __parentType: \(config.ApolloAPITargetName).ParentType { \ + static var __parentType: any \(config.ApolloAPITargetName).ParentType { \ \(GeneratedSchemaTypeReference(type)) } """ } diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/URLDownloader.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/URLDownloader.swift index fea901330..cce10ba57 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/URLDownloader.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/URLDownloader.swift @@ -13,14 +13,14 @@ public protocol NetworkSession { /// to `resume`. @discardableResult func loadData( with urlRequest: URLRequest, - completionHandler: @escaping (Data?, URLResponse?, Error?) -> Void + completionHandler: @escaping (Data?, URLResponse?, (any Error)?) -> Void ) -> URLSessionDataTask? } extension URLSession: NetworkSession { public func loadData( with urlRequest: URLRequest, - completionHandler: @escaping (Data?, URLResponse?, Error?) -> Void + completionHandler: @escaping (Data?, URLResponse?, (any Error)?) -> Void ) -> URLSessionDataTask? { let task = dataTask(with: urlRequest) { (data, response, error) in completionHandler(data, response, error) @@ -33,7 +33,7 @@ extension URLSession: NetworkSession { /// A class to help download things from a given remote URL to a given local file URL class URLDownloader { - let session: NetworkSession + let session: any NetworkSession enum DownloadError: Swift.Error, LocalizedError { case badResponse(code: Int, response: String?) @@ -63,7 +63,7 @@ class URLDownloader { /// - Parameters: /// - session: The NetworkSession conforming instance used for downloads, defaults to the /// shared URLSession singleton object. - init(session: NetworkSession? = nil) { + init(session: (any NetworkSession)? = nil) { self.session = session ?? URLSession.shared } @@ -80,10 +80,10 @@ class URLDownloader { timeout: Double ) throws { let semaphore = DispatchSemaphore(value: 0) - var errorToThrow: Error? = DownloadError.downloadTimedOut(after: timeout) + var errorToThrow: (any Error)? = DownloadError.downloadTimedOut(after: timeout) session.loadData(with: request) { data, response, error in - func finished(_ error: Error? = nil) { + func finished(_ error: (any Error)? = nil) { errorToThrow = error semaphore.signal() } diff --git a/apollo-ios-codegen/Sources/CodegenCLI/Commands/FetchSchema.swift b/apollo-ios-codegen/Sources/CodegenCLI/Commands/FetchSchema.swift index b853d6efe..bd11e2f2b 100644 --- a/apollo-ios-codegen/Sources/CodegenCLI/Commands/FetchSchema.swift +++ b/apollo-ios-codegen/Sources/CodegenCLI/Commands/FetchSchema.swift @@ -23,8 +23,8 @@ public struct FetchSchema: AsyncParsableCommand { func _run( fileManager: FileManager = .default, - schemaDownloadProvider: SchemaDownloadProvider.Type = ApolloSchemaDownloader.self, - logger: LogLevelSetter.Type = CodegenLogger.self + schemaDownloadProvider: any SchemaDownloadProvider.Type = ApolloSchemaDownloader.self, + logger: any LogLevelSetter.Type = CodegenLogger.self ) async throws { logger.SetLoggingLevel(verbose: inputs.verbose) @@ -36,7 +36,7 @@ public struct FetchSchema: AsyncParsableCommand { private func fetchSchema( configuration codegenConfiguration: ApolloCodegenConfiguration, - schemaDownloadProvider: SchemaDownloadProvider.Type + schemaDownloadProvider: any SchemaDownloadProvider.Type ) async throws { guard let schemaDownload = codegenConfiguration.schemaDownload else { throw Error(errorDescription: """ diff --git a/apollo-ios-codegen/Sources/CodegenCLI/Commands/Generate.swift b/apollo-ios-codegen/Sources/CodegenCLI/Commands/Generate.swift index 1264ae959..2e7f2bab3 100644 --- a/apollo-ios-codegen/Sources/CodegenCLI/Commands/Generate.swift +++ b/apollo-ios-codegen/Sources/CodegenCLI/Commands/Generate.swift @@ -29,9 +29,9 @@ public struct Generate: AsyncParsableCommand { func _run( fileManager: FileManager = .default, projectRootURL: URL? = nil, - codegenProvider: CodegenProvider.Type = ApolloCodegen.self, - schemaDownloadProvider: SchemaDownloadProvider.Type = ApolloSchemaDownloader.self, - logger: LogLevelSetter.Type = CodegenLogger.self + codegenProvider: any CodegenProvider.Type = ApolloCodegen.self, + schemaDownloadProvider: any SchemaDownloadProvider.Type = ApolloSchemaDownloader.self, + logger: any LogLevelSetter.Type = CodegenLogger.self ) async throws { logger.SetLoggingLevel(verbose: inputs.verbose) @@ -49,8 +49,8 @@ public struct Generate: AsyncParsableCommand { private func generate( configuration: ApolloCodegenConfiguration, - codegenProvider: CodegenProvider.Type, - schemaDownloadProvider: SchemaDownloadProvider.Type + codegenProvider: any CodegenProvider.Type, + schemaDownloadProvider: any SchemaDownloadProvider.Type ) async throws { if fetchSchema { guard @@ -86,7 +86,7 @@ public struct Generate: AsyncParsableCommand { private func fetchSchema( configuration: ApolloSchemaDownloadConfiguration, - schemaDownloadProvider: SchemaDownloadProvider.Type + schemaDownloadProvider: any SchemaDownloadProvider.Type ) async throws { try await schemaDownloadProvider.fetch( configuration: configuration, diff --git a/apollo-ios-codegen/Sources/CodegenCLI/Commands/GenerateOperationManifest.swift b/apollo-ios-codegen/Sources/CodegenCLI/Commands/GenerateOperationManifest.swift index 67cd210a9..d7a1e8b7e 100644 --- a/apollo-ios-codegen/Sources/CodegenCLI/Commands/GenerateOperationManifest.swift +++ b/apollo-ios-codegen/Sources/CodegenCLI/Commands/GenerateOperationManifest.swift @@ -23,8 +23,8 @@ public struct GenerateOperationManifest: AsyncParsableCommand { func _run( fileManager: FileManager = .default, projectRootURL: URL? = nil, - codegenProvider: CodegenProvider.Type = ApolloCodegen.self, - logger: LogLevelSetter.Type = CodegenLogger.self + codegenProvider: any CodegenProvider.Type = ApolloCodegen.self, + logger: any LogLevelSetter.Type = CodegenLogger.self ) async throws { logger.SetLoggingLevel(verbose: inputs.verbose) @@ -40,7 +40,7 @@ public struct GenerateOperationManifest: AsyncParsableCommand { private func generateManifest( configuration: ApolloCodegenConfiguration, - codegenProvider: CodegenProvider.Type + codegenProvider: any CodegenProvider.Type ) async throws { try await codegenProvider.build( with: configuration, diff --git a/apollo-ios-codegen/Sources/CodegenCLI/Protocols/SchemaDownloadProvider.swift b/apollo-ios-codegen/Sources/CodegenCLI/Protocols/SchemaDownloadProvider.swift index f8bbc3b8f..2f39ceaa6 100644 --- a/apollo-ios-codegen/Sources/CodegenCLI/Protocols/SchemaDownloadProvider.swift +++ b/apollo-ios-codegen/Sources/CodegenCLI/Protocols/SchemaDownloadProvider.swift @@ -6,7 +6,7 @@ public protocol SchemaDownloadProvider { static func fetch( configuration: ApolloSchemaDownloadConfiguration, withRootURL rootURL: URL?, - session: NetworkSession? + session: (any NetworkSession)? ) async throws } diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScriptBridge.swift b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScriptBridge.swift index 5b6fa234f..0f5a3578b 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScriptBridge.swift +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScriptBridge.swift @@ -215,7 +215,7 @@ actor JavaScriptBridge { // We keep a bidirectional mapping between constructors and wrapper types so we can both access the // corresponding wrapper type, and perform an `instanceof` check based on the corresponding constructor // for the expected wrapper type in case there isn't a direct match and we are receiving a subtype. - private var constructorToWrapperType: [JSValue /* constructor function */: JavaScriptObjectDecodable.Type] = [:] + private var constructorToWrapperType: [JSValue /* constructor function */: any JavaScriptObjectDecodable.Type] = [:] private var wrapperTypeToConstructor: [AnyHashable /* JavaScriptObjectDecodable.Type */: JSValue] = [:] /// We keep a map between `JSValue` objects and wrapper objects, to avoid repeatedly creating new @@ -238,7 +238,7 @@ actor JavaScriptBridge { } public func register( - _ wrapperType: JavaScriptObjectDecodable.Type, + _ wrapperType: any JavaScriptObjectDecodable.Type, forJavaScriptClass className: String? = nil, from scope: JSValue ) { @@ -252,9 +252,9 @@ actor JavaScriptBridge { } public func register( - _ wrapperType: JavaScriptObjectDecodable.Type, + _ wrapperType: any JavaScriptObjectDecodable.Type, forJavaScriptClass className: String? = nil, - from scope: JavaScriptCallable + from scope: any JavaScriptCallable ) { register(wrapperType, forJavaScriptClass: className, from: scope.jsValue) } @@ -275,7 +275,7 @@ actor JavaScriptBridge { defaultType: Wrapper.self ) - guard let wrapperType = wrapperType as? JavaScriptReferencedObject.Type else { + guard let wrapperType = wrapperType as? any JavaScriptReferencedObject.Type else { preconditionFailure("Expected JavaScriptReferencedObject.Type, got \(wrapperType).") } @@ -287,8 +287,8 @@ actor JavaScriptBridge { private func wrapperTypeForInitializingObject( from jsValue: JSValue, - defaultType: JavaScriptObjectDecodable.Type - ) -> JavaScriptObjectDecodable.Type { + defaultType: any JavaScriptObjectDecodable.Type + ) -> any JavaScriptObjectDecodable.Type { let constructor = jsValue["constructor"] // If an object doesn't have a prototype or has `Object` as its direct prototype, @@ -447,7 +447,7 @@ actor JavaScriptBridge { defaultType: JavaScriptError.self ) - guard let errorType = errorType as? JavaScriptErrorType.Type else { + guard let errorType = errorType as? any JavaScriptErrorType.Type else { throw Error.unrecognizedJavaScriptErrorThrown(exception) } diff --git a/apollo-ios-codegen/Sources/IR/IR+FieldCollector.swift b/apollo-ios-codegen/Sources/IR/IR+FieldCollector.swift index 3e618fc4a..b4327f196 100644 --- a/apollo-ios-codegen/Sources/IR/IR+FieldCollector.swift +++ b/apollo-ios-codegen/Sources/IR/IR+FieldCollector.swift @@ -9,7 +9,7 @@ public actor FieldCollector { ] = [:] func collectFields(from selectionSet: CompilationResult.SelectionSet) { - guard let type = selectionSet.parentType as? GraphQLInterfaceImplementingType else { return } + guard let type = selectionSet.parentType as? (any GraphQLInterfaceImplementingType) else { return } for case let .field(field) in selectionSet.selections { add(field: field, to: type) } @@ -17,7 +17,7 @@ public actor FieldCollector { func add( fields: T, - to type: GraphQLInterfaceImplementingType + to type: any GraphQLInterfaceImplementingType ) where T.Element == CompilationResult.Field { for field in fields { add(field: field, to: type) @@ -26,7 +26,7 @@ public actor FieldCollector { func add( field: CompilationResult.Field, - to type: GraphQLInterfaceImplementingType + to type: any GraphQLInterfaceImplementingType ) { var fields = collectedFields[type] ?? [:] add(field, to: &fields) @@ -44,7 +44,7 @@ public actor FieldCollector { } public func collectedFields( - for type: GraphQLInterfaceImplementingType + for type: any GraphQLInterfaceImplementingType ) -> [(String, GraphQLType, deprecationReason: String?)] { var fields = collectedFields[type] ?? [:] diff --git a/apollo-ios-codegen/Sources/IR/IR+RootFieldBuilder.swift b/apollo-ios-codegen/Sources/IR/IR+RootFieldBuilder.swift index 967c46b4c..c9cdbfd65 100644 --- a/apollo-ios-codegen/Sources/IR/IR+RootFieldBuilder.swift +++ b/apollo-ios-codegen/Sources/IR/IR+RootFieldBuilder.swift @@ -270,7 +270,7 @@ class RootFieldBuilder { } private func scopeCondition( - for conditionalSelectionSet: ConditionallyIncludable, + for conditionalSelectionSet: any ConditionallyIncludable, in parentTypePath: SelectionSet.TypeInfo, isDeferred: Bool = false ) -> ScopeCondition? { diff --git a/apollo-ios-codegen/Sources/IR/IR+ScopeDescriptor.swift b/apollo-ios-codegen/Sources/IR/IR+ScopeDescriptor.swift index bd3fd316a..d1238cadc 100644 --- a/apollo-ios-codegen/Sources/IR/IR+ScopeDescriptor.swift +++ b/apollo-ios-codegen/Sources/IR/IR+ScopeDescriptor.swift @@ -130,7 +130,7 @@ public struct ScopeDescriptor: Hashable, CustomDebugStringConvertible { var newScope = scope ?? [] newScope.append(newType) - if let newType = newType as? GraphQLInterfaceImplementingType { + if let newType = newType as? (any GraphQLInterfaceImplementingType) { newScope.formUnion(newType.interfaces) } diff --git a/apollo-ios-pagination/Package.swift b/apollo-ios-pagination/Package.swift index 379c2cc6f..db7da8aad 100644 --- a/apollo-ios-pagination/Package.swift +++ b/apollo-ios-pagination/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.8 +// swift-tools-version: 5.9 import PackageDescription @@ -30,7 +30,8 @@ let package = Package( .product(name: "Apollo", package: "apollo-ios"), .product(name: "ApolloAPI", package: "apollo-ios"), .product(name: "OrderedCollections", package: "swift-collections"), - ] + ], + swiftSettings: [.enableUpcomingFeature("ExistentialAny")] ), ] ) diff --git a/apollo-ios-pagination/Sources/ApolloPagination/AsyncGraphQLQueryPager.swift b/apollo-ios-pagination/Sources/ApolloPagination/AsyncGraphQLQueryPager.swift index e144667c3..eeea21506 100644 --- a/apollo-ios-pagination/Sources/ApolloPagination/AsyncGraphQLQueryPager.swift +++ b/apollo-ios-pagination/Sources/ApolloPagination/AsyncGraphQLQueryPager.swift @@ -6,7 +6,7 @@ import Foundation /// Type-erases a query pager, transforming data from a generic type to a specific type, often a view model or array of view models. public class AsyncGraphQLQueryPager: Publisher { public typealias Failure = Never - public typealias Output = Result<(Model, UpdateSource), Error> + public typealias Output = Result<(Model, UpdateSource), any Error> let _subject: CurrentValueSubject = .init(nil) var publisher: AnyPublisher { _subject.compactMap({ $0 }).eraseToAnyPublisher() } @Atomic public var cancellables: Set = [] @@ -92,7 +92,7 @@ public class AsyncGraphQLQueryPager: Publisher { PaginatedQuery: GraphQLQuery, Element >( - client: ApolloClientProtocol, + client: any ApolloClientProtocol, initialQuery: InitialQuery, watcherDispatchQueue: DispatchQueue = .main, extractPageInfo: @escaping (PageExtractionData) -> P, @@ -138,7 +138,7 @@ public class AsyncGraphQLQueryPager: Publisher { InitialQuery: GraphQLQuery, PaginatedQuery: GraphQLQuery >( - client: ApolloClientProtocol, + client: any ApolloClientProtocol, initialQuery: InitialQuery, watcherDispatchQueue: DispatchQueue = .main, extractPageInfo: @escaping (PageExtractionData) -> P, @@ -161,7 +161,7 @@ public class AsyncGraphQLQueryPager: Publisher { InitialQuery: GraphQLQuery, PaginatedQuery: GraphQLQuery >( - client: ApolloClientProtocol, + client: any ApolloClientProtocol, initialQuery: InitialQuery, watcherDispatchQueue: DispatchQueue = .main, extractPageInfo: @escaping (PageExtractionData) -> P, @@ -248,7 +248,7 @@ public class AsyncGraphQLQueryPager: Publisher { public func receive( subscriber: S - ) where S: Subscriber, Never == S.Failure, Result<(Model, UpdateSource), Error> == S.Input { + ) where S: Subscriber, Never == S.Failure, Result<(Model, UpdateSource), any Error> == S.Input { publisher.subscribe(subscriber) } } diff --git a/apollo-ios-pagination/Sources/ApolloPagination/AsyncGraphQLQueryPagerCoordinator.swift b/apollo-ios-pagination/Sources/ApolloPagination/AsyncGraphQLQueryPagerCoordinator.swift index adc882ce4..2d763df08 100644 --- a/apollo-ios-pagination/Sources/ApolloPagination/AsyncGraphQLQueryPagerCoordinator.swift +++ b/apollo-ios-pagination/Sources/ApolloPagination/AsyncGraphQLQueryPagerCoordinator.swift @@ -24,11 +24,11 @@ actor AsyncGraphQLQueryPagerCoordinator PaginatedQuery? - let previousPageResolver: (PaginationInfo) -> PaginatedQuery? - let extractPageInfo: (PageExtractionData?>) -> PaginationInfo - var nextPageInfo: PaginationInfo? { nextPageTransformation() } - var previousPageInfo: PaginationInfo? { previousPageTransformation() } + let nextPageResolver: (any PaginationInfo) -> PaginatedQuery? + let previousPageResolver: (any PaginationInfo) -> PaginatedQuery? + let extractPageInfo: (PageExtractionData?>) -> any PaginationInfo + var nextPageInfo: (any PaginationInfo)? { nextPageTransformation() } + var previousPageInfo: (any PaginationInfo)? { previousPageTransformation() } var canLoadPages: (next: Bool, previous: Bool) { (canLoadNext, canLoadPrevious) @@ -42,7 +42,7 @@ actor AsyncGraphQLQueryPagerCoordinator, UpdateSource), Error> + typealias ResultType = Result<(PaginationOutput, UpdateSource), any Error> @Published var currentValue: ResultType? private var queuedValue: ResultType? @@ -60,8 +60,8 @@ actor AsyncGraphQLQueryPagerCoordinator, PaginatedQuery.Data> = [:] @Published var previousPageVarMap: OrderedDictionary, PaginatedQuery.Data> = [:] - private var tasks: Set> = [] - private var taskGroup: ThrowingTaskGroup? + private var tasks: Set> = [] + private var taskGroup: ThrowingTaskGroup? private var watcherCallbackQueue: DispatchQueue /// Designated Initializer @@ -72,7 +72,7 @@ actor AsyncGraphQLQueryPagerCoordinator( - client: ApolloClientProtocol, + client: any ApolloClientProtocol, initialQuery: InitialQuery, watcherDispatchQueue: DispatchQueue = .main, extractPageInfo: @escaping (PageExtractionData?>) -> P, @@ -168,7 +168,7 @@ actor AsyncGraphQLQueryPagerCoordinator, UpdateSource), Error>) -> Void + onUpdate: @escaping (Result<(PaginationOutput, UpdateSource), any Error>) -> Void ) -> AnyCancellable { $currentValue.compactMap({ $0 }) .sink { [weak self] result in @@ -287,7 +287,7 @@ actor AsyncGraphQLQueryPagerCoordinator( fetchType: FetchType, cachePolicy: CachePolicy, - result: Result, Error>, + result: Result, any Error>, publisher: CurrentValueSubject ) { switch result { @@ -311,7 +311,7 @@ actor AsyncGraphQLQueryPagerCoordinator, UpdateSource), Error>? + var value: Result<(PaginationOutput, UpdateSource), any Error>? var output: ([PaginatedQuery.Data], InitialQuery.Data, [PaginatedQuery.Data])? switch fetchType { case .initial: @@ -360,7 +360,7 @@ actor AsyncGraphQLQueryPagerCoordinator PaginationInfo? { + private func nextPageTransformation() -> (any PaginationInfo)? { let currentValue = try? currentValue?.get().0 guard let last = nextPageVarMap.values.last else { return initialPageResult.flatMap { extractPageInfo(.initial($0, currentValue)) } @@ -368,7 +368,7 @@ actor AsyncGraphQLQueryPagerCoordinator PaginationInfo? { + private func previousPageTransformation() -> (any PaginationInfo)? { let currentValue = try? currentValue?.get().0 guard let first = previousPageVarMap.values.last else { return initialPageResult.flatMap { extractPageInfo(.initial($0, currentValue)) } diff --git a/apollo-ios-pagination/Sources/ApolloPagination/GraphQLQueryPager+Convenience.swift b/apollo-ios-pagination/Sources/ApolloPagination/GraphQLQueryPager+Convenience.swift index cf8f10b16..c879defda 100644 --- a/apollo-ios-pagination/Sources/ApolloPagination/GraphQLQueryPager+Convenience.swift +++ b/apollo-ios-pagination/Sources/ApolloPagination/GraphQLQueryPager+Convenience.swift @@ -9,7 +9,7 @@ public extension GraphQLQueryPager { /// Convenience initializer for creating a pager that has a single query and does not /// transform output responses. convenience init( - client: ApolloClientProtocol, + client: any ApolloClientProtocol, watcherDispatchQueue: DispatchQueue = .main, initialQuery: InitialQuery, extractPageInfo: @escaping (InitialQuery.Data) -> P, @@ -28,7 +28,7 @@ public extension GraphQLQueryPager { /// Convenience initializer for creating a pager that has a single query and /// transforms output responses. convenience init( - client: ApolloClientProtocol, + client: any ApolloClientProtocol, watcherDispatchQueue: DispatchQueue = .main, initialQuery: InitialQuery, extractPageInfo: @escaping (InitialQuery.Data) -> P, @@ -50,7 +50,7 @@ public extension GraphQLQueryPager { /// Convenience initializer for creating a pager that has a single query and /// transforms output responses into a collection. convenience init( - client: ApolloClientProtocol, + client: any ApolloClientProtocol, watcherDispatchQueue: DispatchQueue = .main, initialQuery: InitialQuery, extractPageInfo: @escaping (InitialQuery.Data) -> P, @@ -73,7 +73,7 @@ public extension GraphQLQueryPager { /// Convenience initializer for creating a multi-query pager that does not /// transform output responses. convenience init( - client: ApolloClientProtocol, + client: any ApolloClientProtocol, initialQuery: InitialQuery, watcherDispatchQueue: DispatchQueue = .main, extractInitialPageInfo: @escaping (InitialQuery.Data) -> P, @@ -96,7 +96,7 @@ public extension GraphQLQueryPager { /// Convenience initializer for creating a multi-query pager that transforms output responses. convenience init( - client: ApolloClientProtocol, + client: any ApolloClientProtocol, initialQuery: InitialQuery, watcherDispatchQueue: DispatchQueue = .main, extractInitialPageInfo: @escaping (InitialQuery.Data) -> P, @@ -122,7 +122,7 @@ public extension GraphQLQueryPager { /// Convenience initializer for creating a multi-query pager that /// transforms output responses into collections convenience init( - client: ApolloClientProtocol, + client: any ApolloClientProtocol, initialQuery: InitialQuery, watcherDispatchQueue: DispatchQueue = .main, extractInitialPageInfo: @escaping (InitialQuery.Data) -> P, @@ -154,7 +154,7 @@ public extension AsyncGraphQLQueryPager { /// Convenience initializer for creating a pager that has a single query and does not /// transform output responses. convenience init( - client: ApolloClientProtocol, + client: any ApolloClientProtocol, watcherDispatchQueue: DispatchQueue = .main, initialQuery: InitialQuery, extractPageInfo: @escaping (InitialQuery.Data) -> P, @@ -173,7 +173,7 @@ public extension AsyncGraphQLQueryPager { /// Convenience initializer for creating a pager that has a single query and /// transforms output responses. convenience init( - client: ApolloClientProtocol, + client: any ApolloClientProtocol, watcherDispatchQueue: DispatchQueue = .main, initialQuery: InitialQuery, extractPageInfo: @escaping (InitialQuery.Data) -> P, @@ -195,7 +195,7 @@ public extension AsyncGraphQLQueryPager { /// Convenience initializer for creating a pager that has a single query and /// transforms output responses into a collection. convenience init( - client: ApolloClientProtocol, + client: any ApolloClientProtocol, watcherDispatchQueue: DispatchQueue = .main, initialQuery: InitialQuery, extractPageInfo: @escaping (InitialQuery.Data) -> P, @@ -218,7 +218,7 @@ public extension AsyncGraphQLQueryPager { /// Convenience initializer for creating a multi-query pager that does not /// transform output responses. convenience init( - client: ApolloClientProtocol, + client: any ApolloClientProtocol, initialQuery: InitialQuery, watcherDispatchQueue: DispatchQueue = .main, extractInitialPageInfo: @escaping (InitialQuery.Data) -> P, @@ -242,7 +242,7 @@ public extension AsyncGraphQLQueryPager { /// Convenience initializer for creating a multi-query pager that /// transforms output responses. convenience init( - client: ApolloClientProtocol, + client: any ApolloClientProtocol, initialQuery: InitialQuery, watcherDispatchQueue: DispatchQueue = .main, extractInitialPageInfo: @escaping (InitialQuery.Data) -> P, @@ -268,7 +268,7 @@ public extension AsyncGraphQLQueryPager { /// Convenience initializer for creating a multi-query pager that /// transforms output responses into collections convenience init( - client: ApolloClientProtocol, + client: any ApolloClientProtocol, initialQuery: InitialQuery, watcherDispatchQueue: DispatchQueue = .main, extractInitialPageInfo: @escaping (InitialQuery.Data) -> P, diff --git a/apollo-ios-pagination/Sources/ApolloPagination/GraphQLQueryPager.swift b/apollo-ios-pagination/Sources/ApolloPagination/GraphQLQueryPager.swift index 3f3a131bd..dcd47afa8 100644 --- a/apollo-ios-pagination/Sources/ApolloPagination/GraphQLQueryPager.swift +++ b/apollo-ios-pagination/Sources/ApolloPagination/GraphQLQueryPager.swift @@ -6,7 +6,7 @@ import Foundation /// Type-erases a query pager, transforming data from a generic type to a specific type, often a view model or array of view models. public class GraphQLQueryPager: Publisher { public typealias Failure = Never - public typealias Output = Result<(Model, UpdateSource), Error> + public typealias Output = Result<(Model, UpdateSource), any Error> let _subject: CurrentValueSubject = .init(nil) var publisher: AnyPublisher { _subject.compactMap { $0 }.eraseToAnyPublisher() } public var cancellables: Set = [] @@ -76,7 +76,7 @@ public class GraphQLQueryPager: Publisher { InitialQuery: GraphQLQuery, PaginatedQuery: GraphQLQuery >( - client: ApolloClientProtocol, + client: any ApolloClientProtocol, watcherDispatchQueue: DispatchQueue = .main, initialQuery: InitialQuery, extractPageInfo: @escaping (PageExtractionData) -> P, @@ -98,7 +98,7 @@ public class GraphQLQueryPager: Publisher { PaginatedQuery: GraphQLQuery, Element >( - client: ApolloClientProtocol, + client: any ApolloClientProtocol, initialQuery: InitialQuery, watcherDispatchQueue: DispatchQueue = .main, extractPageInfo: @escaping (PageExtractionData) -> P, @@ -144,7 +144,7 @@ public class GraphQLQueryPager: Publisher { InitialQuery: GraphQLQuery, PaginatedQuery: GraphQLQuery >( - client: ApolloClientProtocol, + client: any ApolloClientProtocol, initialQuery: InitialQuery, watcherDispatchQueue: DispatchQueue = .main, extractPageInfo: @escaping (PageExtractionData) -> P, @@ -258,7 +258,7 @@ public class GraphQLQueryPager: Publisher { public func receive( subscriber: S - ) where S: Subscriber, Never == S.Failure, Result<(Model, UpdateSource), Error> == S.Input { + ) where S: Subscriber, Never == S.Failure, Result<(Model, UpdateSource), any Error> == S.Input { publisher.subscribe(subscriber) } } diff --git a/apollo-ios-pagination/Sources/ApolloPagination/GraphQLQueryPagerCoordinator.swift b/apollo-ios-pagination/Sources/ApolloPagination/GraphQLQueryPagerCoordinator.swift index 50c348772..900a5912d 100644 --- a/apollo-ios-pagination/Sources/ApolloPagination/GraphQLQueryPagerCoordinator.swift +++ b/apollo-ios-pagination/Sources/ApolloPagination/GraphQLQueryPagerCoordinator.swift @@ -42,12 +42,12 @@ class GraphQLQueryPagerCoordinator, UpdateSource), Error>, Never> { + var publisher: AnyPublisher, UpdateSource), any Error>, Never> { get async { await pager.$currentValue.compactMap { $0 }.eraseToAnyPublisher() } } init( - client: ApolloClientProtocol, + client: any ApolloClientProtocol, initialQuery: InitialQuery, watcherDispatchQueue: DispatchQueue = .main, extractPageInfo: @escaping (PageExtractionData?>) -> P, @@ -87,7 +87,7 @@ class GraphQLQueryPagerCoordinator, UpdateSource), Error>) -> Void) { + func subscribe(onUpdate: @escaping (Result<(PaginationOutput, UpdateSource), any Error>) -> Void) { Task { [weak self] in guard let self else { return } let subscription = await self.pager.subscribe(onUpdate: onUpdate) diff --git a/apollo-ios-pagination/Sources/ApolloPagination/PaginationError.swift b/apollo-ios-pagination/Sources/ApolloPagination/PaginationError.swift index 1aa93e526..5877f95cf 100644 --- a/apollo-ios-pagination/Sources/ApolloPagination/PaginationError.swift +++ b/apollo-ios-pagination/Sources/ApolloPagination/PaginationError.swift @@ -5,5 +5,5 @@ public enum PaginationError: Error { case noQuery case cancellation // Workaround for https://github.com/apple/swift-evolution/blob/f0128e6ed3cbea226c66c8ac630e216dd4140a69/proposals/0413-typed-throws.md - case unknown(Error) + case unknown(any Error) } diff --git a/apollo-ios/Package.swift b/apollo-ios/Package.swift index 118afae79..b0d35db3d 100644 --- a/apollo-ios/Package.swift +++ b/apollo-ios/Package.swift @@ -34,14 +34,16 @@ let package = Package( ], resources: [ .copy("Resources/PrivacyInfo.xcprivacy") - ] + ], + swiftSettings: [.enableUpcomingFeature("ExistentialAny")] ), .target( name: "ApolloAPI", dependencies: [], resources: [ .copy("Resources/PrivacyInfo.xcprivacy") - ] + ], + swiftSettings: [.enableUpcomingFeature("ExistentialAny")] ), .target( name: "ApolloSQLite", @@ -51,7 +53,8 @@ let package = Package( ], resources: [ .copy("Resources/PrivacyInfo.xcprivacy") - ] + ], + swiftSettings: [.enableUpcomingFeature("ExistentialAny")] ), .target( name: "ApolloWebSocket", @@ -60,14 +63,16 @@ let package = Package( ], resources: [ .copy("Resources/PrivacyInfo.xcprivacy") - ] + ], + swiftSettings: [.enableUpcomingFeature("ExistentialAny")] ), .target( name: "ApolloTestSupport", dependencies: [ "Apollo", "ApolloAPI" - ] + ], + swiftSettings: [.enableUpcomingFeature("ExistentialAny")] ), .plugin( name: "Install CLI", diff --git a/apollo-ios/Sources/Apollo/ApolloClient.swift b/apollo-ios/Sources/Apollo/ApolloClient.swift index b45c9f48d..189084372 100644 --- a/apollo-ios/Sources/Apollo/ApolloClient.swift +++ b/apollo-ios/Sources/Apollo/ApolloClient.swift @@ -25,12 +25,12 @@ public enum CachePolicy: Hashable { /// /// - Parameters: /// - result: The result of a performed operation. Will have a `GraphQLResult` with any parsed data and any GraphQL errors on `success`, and an `Error` on `failure`. -public typealias GraphQLResultHandler = (Result, Error>) -> Void +public typealias GraphQLResultHandler = (Result, any Error>) -> Void /// The `ApolloClient` class implements the core API for Apollo by conforming to `ApolloClientProtocol`. public class ApolloClient { - let networkTransport: NetworkTransport + let networkTransport: any NetworkTransport public let store: ApolloStore @@ -50,7 +50,7 @@ public class ApolloClient { /// - Parameters: /// - networkTransport: A network transport used to send operations to a server. /// - store: A store used as a local cache. Note that if the `NetworkTransport` or any of its dependencies takes a store, you should make sure the same store is passed here so that it can be cleared properly. - public init(networkTransport: NetworkTransport, store: ApolloStore) { + public init(networkTransport: any NetworkTransport, store: ApolloStore) { self.networkTransport = networkTransport self.store = store } @@ -73,7 +73,7 @@ public class ApolloClient { extension ApolloClient: ApolloClientProtocol { public func clearCache(callbackQueue: DispatchQueue = .main, - completion: ((Result) -> Void)? = nil) { + completion: ((Result) -> Void)? = nil) { self.store.clearCache(callbackQueue: callbackQueue, completion: completion) } @@ -81,10 +81,10 @@ extension ApolloClient: ApolloClientProtocol { query: Query, cachePolicy: CachePolicy = .default, contextIdentifier: UUID? = nil, - context: RequestContext? = nil, + context: (any RequestContext)? = nil, queue: DispatchQueue = .main, resultHandler: GraphQLResultHandler? = nil - ) -> Cancellable { + ) -> (any Cancellable) { return self.networkTransport.send(operation: query, cachePolicy: cachePolicy, contextIdentifier: contextIdentifier, @@ -109,7 +109,7 @@ extension ApolloClient: ApolloClientProtocol { query: Query, cachePolicy: CachePolicy = .default, refetchOnFailedUpdates: Bool = true, - context: RequestContext? = nil, + context: (any RequestContext)? = nil, callbackQueue: DispatchQueue = .main, resultHandler: @escaping GraphQLResultHandler ) -> GraphQLQueryWatcher { @@ -128,10 +128,10 @@ extension ApolloClient: ApolloClientProtocol { mutation: Mutation, publishResultToStore: Bool = true, contextIdentifier: UUID? = nil, - context: RequestContext? = nil, + context: (any RequestContext)? = nil, queue: DispatchQueue = .main, resultHandler: GraphQLResultHandler? = nil - ) -> Cancellable { + ) -> (any Cancellable) { return self.networkTransport.send( operation: mutation, cachePolicy: publishResultToStore ? .default : .fetchIgnoringCacheCompletely, @@ -148,11 +148,11 @@ extension ApolloClient: ApolloClientProtocol { public func upload( operation: Operation, files: [GraphQLFile], - context: RequestContext? = nil, + context: (any RequestContext)? = nil, queue: DispatchQueue = .main, resultHandler: GraphQLResultHandler? = nil - ) -> Cancellable { - guard let uploadingTransport = self.networkTransport as? UploadingNetworkTransport else { + ) -> (any Cancellable) { + guard let uploadingTransport = self.networkTransport as? (any UploadingNetworkTransport) else { assertionFailure("Trying to upload without an uploading transport. Please make sure your network transport conforms to `UploadingNetworkTransport`.") queue.async { resultHandler?(.failure(ApolloClientError.noUploadTransport)) @@ -170,10 +170,10 @@ extension ApolloClient: ApolloClientProtocol { public func subscribe( subscription: Subscription, - context: RequestContext? = nil, + context: (any RequestContext)? = nil, queue: DispatchQueue = .main, resultHandler: @escaping GraphQLResultHandler - ) -> Cancellable { + ) -> any Cancellable { return self.networkTransport.send(operation: subscription, cachePolicy: .default, contextIdentifier: nil, @@ -192,7 +192,7 @@ extension ApolloClient { public func watch( query: Query, cachePolicy: CachePolicy = .default, - context: RequestContext? = nil, + context: (any RequestContext)? = nil, callbackQueue: DispatchQueue = .main, resultHandler: @escaping GraphQLResultHandler ) -> GraphQLQueryWatcher { diff --git a/apollo-ios/Sources/Apollo/ApolloClientProtocol.swift b/apollo-ios/Sources/Apollo/ApolloClientProtocol.swift index deb877ec3..e10102d21 100644 --- a/apollo-ios/Sources/Apollo/ApolloClientProtocol.swift +++ b/apollo-ios/Sources/Apollo/ApolloClientProtocol.swift @@ -15,7 +15,7 @@ public protocol ApolloClientProtocol: AnyObject { /// - Parameters: /// - callbackQueue: The queue to fall back on. Should default to the main queue. /// - completion: [optional] A completion closure to execute when clearing has completed. Should default to nil. - func clearCache(callbackQueue: DispatchQueue, completion: ((Result) -> Void)?) + func clearCache(callbackQueue: DispatchQueue, completion: ((Result) -> Void)?) /// Fetches a query from the server or from the local cache, depending on the current contents of the cache and the specified cache policy. /// @@ -30,9 +30,9 @@ public protocol ApolloClientProtocol: AnyObject { func fetch(query: Query, cachePolicy: CachePolicy, contextIdentifier: UUID?, - context: RequestContext?, + context: (any RequestContext)?, queue: DispatchQueue, - resultHandler: GraphQLResultHandler?) -> Cancellable + resultHandler: GraphQLResultHandler?) -> (any Cancellable) /// Watches a query by first fetching an initial result from the server or from the local cache, depending on the current contents of the cache and the specified cache policy. After the initial fetch, the returned query watcher object will get notified whenever any of the data the query result depends on changes in the local cache, and calls the result handler again with the new result. /// @@ -45,7 +45,7 @@ public protocol ApolloClientProtocol: AnyObject { /// - Returns: A query watcher object that can be used to control the watching behavior. func watch(query: Query, cachePolicy: CachePolicy, - context: RequestContext?, + context: (any RequestContext)?, callbackQueue: DispatchQueue, resultHandler: @escaping GraphQLResultHandler) -> GraphQLQueryWatcher @@ -62,9 +62,9 @@ public protocol ApolloClientProtocol: AnyObject { func perform(mutation: Mutation, publishResultToStore: Bool, contextIdentifier: UUID?, - context: RequestContext?, + context: (any RequestContext)?, queue: DispatchQueue, - resultHandler: GraphQLResultHandler?) -> Cancellable + resultHandler: GraphQLResultHandler?) -> (any Cancellable) /// Uploads the given files with the given operation. /// @@ -77,9 +77,9 @@ public protocol ApolloClientProtocol: AnyObject { /// - Returns: An object that can be used to cancel an in progress request. func upload(operation: Operation, files: [GraphQLFile], - context: RequestContext?, + context: (any RequestContext)?, queue: DispatchQueue, - resultHandler: GraphQLResultHandler?) -> Cancellable + resultHandler: GraphQLResultHandler?) -> (any Cancellable) /// Subscribe to a subscription /// @@ -91,9 +91,9 @@ public protocol ApolloClientProtocol: AnyObject { /// - resultHandler: An optional closure that is called when mutation results are available or when an error occurs. /// - Returns: An object that can be used to cancel an in progress subscription. func subscribe(subscription: Subscription, - context: RequestContext?, + context: (any RequestContext)?, queue: DispatchQueue, - resultHandler: @escaping GraphQLResultHandler) -> Cancellable + resultHandler: @escaping GraphQLResultHandler) -> any Cancellable } // MARK: - Backwards Compatibilty Extension @@ -112,10 +112,10 @@ public extension ApolloClientProtocol { func fetch( query: Query, cachePolicy: CachePolicy, - context: RequestContext?, + context: (any RequestContext)?, queue: DispatchQueue, resultHandler: GraphQLResultHandler? - ) -> Cancellable { + ) -> (any Cancellable) { self.fetch( query: query, cachePolicy: cachePolicy, @@ -138,10 +138,10 @@ public extension ApolloClientProtocol { func perform( mutation: Mutation, publishResultToStore: Bool, - context: RequestContext?, + context: (any RequestContext)?, queue: DispatchQueue, resultHandler: GraphQLResultHandler? - ) -> Cancellable { + ) -> (any Cancellable) { self.perform( mutation: mutation, publishResultToStore: publishResultToStore, diff --git a/apollo-ios/Sources/Apollo/ApolloErrorInterceptor.swift b/apollo-ios/Sources/Apollo/ApolloErrorInterceptor.swift index cb7cdc364..8b088e837 100644 --- a/apollo-ios/Sources/Apollo/ApolloErrorInterceptor.swift +++ b/apollo-ios/Sources/Apollo/ApolloErrorInterceptor.swift @@ -14,9 +14,9 @@ public protocol ApolloErrorInterceptor { /// - response: [optional] The response, if one was received /// - completion: The completion closure to fire when the operation has completed. Note that if you call `retry` on the chain, you will not want to call the completion block in this method. func handleErrorAsync( - error: Error, - chain: RequestChain, - request: HTTPRequest, - response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void) + error: any Error, + chain: any RequestChain, + request: HTTPRequest, + response: HTTPResponse?, + completion: @escaping (Result, any Error>) -> Void) } diff --git a/apollo-ios/Sources/Apollo/ApolloInterceptor.swift b/apollo-ios/Sources/Apollo/ApolloInterceptor.swift index 81b36c676..c999f298a 100644 --- a/apollo-ios/Sources/Apollo/ApolloInterceptor.swift +++ b/apollo-ios/Sources/Apollo/ApolloInterceptor.swift @@ -20,8 +20,8 @@ public protocol ApolloInterceptor { /// - response: [optional] The response, if received /// - completion: The completion block to fire when data needs to be returned to the UI. func interceptAsync( - chain: RequestChain, + chain: any RequestChain, request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void) + completion: @escaping (Result, any Error>) -> Void) } diff --git a/apollo-ios/Sources/Apollo/ApolloStore.swift b/apollo-ios/Sources/Apollo/ApolloStore.swift index a960b9c21..09729513a 100644 --- a/apollo-ios/Sources/Apollo/ApolloStore.swift +++ b/apollo-ios/Sources/Apollo/ApolloStore.swift @@ -22,16 +22,16 @@ public protocol ApolloStoreSubscriber: AnyObject { /// The `ApolloStore` class acts as a local cache for normalized GraphQL results. public class ApolloStore { - private let cache: NormalizedCache + private let cache: any NormalizedCache private let queue: DispatchQueue - internal var subscribers: [ApolloStoreSubscriber] = [] + internal var subscribers: [any ApolloStoreSubscriber] = [] /// Designated initializer /// - Parameters: /// - cache: An instance of `normalizedCache` to use to cache results. /// Defaults to an `InMemoryNormalizedCache`. - public init(cache: NormalizedCache = InMemoryNormalizedCache()) { + public init(cache: any NormalizedCache = InMemoryNormalizedCache()) { self.cache = cache self.queue = DispatchQueue(label: "com.apollographql.ApolloStore", attributes: .concurrent) } @@ -47,7 +47,7 @@ public class ApolloStore { /// - Parameters: /// - callbackQueue: The queue to call the completion block on. Defaults to `DispatchQueue.main`. /// - completion: [optional] A completion block to be called after records are merged into the cache. - public func clearCache(callbackQueue: DispatchQueue = .main, completion: ((Result) -> Void)? = nil) { + public func clearCache(callbackQueue: DispatchQueue = .main, completion: ((Result) -> Void)? = nil) { queue.async(flags: .barrier) { let result = Result { try self.cache.clear() } DispatchQueue.returnResultAsyncIfNeeded( @@ -65,7 +65,7 @@ public class ApolloStore { /// to assist in de-duping cache hits for watchers. /// - callbackQueue: The queue to call the completion block on. Defaults to `DispatchQueue.main`. /// - completion: [optional] A completion block to be called after records are merged into the cache. - public func publish(records: RecordSet, identifier: UUID? = nil, callbackQueue: DispatchQueue = .main, completion: ((Result) -> Void)? = nil) { + public func publish(records: RecordSet, identifier: UUID? = nil, callbackQueue: DispatchQueue = .main, completion: ((Result) -> Void)? = nil) { queue.async(flags: .barrier) { do { let changedKeys = try self.cache.merge(records: records) @@ -90,7 +90,7 @@ public class ApolloStore { /// - Parameters: /// - subscriber: A subscriber to receive content change notificatons. To avoid a retain cycle, /// ensure you call `unsubscribe` on this subscriber before it goes out of scope. - public func subscribe(_ subscriber: ApolloStoreSubscriber) { + public func subscribe(_ subscriber: any ApolloStoreSubscriber) { queue.async(flags: .barrier) { self.subscribers.append(subscriber) } @@ -101,7 +101,7 @@ public class ApolloStore { /// - Parameters: /// - subscriber: A subscribe that has previously been added via `subscribe`. To avoid retain cycles, /// call `unsubscribe` on all active subscribers before they go out of scope. - public func unsubscribe(_ subscriber: ApolloStoreSubscriber) { + public func unsubscribe(_ subscriber: any ApolloStoreSubscriber) { queue.async(flags: .barrier) { self.subscribers = self.subscribers.filter({ $0 !== subscriber }) } @@ -116,7 +116,7 @@ public class ApolloStore { public func withinReadTransaction( _ body: @escaping (ReadTransaction) throws -> T, callbackQueue: DispatchQueue? = nil, - completion: ((Result) -> Void)? = nil + completion: ((Result) -> Void)? = nil ) { self.queue.async { do { @@ -146,7 +146,7 @@ public class ApolloStore { public func withinReadWriteTransaction( _ body: @escaping (ReadWriteTransaction) throws -> T, callbackQueue: DispatchQueue? = nil, - completion: ((Result) -> Void)? = nil + completion: ((Result) -> Void)? = nil ) { self.queue.async(flags: .barrier) { do { @@ -201,7 +201,7 @@ public class ApolloStore { } public class ReadTransaction { - fileprivate let cache: NormalizedCache + fileprivate let cache: any NormalizedCache fileprivate lazy var loader: DataLoader = DataLoader(self.cache.loadRecords) fileprivate lazy var executor = GraphQLExecutor( diff --git a/apollo-ios/Sources/Apollo/AutomaticPersistedQueryInterceptor.swift b/apollo-ios/Sources/Apollo/AutomaticPersistedQueryInterceptor.swift index d42bd72bd..5de2506a0 100644 --- a/apollo-ios/Sources/Apollo/AutomaticPersistedQueryInterceptor.swift +++ b/apollo-ios/Sources/Apollo/AutomaticPersistedQueryInterceptor.swift @@ -30,10 +30,10 @@ public struct AutomaticPersistedQueryInterceptor: ApolloInterceptor { public init() {} public func interceptAsync( - chain: RequestChain, + chain: any RequestChain, request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void) { + completion: @escaping (Result, any Error>) -> Void) { guard let jsonRequest = request as? JSONRequest, jsonRequest.autoPersistQueries else { diff --git a/apollo-ios/Sources/Apollo/CacheReadInterceptor.swift b/apollo-ios/Sources/Apollo/CacheReadInterceptor.swift index 111a1df45..4c8acebdc 100644 --- a/apollo-ios/Sources/Apollo/CacheReadInterceptor.swift +++ b/apollo-ios/Sources/Apollo/CacheReadInterceptor.swift @@ -18,10 +18,10 @@ public struct CacheReadInterceptor: ApolloInterceptor { } public func interceptAsync( - chain: RequestChain, + chain: any RequestChain, request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void) { + completion: @escaping (Result, any Error>) -> Void) { switch Operation.operationType { case .mutation, @@ -115,8 +115,8 @@ public struct CacheReadInterceptor: ApolloInterceptor { private func fetchFromCache( for request: HTTPRequest, - chain: RequestChain, - completion: @escaping (Result, Error>) -> Void) { + chain: any RequestChain, + completion: @escaping (Result, any Error>) -> Void) { self.store.load(request.operation) { loadResult in guard !chain.isCancelled else { diff --git a/apollo-ios/Sources/Apollo/CacheWriteInterceptor.swift b/apollo-ios/Sources/Apollo/CacheWriteInterceptor.swift index 350e8845b..a06c267e1 100644 --- a/apollo-ios/Sources/Apollo/CacheWriteInterceptor.swift +++ b/apollo-ios/Sources/Apollo/CacheWriteInterceptor.swift @@ -28,10 +28,10 @@ public struct CacheWriteInterceptor: ApolloInterceptor { } public func interceptAsync( - chain: RequestChain, + chain: any RequestChain, request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void) { + completion: @escaping (Result, any Error>) -> Void) { guard request.cachePolicy != .fetchIgnoringCacheCompletely else { // If we're ignoring the cache completely, we're not writing to it. diff --git a/apollo-ios/Sources/Apollo/DataLoader.swift b/apollo-ios/Sources/Apollo/DataLoader.swift index fa959c22f..2f6afd72a 100644 --- a/apollo-ios/Sources/Apollo/DataLoader.swift +++ b/apollo-ios/Sources/Apollo/DataLoader.swift @@ -2,7 +2,7 @@ final class DataLoader { public typealias BatchLoad = (Set) throws -> [Key: Value] private var batchLoad: BatchLoad - private var cache: [Key: Result] = [:] + private var cache: [Key: Result] = [:] private var pendingLoads: Set = [] public init(_ batchLoad: @escaping BatchLoad) { diff --git a/apollo-ios/Sources/Apollo/DefaultInterceptorProvider.swift b/apollo-ios/Sources/Apollo/DefaultInterceptorProvider.swift index bef366f9a..bbce79581 100644 --- a/apollo-ios/Sources/Apollo/DefaultInterceptorProvider.swift +++ b/apollo-ios/Sources/Apollo/DefaultInterceptorProvider.swift @@ -44,7 +44,7 @@ open class DefaultInterceptorProvider: InterceptorProvider { ] } - open func additionalErrorInterceptor(for operation: Operation) -> ApolloErrorInterceptor? { + open func additionalErrorInterceptor(for operation: Operation) -> (any ApolloErrorInterceptor)? { return nil } } diff --git a/apollo-ios/Sources/Apollo/DispatchQueue+Optional.swift b/apollo-ios/Sources/Apollo/DispatchQueue+Optional.swift index 4836b81f8..f87e0195e 100644 --- a/apollo-ios/Sources/Apollo/DispatchQueue+Optional.swift +++ b/apollo-ios/Sources/Apollo/DispatchQueue+Optional.swift @@ -15,8 +15,8 @@ extension DispatchQueue { } static func returnResultAsyncIfNeeded(on callbackQueue: DispatchQueue?, - action: ((Result) -> Void)?, - result: Result) { + action: ((Result) -> Void)?, + result: Result) { if let action = action { self.performAsyncIfNeeded(on: callbackQueue) { action(result) diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift index 9aa665e53..c1794a1eb 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift @@ -64,7 +64,7 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { return transaction.loadObject(forKey: reference.key) } - func computeCacheKey(for object: Record, in schema: SchemaMetadata.Type) -> CacheKey? { + func computeCacheKey(for object: Record, in schema: any SchemaMetadata.Type) -> CacheKey? { return object.key } diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/NetworkResponseExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/NetworkResponseExecutionSource.swift index 108e492ed..5d2c97556 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/NetworkResponseExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/NetworkResponseExecutionSource.swift @@ -25,10 +25,10 @@ public struct NetworkResponseExecutionSource: GraphQLExecutionSource, CacheKeyCo struct DataTransformer: _ObjectData_Transformer { func transform(_ value: AnyHashable) -> (any ScalarType)? { switch value { - case let scalar as ScalarType: + case let scalar as any ScalarType: return scalar - case let customScalar as CustomScalarType: - return customScalar._jsonValue as? ScalarType + case let customScalar as any CustomScalarType: + return customScalar._jsonValue as? (any ScalarType) default: return nil } } diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/SelectionSetModelExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/SelectionSetModelExecutionSource.swift index 6a72f4e88..047a937e5 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/SelectionSetModelExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/SelectionSetModelExecutionSource.swift @@ -22,10 +22,10 @@ struct SelectionSetModelExecutionSource: GraphQLExecutionSource, CacheKeyComputi struct DataTransformer: _ObjectData_Transformer { func transform(_ value: AnyHashable) -> (any ScalarType)? { switch value { - case let scalar as ScalarType: + case let scalar as any ScalarType: return scalar - case let customScalar as CustomScalarType: - return customScalar._jsonValue as? ScalarType + case let customScalar as any CustomScalarType: + return customScalar._jsonValue as? (any ScalarType) default: return nil } } diff --git a/apollo-ios/Sources/Apollo/GraphQLExecutionSource.swift b/apollo-ios/Sources/Apollo/GraphQLExecutionSource.swift index 6c79f0652..c312b044f 100644 --- a/apollo-ios/Sources/Apollo/GraphQLExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/GraphQLExecutionSource.swift @@ -39,7 +39,7 @@ public protocol GraphQLExecutionSource { /// - Returns: A cache key for normalizing the object in the cache. If `nil` is returned the /// object is assumed to be stored in the cache with no normalization. The executor will /// construct a cache key based on the object's path in its enclosing operation. - func computeCacheKey(for object: RawObjectData, in schema: SchemaMetadata.Type) -> CacheKey? + func computeCacheKey(for object: RawObjectData, in schema: any SchemaMetadata.Type) -> CacheKey? } /// A type of `GraphQLExecutionSource` that uses the user defined cache key computation @@ -53,7 +53,7 @@ public protocol CacheKeyComputingExecutionSource: GraphQLExecutionSource { } extension CacheKeyComputingExecutionSource { - @_spi(Execution) public func computeCacheKey(for object: RawObjectData, in schema: SchemaMetadata.Type) -> CacheKey? { + @_spi(Execution) public func computeCacheKey(for object: RawObjectData, in schema: any SchemaMetadata.Type) -> CacheKey? { let dataWrapper = opaqueObjectDataWrapper(for: object) return schema.cacheKey(for: dataWrapper) } diff --git a/apollo-ios/Sources/Apollo/GraphQLExecutor.swift b/apollo-ios/Sources/Apollo/GraphQLExecutor.swift index c52363b75..67323a5fe 100644 --- a/apollo-ios/Sources/Apollo/GraphQLExecutor.swift +++ b/apollo-ios/Sources/Apollo/GraphQLExecutor.swift @@ -7,7 +7,7 @@ import ApolloAPI public class ObjectExecutionInfo { let rootType: any RootSelectionSet.Type let variables: GraphQLOperation.Variables? - let schema: SchemaMetadata.Type + let schema: any SchemaMetadata.Type private(set) var responsePath: ResponsePath = [] private(set) var cachePath: ResponsePath = [] fileprivate(set) var fulfilledFragments: Set @@ -15,7 +15,7 @@ public class ObjectExecutionInfo { fileprivate init( rootType: any RootSelectionSet.Type, variables: GraphQLOperation.Variables?, - schema: SchemaMetadata.Type, + schema: (any SchemaMetadata.Type), responsePath: ResponsePath, cachePath: ResponsePath ) { @@ -30,7 +30,7 @@ public class ObjectExecutionInfo { fileprivate init( rootType: any RootSelectionSet.Type, variables: GraphQLOperation.Variables?, - schema: SchemaMetadata.Type, + schema: (any SchemaMetadata.Type), withRootCacheReference root: CacheReference? = nil ) { self.rootType = rootType @@ -158,7 +158,7 @@ public struct GraphQLExecutionError: Error, LocalizedError { public var pathString: String { path.description } /// The error that occurred during parsing. - public let underlying: Error + public let underlying: any Error /// A description of the error which includes the path where the error occurred. public var errorDescription: String? { diff --git a/apollo-ios/Sources/Apollo/GraphQLQueryWatcher.swift b/apollo-ios/Sources/Apollo/GraphQLQueryWatcher.swift index 18e20b8b0..7c62776aa 100644 --- a/apollo-ios/Sources/Apollo/GraphQLQueryWatcher.swift +++ b/apollo-ios/Sources/Apollo/GraphQLQueryWatcher.swift @@ -7,7 +7,7 @@ import ApolloAPI /// /// NOTE: The store retains the watcher while subscribed. You must call `cancel()` on your query watcher when you no longer need results. Failure to call `cancel()` before releasing your reference to the returned watcher will result in a memory leak. public final class GraphQLQueryWatcher: Cancellable, ApolloStoreSubscriber { - weak var client: ApolloClientProtocol? + weak var client: (any ApolloClientProtocol)? public let query: Query /// Determines if the watcher should perform a network fetch when it's watched objects have @@ -21,13 +21,13 @@ public final class GraphQLQueryWatcher: Cancellable, Apollo private let callbackQueue: DispatchQueue private let contextIdentifier = UUID() - private let context: RequestContext? + private let context: (any RequestContext)? private class WeakFetchTaskContainer { - weak var cancellable: Cancellable? + weak var cancellable: (any Cancellable)? var cachePolicy: CachePolicy? - fileprivate init(_ cancellable: Cancellable?, _ cachePolicy: CachePolicy?) { + fileprivate init(_ cancellable: (any Cancellable)?, _ cachePolicy: CachePolicy?) { self.cancellable = cancellable self.cachePolicy = cachePolicy } @@ -47,10 +47,10 @@ public final class GraphQLQueryWatcher: Cancellable, Apollo /// - context: [optional] A context that is being passed through the request chain. Defaults to `nil`. /// - callbackQueue: The queue for the result handler. Defaults to the main queue. /// - resultHandler: The result handler to call with changes. - public init(client: ApolloClientProtocol, + public init(client: any ApolloClientProtocol, query: Query, refetchOnFailedUpdates: Bool = true, - context: RequestContext? = nil, + context: (any RequestContext)? = nil, callbackQueue: DispatchQueue = .main, resultHandler: @escaping GraphQLResultHandler) { self.client = client diff --git a/apollo-ios/Sources/Apollo/GraphQLResult.swift b/apollo-ios/Sources/Apollo/GraphQLResult.swift index f1f2b0280..d357f8891 100644 --- a/apollo-ios/Sources/Apollo/GraphQLResult.swift +++ b/apollo-ios/Sources/Apollo/GraphQLResult.swift @@ -65,7 +65,7 @@ extension GraphQLResult { var val: Any = value if let value = value as? DataDict { val = value._data - } else if let value = value as? CustomScalarType { + } else if let value = value as? (any CustomScalarType) { val = value._jsonValue } if let dict = val as? [String: Any] { diff --git a/apollo-ios/Sources/Apollo/GraphQLResultNormalizer.swift b/apollo-ios/Sources/Apollo/GraphQLResultNormalizer.swift index e37b3d306..3b49a7b03 100644 --- a/apollo-ios/Sources/Apollo/GraphQLResultNormalizer.swift +++ b/apollo-ios/Sources/Apollo/GraphQLResultNormalizer.swift @@ -72,7 +72,7 @@ final class RawJSONResultNormalizer: BaseGraphQLResultNormalizer {} final class SelectionSetDataResultNormalizer: BaseGraphQLResultNormalizer { override final func accept(customScalar: JSONValue, info: FieldExecutionInfo) -> JSONValue? { - if let customScalar = customScalar as? JSONEncodable { + if let customScalar = customScalar as? (any JSONEncodable) { return customScalar._jsonValue } return customScalar diff --git a/apollo-ios/Sources/Apollo/HTTPRequest.swift b/apollo-ios/Sources/Apollo/HTTPRequest.swift index 99b1f35d7..1a56a468e 100644 --- a/apollo-ios/Sources/Apollo/HTTPRequest.swift +++ b/apollo-ios/Sources/Apollo/HTTPRequest.swift @@ -22,7 +22,7 @@ open class HTTPRequest: Hashable { public let contextIdentifier: UUID? /// [optional] A context that is being passed through the request chain. - public let context: RequestContext? + public let context: (any RequestContext)? /// Designated Initializer /// @@ -44,7 +44,7 @@ open class HTTPRequest: Hashable { clientVersion: String, additionalHeaders: [String: String], cachePolicy: CachePolicy = .default, - context: RequestContext? = nil) { + context: (any RequestContext)? = nil) { self.graphQLEndpoint = graphQLEndpoint self.operation = operation self.contextIdentifier = contextIdentifier diff --git a/apollo-ios/Sources/Apollo/InterceptorProvider.swift b/apollo-ios/Sources/Apollo/InterceptorProvider.swift index c2ec81ff8..f4aaa0cb0 100644 --- a/apollo-ios/Sources/Apollo/InterceptorProvider.swift +++ b/apollo-ios/Sources/Apollo/InterceptorProvider.swift @@ -15,14 +15,14 @@ public protocol InterceptorProvider { /// Provides an additional error interceptor for any additional handling of errors /// before returning to the UI, such as logging. /// - Parameter operation: The operation to provide an additional error interceptor for - func additionalErrorInterceptor(for operation: Operation) -> ApolloErrorInterceptor? + func additionalErrorInterceptor(for operation: Operation) -> (any ApolloErrorInterceptor)? } /// MARK: - Default Implementation public extension InterceptorProvider { - func additionalErrorInterceptor(for operation: Operation) -> ApolloErrorInterceptor? { + func additionalErrorInterceptor(for operation: Operation) -> (any ApolloErrorInterceptor)? { return nil } } diff --git a/apollo-ios/Sources/Apollo/InterceptorRequestChain.swift b/apollo-ios/Sources/Apollo/InterceptorRequestChain.swift index df6315e78..60b4cc965 100644 --- a/apollo-ios/Sources/Apollo/InterceptorRequestChain.swift +++ b/apollo-ios/Sources/Apollo/InterceptorRequestChain.swift @@ -7,7 +7,7 @@ import ApolloAPI final public class InterceptorRequestChain: Cancellable, RequestChain { public enum ChainError: Error, LocalizedError { - case invalidIndex(chain: RequestChain, index: Int) + case invalidIndex(chain: any RequestChain, index: Int) case noInterceptors case unknownInterceptor(id: String) @@ -31,7 +31,7 @@ final public class InterceptorRequestChain: Cancellable, RequestChain { @Atomic public var isCancelled: Bool = false /// Something which allows additional error handling to occur when some kind of error has happened. - public var additionalErrorHandler: ApolloErrorInterceptor? + public var additionalErrorHandler: (any ApolloErrorInterceptor)? /// Creates a chain with the given interceptor array. /// @@ -59,7 +59,7 @@ final public class InterceptorRequestChain: Cancellable, RequestChain { /// - completion: The completion closure to call when the request has completed. public func kickoff( request: HTTPRequest, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) { assert(self.currentIndex == 0, "The interceptor index should be zero when calling this method") @@ -91,7 +91,7 @@ final public class InterceptorRequestChain: Cancellable, RequestChain { public func proceedAsync( request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) { let nextIndex = self.currentIndex + 1 @@ -116,7 +116,7 @@ final public class InterceptorRequestChain: Cancellable, RequestChain { request: HTTPRequest, response: HTTPResponse?, interceptor: any ApolloInterceptor, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) { guard let currentIndex = interceptorIndexes[interceptor.id] else { self.handleErrorAsync( @@ -142,7 +142,7 @@ final public class InterceptorRequestChain: Cancellable, RequestChain { interceptorIndex: Int, request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) { guard !self.isCancelled else { // Do not proceed, this chain has been cancelled. @@ -192,7 +192,7 @@ final public class InterceptorRequestChain: Cancellable, RequestChain { // If an interceptor adheres to `Cancellable`, it should have its in-flight work cancelled as well. for interceptor in self.interceptors { - if let cancellableInterceptor = interceptor as? Cancellable { + if let cancellableInterceptor = interceptor as? (any Cancellable) { cancellableInterceptor.cancel() } } @@ -205,7 +205,7 @@ final public class InterceptorRequestChain: Cancellable, RequestChain { /// - completion: The completion closure to call when the request has completed. public func retry( request: HTTPRequest, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) { guard !self.isCancelled else { // Don't retry something that's been cancelled. @@ -225,10 +225,10 @@ final public class InterceptorRequestChain: Cancellable, RequestChain { /// - response: The response, as far as it has been constructed. /// - completion: The completion closure to call when work is complete. public func handleErrorAsync( - _ error: Error, + _ error: any Error, request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) { guard !self.isCancelled else { return @@ -264,7 +264,7 @@ final public class InterceptorRequestChain: Cancellable, RequestChain { public func returnValueAsync( for request: HTTPRequest, value: GraphQLResult, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) { guard !self.isCancelled else { return diff --git a/apollo-ios/Sources/Apollo/JSONRequest.swift b/apollo-ios/Sources/Apollo/JSONRequest.swift index 9c54529a7..a7b487a83 100644 --- a/apollo-ios/Sources/Apollo/JSONRequest.swift +++ b/apollo-ios/Sources/Apollo/JSONRequest.swift @@ -6,7 +6,7 @@ import ApolloAPI /// A request which sends JSON related to a GraphQL operation. open class JSONRequest: HTTPRequest { - public let requestBodyCreator: RequestBodyCreator + public let requestBodyCreator: any RequestBodyCreator public let autoPersistQueries: Bool public let useGETForQueries: Bool @@ -50,11 +50,11 @@ open class JSONRequest: HTTPRequest { clientVersion: String, additionalHeaders: [String: String] = [:], cachePolicy: CachePolicy = .default, - context: RequestContext? = nil, + context: (any RequestContext)? = nil, autoPersistQueries: Bool = false, useGETForQueries: Bool = false, useGETForPersistedQueryRetry: Bool = false, - requestBodyCreator: RequestBodyCreator = ApolloRequestBodyCreator() + requestBodyCreator: any RequestBodyCreator = ApolloRequestBodyCreator() ) { self.autoPersistQueries = autoPersistQueries self.useGETForQueries = useGETForQueries diff --git a/apollo-ios/Sources/Apollo/JSONResponseParsingInterceptor.swift b/apollo-ios/Sources/Apollo/JSONResponseParsingInterceptor.swift index 6e35ce917..d96b86bd8 100644 --- a/apollo-ios/Sources/Apollo/JSONResponseParsingInterceptor.swift +++ b/apollo-ios/Sources/Apollo/JSONResponseParsingInterceptor.swift @@ -34,10 +34,10 @@ public struct JSONResponseParsingInterceptor: ApolloInterceptor { public init() { } public func interceptAsync( - chain: RequestChain, + chain: any RequestChain, request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) { guard let createdResponse = response else { chain.handleErrorAsync( diff --git a/apollo-ios/Sources/Apollo/JSONSerializationFormat.swift b/apollo-ios/Sources/Apollo/JSONSerializationFormat.swift index 7f62161ef..b87a714f6 100644 --- a/apollo-ios/Sources/Apollo/JSONSerializationFormat.swift +++ b/apollo-ios/Sources/Apollo/JSONSerializationFormat.swift @@ -4,7 +4,7 @@ import ApolloAPI #endif public final class JSONSerializationFormat { - public class func serialize(value: JSONEncodable) throws -> Data { + public class func serialize(value: any JSONEncodable) throws -> Data { return try JSONSerialization.sortedData(withJSONObject: value._jsonValue) } diff --git a/apollo-ios/Sources/Apollo/MaxRetryInterceptor.swift b/apollo-ios/Sources/Apollo/MaxRetryInterceptor.swift index ed25961ab..4adc90bfc 100644 --- a/apollo-ios/Sources/Apollo/MaxRetryInterceptor.swift +++ b/apollo-ios/Sources/Apollo/MaxRetryInterceptor.swift @@ -30,10 +30,10 @@ public class MaxRetryInterceptor: ApolloInterceptor { } public func interceptAsync( - chain: RequestChain, + chain: any RequestChain, request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void) { + completion: @escaping (Result, any Error>) -> Void) { guard self.hitCount <= self.maxRetries else { let error = RetryError.hitMaxRetryCount( count: self.maxRetries, diff --git a/apollo-ios/Sources/Apollo/MultipartResponseDeferParser.swift b/apollo-ios/Sources/Apollo/MultipartResponseDeferParser.swift index f39a9e05e..e0eefe5dc 100644 --- a/apollo-ios/Sources/Apollo/MultipartResponseDeferParser.swift +++ b/apollo-ios/Sources/Apollo/MultipartResponseDeferParser.swift @@ -10,7 +10,7 @@ struct MultipartResponseDeferParser: MultipartResponseSpecificationParser { data: Data, boundary: String, dataHandler: ((Data) -> Void), - errorHandler: ((Error) -> Void) + errorHandler: ((any Error) -> Void) ) { // TODO: Will be implemented in #3146 } diff --git a/apollo-ios/Sources/Apollo/MultipartResponseParsingInterceptor.swift b/apollo-ios/Sources/Apollo/MultipartResponseParsingInterceptor.swift index 0c20e274b..04dba1c8f 100644 --- a/apollo-ios/Sources/Apollo/MultipartResponseParsingInterceptor.swift +++ b/apollo-ios/Sources/Apollo/MultipartResponseParsingInterceptor.swift @@ -20,7 +20,7 @@ public struct MultipartResponseParsingInterceptor: ApolloInterceptor { } } - private static let responseParsers: [String: MultipartResponseSpecificationParser.Type] = [ + private static let responseParsers: [String: any MultipartResponseSpecificationParser.Type] = [ MultipartResponseSubscriptionParser.protocolSpec: MultipartResponseSubscriptionParser.self ] @@ -29,10 +29,10 @@ public struct MultipartResponseParsingInterceptor: ApolloInterceptor { public init() { } public func interceptAsync( - chain: RequestChain, + chain: any RequestChain, request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) where Operation : GraphQLOperation { guard let response else { @@ -86,7 +86,7 @@ public struct MultipartResponseParsingInterceptor: ApolloInterceptor { ) } - let errorHandler: ((Error) -> Void) = { parserError in + let errorHandler: ((any Error) -> Void) = { parserError in chain.handleErrorAsync( parserError, request: request, @@ -116,6 +116,6 @@ protocol MultipartResponseSpecificationParser { data: Data, boundary: String, dataHandler: ((Data) -> Void), - errorHandler: ((Error) -> Void) + errorHandler: ((any Error) -> Void) ) } diff --git a/apollo-ios/Sources/Apollo/MultipartResponseSubscriptionParser.swift b/apollo-ios/Sources/Apollo/MultipartResponseSubscriptionParser.swift index dec316522..1498b4ff3 100644 --- a/apollo-ios/Sources/Apollo/MultipartResponseSubscriptionParser.swift +++ b/apollo-ios/Sources/Apollo/MultipartResponseSubscriptionParser.swift @@ -44,7 +44,7 @@ struct MultipartResponseSubscriptionParser: MultipartResponseSpecificationParser data: Data, boundary: String, dataHandler: ((Data) -> Void), - errorHandler: ((Error) -> Void) + errorHandler: ((any Error) -> Void) ) { guard let dataString = String(data: data, encoding: .utf8) else { errorHandler(ParsingError.cannotParseResponseData) diff --git a/apollo-ios/Sources/Apollo/NetworkFetchInterceptor.swift b/apollo-ios/Sources/Apollo/NetworkFetchInterceptor.swift index 92ccd79b5..4b7636b3d 100644 --- a/apollo-ios/Sources/Apollo/NetworkFetchInterceptor.swift +++ b/apollo-ios/Sources/Apollo/NetworkFetchInterceptor.swift @@ -18,10 +18,10 @@ public class NetworkFetchInterceptor: ApolloInterceptor, Cancellable { } public func interceptAsync( - chain: RequestChain, + chain: any RequestChain, request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void) { + completion: @escaping (Result, any Error>) -> Void) { let urlRequest: URLRequest do { diff --git a/apollo-ios/Sources/Apollo/NetworkTransport.swift b/apollo-ios/Sources/Apollo/NetworkTransport.swift index 6b0cd953e..e594f9462 100644 --- a/apollo-ios/Sources/Apollo/NetworkTransport.swift +++ b/apollo-ios/Sources/Apollo/NetworkTransport.swift @@ -21,9 +21,9 @@ public protocol NetworkTransport: AnyObject { func send(operation: Operation, cachePolicy: CachePolicy, contextIdentifier: UUID?, - context: RequestContext?, + context: (any RequestContext)?, callbackQueue: DispatchQueue, - completionHandler: @escaping (Result, Error>) -> Void) -> Cancellable + completionHandler: @escaping (Result, any Error>) -> Void) -> any Cancellable /// The name of the client to send as a header value. var clientName: String { get } @@ -108,7 +108,7 @@ public protocol UploadingNetworkTransport: NetworkTransport { func upload( operation: Operation, files: [GraphQLFile], - context: RequestContext?, + context: (any RequestContext)?, callbackQueue: DispatchQueue, - completionHandler: @escaping (Result,Error>) -> Void) -> Cancellable + completionHandler: @escaping (Result,any Error>) -> Void) -> any Cancellable } diff --git a/apollo-ios/Sources/Apollo/PossiblyDeferred.swift b/apollo-ios/Sources/Apollo/PossiblyDeferred.swift index 4b3f294a2..b706399d9 100644 --- a/apollo-ios/Sources/Apollo/PossiblyDeferred.swift +++ b/apollo-ios/Sources/Apollo/PossiblyDeferred.swift @@ -45,7 +45,7 @@ extension Sequence { @_spi(Execution) public enum PossiblyDeferred { /// An immediate success or failure value, represented as a `Result` instance. - case immediate(Result) + case immediate(Result) /// A deferred value that will be lazily evaluated by invoking the associated throwing closure. case deferred(() throws -> Value) @@ -135,7 +135,7 @@ public enum PossiblyDeferred { /// instance. /// - Returns: A `PossiblyDeferred` instance with the result of evaluating `transform` /// as the new failure value if this instance represents a failure. - func mapError(_ transform: @escaping (Error) -> Error) -> PossiblyDeferred { + func mapError(_ transform: @escaping (any Error) -> any Error) -> PossiblyDeferred { switch self { case .immediate(let result): return .immediate(result.mapError(transform)) diff --git a/apollo-ios/Sources/Apollo/RequestChain.swift b/apollo-ios/Sources/Apollo/RequestChain.swift index a0034f632..363c26c94 100644 --- a/apollo-ios/Sources/Apollo/RequestChain.swift +++ b/apollo-ios/Sources/Apollo/RequestChain.swift @@ -5,41 +5,41 @@ import ApolloAPI public protocol RequestChain: Cancellable { func kickoff( request: HTTPRequest, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) where Operation : GraphQLOperation @available(*, deprecated, renamed: "proceedAsync(request:response:interceptor:completion:)") func proceedAsync( request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) where Operation : GraphQLOperation func proceedAsync( request: HTTPRequest, response: HTTPResponse?, interceptor: any ApolloInterceptor, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) where Operation : GraphQLOperation func cancel() func retry( request: HTTPRequest, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) where Operation : GraphQLOperation func handleErrorAsync( - _ error: Error, + _ error: any Error, request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) where Operation : GraphQLOperation func returnValueAsync( for request: HTTPRequest, value: GraphQLResult, - completion: @escaping (Result, Error>) -> Void + completion: @escaping (Result, any Error>) -> Void ) where Operation : GraphQLOperation var isCancelled: Bool { get } diff --git a/apollo-ios/Sources/Apollo/RequestChainNetworkTransport.swift b/apollo-ios/Sources/Apollo/RequestChainNetworkTransport.swift index fd9199526..fecbb28f9 100644 --- a/apollo-ios/Sources/Apollo/RequestChainNetworkTransport.swift +++ b/apollo-ios/Sources/Apollo/RequestChainNetworkTransport.swift @@ -8,7 +8,7 @@ import ApolloAPI open class RequestChainNetworkTransport: NetworkTransport { /// The interceptor provider to use when constructing a request chain - let interceptorProvider: InterceptorProvider + let interceptorProvider: any InterceptorProvider /// The GraphQL endpoint URL to use. public let endpointURL: URL @@ -40,7 +40,7 @@ open class RequestChainNetworkTransport: NetworkTransport { /// The `RequestBodyCreator` object used to build your `URLRequest`. /// /// Defaults to an ``ApolloRequestBodyCreator`` initialized with the default configuration. - public var requestBodyCreator: RequestBodyCreator + public var requestBodyCreator: any RequestBodyCreator /// Designated initializer /// @@ -52,11 +52,11 @@ open class RequestChainNetworkTransport: NetworkTransport { /// - requestBodyCreator: The `RequestBodyCreator` object to use to build your `URLRequest`. Defaults to the provided `ApolloRequestBodyCreator` implementation. /// - useGETForQueries: Pass `true` if you want to use `GET` instead of `POST` for queries, for example to take advantage of a CDN. Defaults to `false`. /// - useGETForPersistedQueryRetry: Pass `true` to use `GET` instead of `POST` for a retry of a persisted query. Defaults to `false`. - public init(interceptorProvider: InterceptorProvider, + public init(interceptorProvider: any InterceptorProvider, endpointURL: URL, additionalHeaders: [String: String] = [:], autoPersistQueries: Bool = false, - requestBodyCreator: RequestBodyCreator = ApolloRequestBodyCreator(), + requestBodyCreator: any RequestBodyCreator = ApolloRequestBodyCreator(), useGETForQueries: Bool = false, useGETForPersistedQueryRetry: Bool = false) { self.interceptorProvider = interceptorProvider @@ -83,7 +83,7 @@ open class RequestChainNetworkTransport: NetworkTransport { for operation: Operation, cachePolicy: CachePolicy, contextIdentifier: UUID? = nil, - context: RequestContext? = nil + context: (any RequestContext)? = nil ) -> HTTPRequest { let request = JSONRequest( operation: operation, @@ -126,9 +126,9 @@ open class RequestChainNetworkTransport: NetworkTransport { operation: Operation, cachePolicy: CachePolicy = .default, contextIdentifier: UUID? = nil, - context: RequestContext? = nil, + context: (any RequestContext)? = nil, callbackQueue: DispatchQueue = .main, - completionHandler: @escaping (Result, Error>) -> Void) -> Cancellable { + completionHandler: @escaping (Result, any Error>) -> Void) -> any Cancellable { let chain = makeChain(operation: operation, callbackQueue: callbackQueue) let request = self.constructRequest( @@ -144,7 +144,7 @@ open class RequestChainNetworkTransport: NetworkTransport { private func makeChain( operation: Operation, callbackQueue: DispatchQueue = .main - ) -> RequestChain { + ) -> any RequestChain { let interceptors = self.interceptorProvider.interceptors(for: operation) let chain = InterceptorRequestChain(interceptors: interceptors, callbackQueue: callbackQueue) chain.additionalErrorHandler = self.interceptorProvider.additionalErrorInterceptor(for: operation) @@ -168,7 +168,7 @@ extension RequestChainNetworkTransport: UploadingNetworkTransport { public func constructUploadRequest( for operation: Operation, with files: [GraphQLFile], - context: RequestContext? = nil, + context: (any RequestContext)? = nil, manualBoundary: String? = nil) -> HTTPRequest { UploadRequest(graphQLEndpoint: self.endpointURL, @@ -185,9 +185,9 @@ extension RequestChainNetworkTransport: UploadingNetworkTransport { public func upload( operation: Operation, files: [GraphQLFile], - context: RequestContext?, + context: (any RequestContext)?, callbackQueue: DispatchQueue = .main, - completionHandler: @escaping (Result, Error>) -> Void) -> Cancellable { + completionHandler: @escaping (Result, any Error>) -> Void) -> any Cancellable { let request = self.constructUploadRequest(for: operation, with: files, context: context) let chain = makeChain(operation: operation, callbackQueue: callbackQueue) diff --git a/apollo-ios/Sources/Apollo/ResponseCodeInterceptor.swift b/apollo-ios/Sources/Apollo/ResponseCodeInterceptor.swift index 2c94ff7cd..b4d1837c2 100644 --- a/apollo-ios/Sources/Apollo/ResponseCodeInterceptor.swift +++ b/apollo-ios/Sources/Apollo/ResponseCodeInterceptor.swift @@ -50,10 +50,10 @@ public struct ResponseCodeInterceptor: ApolloInterceptor { public init() {} public func interceptAsync( - chain: RequestChain, + chain: any RequestChain, request: HTTPRequest, response: HTTPResponse?, - completion: @escaping (Result, Error>) -> Void) { + completion: @escaping (Result, any Error>) -> Void) { guard response?.httpResponse.isSuccessful == true else { diff --git a/apollo-ios/Sources/Apollo/URLSessionClient.swift b/apollo-ios/Sources/Apollo/URLSessionClient.swift index 88226b88a..5f10bc532 100644 --- a/apollo-ios/Sources/Apollo/URLSessionClient.swift +++ b/apollo-ios/Sources/Apollo/URLSessionClient.swift @@ -14,7 +14,7 @@ open class URLSessionClient: NSObject, URLSessionDelegate, URLSessionTaskDelegat case noHTTPResponse(request: URLRequest?) case sessionBecameInvalidWithoutUnderlyingError case dataForRequestNotFound(request: URLRequest?) - case networkError(data: Data, response: HTTPURLResponse?, underlying: Error) + case networkError(data: Data, response: HTTPURLResponse?, underlying: any Error) case sessionInvalidated case missingMultipartBoundary case cannotParseBoundaryData @@ -40,10 +40,10 @@ open class URLSessionClient: NSObject, URLSessionDelegate, URLSessionTaskDelegat } /// A completion block to be called when the raw task has completed, with the raw information from the session - public typealias RawCompletion = (Data?, HTTPURLResponse?, Error?) -> Void + public typealias RawCompletion = (Data?, HTTPURLResponse?, (any Error)?) -> Void /// A completion block returning a result. On `.success` it will contain a tuple with non-nil `Data` and its corresponding `HTTPURLResponse`. On `.failure` it will contain an error. - public typealias Completion = (Result<(Data, HTTPURLResponse), Error>) -> Void + public typealias Completion = (Result<(Data, HTTPURLResponse), any Error>) -> Void @Atomic private var tasks: [Int: TaskData] = [:] @@ -169,7 +169,7 @@ open class URLSessionClient: NSObject, URLSessionDelegate, URLSessionTaskDelegat // MARK: - URLSessionDelegate - open func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) { + open func urlSession(_ session: URLSession, didBecomeInvalidWithError error: (any Error)?) { let finalError = error ?? URLSessionClientError.sessionBecameInvalidWithoutUnderlyingError for task in self.tasks.values { task.completionBlock(.failure(finalError)) @@ -212,7 +212,7 @@ open class URLSessionClient: NSObject, URLSessionDelegate, URLSessionTaskDelegat open func urlSession(_ session: URLSession, task: URLSessionTask, - didCompleteWithError error: Error?) { + didCompleteWithError error: (any Error)?) { defer { self.clear(task: task.taskIdentifier) } diff --git a/apollo-ios/Sources/Apollo/UploadRequest.swift b/apollo-ios/Sources/Apollo/UploadRequest.swift index d2aacdfb5..761a375fc 100644 --- a/apollo-ios/Sources/Apollo/UploadRequest.swift +++ b/apollo-ios/Sources/Apollo/UploadRequest.swift @@ -6,7 +6,7 @@ import ApolloAPI /// A request class allowing for a multipart-upload request. open class UploadRequest: HTTPRequest { - public let requestBodyCreator: RequestBodyCreator + public let requestBodyCreator: any RequestBodyCreator public let files: [GraphQLFile] public let manualBoundary: String? @@ -31,8 +31,8 @@ open class UploadRequest: HTTPRequest { additionalHeaders: [String: String] = [:], files: [GraphQLFile], manualBoundary: String? = nil, - context: RequestContext? = nil, - requestBodyCreator: RequestBodyCreator = ApolloRequestBodyCreator()) { + context: (any RequestContext)? = nil, + requestBodyCreator: any RequestBodyCreator = ApolloRequestBodyCreator()) { self.requestBodyCreator = requestBodyCreator self.files = files self.manualBoundary = manualBoundary @@ -79,7 +79,7 @@ open class UploadRequest: HTTPRequest { var variables = fields["variables"] as? JSONEncodableDictionary ?? JSONEncodableDictionary() for fieldName in fieldsForFiles { if let value = variables[fieldName], - let arrayValue = value as? [JSONEncodable] { + let arrayValue = value as? [any JSONEncodable] { let arrayOfNils: [NSNull?] = arrayValue.map { _ in NSNull() } variables.updateValue(arrayOfNils, forKey: fieldName) } else { diff --git a/apollo-ios/Sources/ApolloAPI/GraphQLOperation.swift b/apollo-ios/Sources/ApolloAPI/GraphQLOperation.swift index 8cd6ca5d1..01ef19377 100644 --- a/apollo-ios/Sources/ApolloAPI/GraphQLOperation.swift +++ b/apollo-ios/Sources/ApolloAPI/GraphQLOperation.swift @@ -54,7 +54,7 @@ public struct OperationDefinition: Sendable { } public protocol GraphQLOperation: AnyObject, Hashable { - typealias Variables = [String: GraphQLOperationVariableValue] + typealias Variables = [String: any GraphQLOperationVariableValue] static var operationName: String { get } static var operationType: GraphQLOperationType { get } @@ -119,7 +119,7 @@ extension Array: GraphQLOperationVariableValue where Element: GraphQLOperationVariableValue & Hashable {} extension Dictionary: GraphQLOperationVariableValue -where Key == String, Value == GraphQLOperationVariableValue { +where Key == String, Value == any GraphQLOperationVariableValue { @inlinable public var _jsonEncodableValue: (any JSONEncodable)? { _jsonEncodableObject } @inlinable public var _jsonEncodableObject: JSONEncodableDictionary { compactMapValues { $0._jsonEncodableValue } diff --git a/apollo-ios/Sources/ApolloAPI/JSONStandardTypeConversions.swift b/apollo-ios/Sources/ApolloAPI/JSONStandardTypeConversions.swift index 6805b4ca3..a531fee4b 100644 --- a/apollo-ios/Sources/ApolloAPI/JSONStandardTypeConversions.swift +++ b/apollo-ios/Sources/ApolloAPI/JSONStandardTypeConversions.swift @@ -150,7 +150,7 @@ extension JSONObject: JSONDecodable { extension Array: JSONEncodable { @inlinable public var _jsonValue: JSONValue { return map { element -> JSONValue in - if case let element as JSONEncodable = element { + if case let element as any JSONEncodable = element { return element._jsonValue } else { fatalError("Array is only JSONEncodable if Element is") diff --git a/apollo-ios/Sources/ApolloAPI/ObjectData.swift b/apollo-ios/Sources/ApolloAPI/ObjectData.swift index 17f0a81e2..96c2044d1 100644 --- a/apollo-ios/Sources/ApolloAPI/ObjectData.swift +++ b/apollo-ios/Sources/ApolloAPI/ObjectData.swift @@ -8,11 +8,11 @@ public protocol _ObjectData_Transformer { /// sources, using a `_transformer` to ensure the raw data from different sources (which may be in /// different formats) can be consumed with a consistent API. public struct ObjectData { - public let _transformer: _ObjectData_Transformer + public let _transformer: any _ObjectData_Transformer public let _rawData: [String: AnyHashable] public init( - _transformer: _ObjectData_Transformer, + _transformer: any _ObjectData_Transformer, _rawData: [String: AnyHashable] ) { self._transformer = _transformer @@ -55,11 +55,11 @@ public struct ObjectData { /// This type wraps data from different sources, using a `_transformer` to ensure the raw data from /// different sources (which may be in different formats) can be consumed with a consistent API. public struct ListData { - public let _transformer: _ObjectData_Transformer + public let _transformer: any _ObjectData_Transformer public let _rawData: [AnyHashable] public init( - _transformer: _ObjectData_Transformer, + _transformer: any _ObjectData_Transformer, _rawData: [AnyHashable] ) { self._transformer = _transformer diff --git a/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift b/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift index bc27667bf..39ace54fb 100644 --- a/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift +++ b/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift @@ -6,7 +6,7 @@ public protocol SchemaMetadata { /// A ``SchemaConfiguration`` that provides custom configuration for the generated GraphQL schema. - static var configuration: SchemaConfiguration.Type { get } + static var configuration: any SchemaConfiguration.Type { get } /// Maps each object in a `GraphQLResponse` to the ``Object`` type representing the /// response object. diff --git a/apollo-ios/Sources/ApolloAPI/SchemaTypes/InputObject.swift b/apollo-ios/Sources/ApolloAPI/SchemaTypes/InputObject.swift index cb8389dfe..36c6f477d 100644 --- a/apollo-ios/Sources/ApolloAPI/SchemaTypes/InputObject.swift +++ b/apollo-ios/Sources/ApolloAPI/SchemaTypes/InputObject.swift @@ -22,9 +22,9 @@ extension InputObject { /// A structure that wraps the underlying data dictionary used by `InputObject`s. public struct InputDict: GraphQLOperationVariableValue, Hashable { - private var data: [String: GraphQLOperationVariableValue] + private var data: [String: any GraphQLOperationVariableValue] - public init(_ data: [String: GraphQLOperationVariableValue] = [:]) { + public init(_ data: [String: any GraphQLOperationVariableValue] = [:]) { self.data = data } diff --git a/apollo-ios/Sources/ApolloAPI/Selection.swift b/apollo-ios/Sources/ApolloAPI/Selection.swift index 46c62c4e3..badedc064 100644 --- a/apollo-ios/Sources/ApolloAPI/Selection.swift +++ b/apollo-ios/Sources/ApolloAPI/Selection.swift @@ -60,7 +60,7 @@ public enum Selection { @inlinable static public func field( _ name: String, alias: String? = nil, - _ type: OutputTypeConvertible.Type, + _ type: any OutputTypeConvertible.Type, arguments: [String: InputValue]? = nil ) -> Selection { .field(.init(name, alias: alias, type: type._asOutputType, arguments: arguments)) diff --git a/apollo-ios/Sources/ApolloAPI/SelectionSet.swift b/apollo-ios/Sources/ApolloAPI/SelectionSet.swift index d8ceca55d..f017bf113 100644 --- a/apollo-ios/Sources/ApolloAPI/SelectionSet.swift +++ b/apollo-ios/Sources/ApolloAPI/SelectionSet.swift @@ -59,7 +59,7 @@ public protocol SelectionSet: Hashable { /// The GraphQL type for the `SelectionSet`. /// /// This may be a concrete type (`Object`) or an abstract type (`Interface`, or `Union`). - static var __parentType: ParentType { get } + static var __parentType: any ParentType { get } /// The data of the underlying GraphQL object represented by the generated selection set. var __data: DataDict { get } diff --git a/apollo-ios/Sources/ApolloSQLite/SQLiteNormalizedCache.swift b/apollo-ios/Sources/ApolloSQLite/SQLiteNormalizedCache.swift index b8c276c89..04b552359 100644 --- a/apollo-ios/Sources/ApolloSQLite/SQLiteNormalizedCache.swift +++ b/apollo-ios/Sources/ApolloSQLite/SQLiteNormalizedCache.swift @@ -13,7 +13,7 @@ public final class SQLiteNormalizedCache { private let shouldVacuumOnClear: Bool - let database: SQLiteDatabase + let database: any SQLiteDatabase /// Designated initializer /// @@ -22,14 +22,14 @@ public final class SQLiteNormalizedCache { /// - shouldVacuumOnClear: If the database should also be `VACCUM`ed on clear to remove all traces of info. Defaults to `false` since this involves a performance hit, but this should be used if you are storing any Personally Identifiable Information in the cache. /// - Throws: Any errors attempting to open or create the database. public init(fileURL: URL, - databaseType: SQLiteDatabase.Type = SQLiteDotSwiftDatabase.self, + databaseType: any SQLiteDatabase.Type = SQLiteDotSwiftDatabase.self, shouldVacuumOnClear: Bool = false) throws { self.database = try databaseType.init(fileURL: fileURL) self.shouldVacuumOnClear = shouldVacuumOnClear try self.database.createRecordsTableIfNeeded() } - public init(database: SQLiteDatabase, + public init(database: any SQLiteDatabase, shouldVacuumOnClear: Bool = false) throws { self.database = database self.shouldVacuumOnClear = shouldVacuumOnClear diff --git a/apollo-ios/Sources/ApolloTestSupport/TestMock.swift b/apollo-ios/Sources/ApolloTestSupport/TestMock.swift index 3fa32324f..ca64132bd 100644 --- a/apollo-ios/Sources/ApolloTestSupport/TestMock.swift +++ b/apollo-ios/Sources/ApolloTestSupport/TestMock.swift @@ -97,7 +97,7 @@ public class Mock: AnyMock, Hashable { public var _selectionSetMockData: JSONObject { _data.mapValues { - if let mock = $0.base as? AnyMock { + if let mock = $0.base as? (any AnyMock) { return mock._selectionSetMockData } if let mockArray = $0 as? Array { @@ -156,11 +156,11 @@ public protocol MockFieldValue { } extension Interface: MockFieldValue { - public typealias MockValueCollectionType = Array + public typealias MockValueCollectionType = Array } extension Union: MockFieldValue { - public typealias MockValueCollectionType = Array + public typealias MockValueCollectionType = Array } extension Optional: MockFieldValue where Wrapped: MockFieldValue { @@ -193,7 +193,7 @@ fileprivate extension Array { private func _unsafelyConvertToSelectionSetData(element: Any) -> AnyHashable? { switch element { - case let element as AnyMock: + case let element as any AnyMock: return element._selectionSetMockData case let innerArray as Array: diff --git a/apollo-ios/Sources/ApolloWebSocket/DefaultImplementation/WebSocket.swift b/apollo-ios/Sources/ApolloWebSocket/DefaultImplementation/WebSocket.swift index 9e4c182c9..38e87a300 100644 --- a/apollo-ios/Sources/ApolloWebSocket/DefaultImplementation/WebSocket.swift +++ b/apollo-ios/Sources/ApolloWebSocket/DefaultImplementation/WebSocket.swift @@ -132,13 +132,13 @@ public final class WebSocket: NSObject, WebSocketClient, StreamDelegate, WebSock /// Responds to callback about new messages coming in over the WebSocket /// and also connection/disconnect messages. - public weak var delegate: WebSocketClientDelegate? + public weak var delegate: (any WebSocketClientDelegate)? // Where the callback is executed. It defaults to the main UI thread queue. public var callbackQueue = DispatchQueue.main public var onConnect: (() -> Void)? - public var onDisconnect: ((Error?) -> Void)? + public var onDisconnect: (((any Error)?) -> Void)? public var onText: ((String) -> Void)? public var onData: ((Data) -> Void)? public var onPong: ((Data?) -> Void)? @@ -152,7 +152,7 @@ public final class WebSocket: NSObject, WebSocketClient, StreamDelegate, WebSock public var enableCompression = true #if os(Linux) #else - public var security: SSLTrustValidator? + public var security: (any SSLTrustValidator)? public var enabledSSLCipherSuites: [SSLCipherSuite]? #endif @@ -172,7 +172,7 @@ public final class WebSocket: NSObject, WebSocketClient, StreamDelegate, WebSock /// Note: Will return `false` from the getter and no-op the setter for implementations that do not conform to `SOCKSProxyable`. public var enableSOCKSProxy: Bool { get { - guard let stream = stream as? SOCKSProxyable else { + guard let stream = stream as? (any SOCKSProxyable) else { // If it's not proxyable, then the proxy can't be enabled return false } @@ -181,7 +181,7 @@ public final class WebSocket: NSObject, WebSocketClient, StreamDelegate, WebSock } set { - guard var stream = stream as? SOCKSProxyable else { + guard var stream = stream as? (any SOCKSProxyable) else { // If it's not proxyable, there's nothing to do here. return } @@ -203,7 +203,7 @@ public final class WebSocket: NSObject, WebSocketClient, StreamDelegate, WebSock var compressor:Compressor? = nil } - private var stream: WebSocketStream + private var stream: any WebSocketStream private var connected = false private var isConnecting = false private let mutex = NSLock() @@ -534,14 +534,14 @@ public final class WebSocket: NSObject, WebSocketClient, StreamDelegate, WebSock processInputStream() } - public func streamDidError(error: Error?) { + public func streamDidError(error: (any Error)?) { disconnectStream(error) } /** Disconnect the stream object and notifies the delegate. */ - private func disconnectStream(_ error: Error?, runDelegate: Bool = true) { + private func disconnectStream(_ error: (any Error)?, runDelegate: Bool = true) { if error == nil { writeQueue.waitUntilAllOperationsAreFinished() } else { @@ -1105,7 +1105,7 @@ public final class WebSocket: NSObject, WebSocketClient, StreamDelegate, WebSock /** Used to preform the disconnect delegate */ - private func doDisconnect(_ error: Error?) { + private func doDisconnect(_ error: (any Error)?) { guard !didDisconnect else { return } didDisconnect = true isConnecting = false diff --git a/apollo-ios/Sources/ApolloWebSocket/DefaultImplementation/WebSocketStream.swift b/apollo-ios/Sources/ApolloWebSocket/DefaultImplementation/WebSocketStream.swift index 88f978a28..95047f5e7 100644 --- a/apollo-ios/Sources/ApolloWebSocket/DefaultImplementation/WebSocketStream.swift +++ b/apollo-ios/Sources/ApolloWebSocket/DefaultImplementation/WebSocketStream.swift @@ -12,7 +12,7 @@ import Foundation protocol WebSocketStreamDelegate: AnyObject { func newBytesInStream() - func streamDidError(error: Error?) + func streamDidError(error: (any Error)?) } public protocol SOCKSProxyable { @@ -24,13 +24,13 @@ public protocol SOCKSProxyable { // This protocol is to allow custom implemention of the underlining stream. // This way custom socket libraries (e.g. linux) can be used protocol WebSocketStream { - var delegate: WebSocketStreamDelegate? { get set } + var delegate: (any WebSocketStreamDelegate)? { get set } func connect(url: URL, port: Int, timeout: TimeInterval, ssl: SSLSettings, - completion: @escaping ((Error?) -> Void)) + completion: @escaping (((any Error)?) -> Void)) func write(data: Data) -> Int func read() -> Data? @@ -46,12 +46,12 @@ class FoundationStream : NSObject, WebSocketStream, StreamDelegate, SOCKSProxyab private let workQueue = DispatchQueue(label: "com.apollographql.websocket", attributes: []) private var inputStream: InputStream? private var outputStream: OutputStream? - weak var delegate: WebSocketStreamDelegate? + weak var delegate: (any WebSocketStreamDelegate)? let BUFFER_MAX = 4096 var enableSOCKSProxy = false - func connect(url: URL, port: Int, timeout: TimeInterval, ssl: SSLSettings, completion: @escaping ((Error?) -> Void)) { + func connect(url: URL, port: Int, timeout: TimeInterval, ssl: SSLSettings, completion: @escaping (((any Error)?) -> Void)) { var readStream: Unmanaged? var writeStream: Unmanaged? let h = url.host! as NSString diff --git a/apollo-ios/Sources/ApolloWebSocket/OperationMessage.swift b/apollo-ios/Sources/ApolloWebSocket/OperationMessage.swift index 001b091c0..a2d369ff2 100644 --- a/apollo-ios/Sources/ApolloWebSocket/OperationMessage.swift +++ b/apollo-ios/Sources/ApolloWebSocket/OperationMessage.swift @@ -115,12 +115,12 @@ struct ParseHandler { let type: String? let id: String? let payload: JSONObject? - let error: Error? + let error: (any Error)? init(_ type: String?, _ id: String?, _ payload: JSONObject?, - _ error: Error?) { + _ error: (any Error)?) { self.type = type self.id = id self.payload = payload diff --git a/apollo-ios/Sources/ApolloWebSocket/SplitNetworkTransport.swift b/apollo-ios/Sources/ApolloWebSocket/SplitNetworkTransport.swift index c35f362e2..ea4c921e4 100644 --- a/apollo-ios/Sources/ApolloWebSocket/SplitNetworkTransport.swift +++ b/apollo-ios/Sources/ApolloWebSocket/SplitNetworkTransport.swift @@ -6,8 +6,8 @@ import ApolloAPI /// A network transport that sends subscriptions using one `NetworkTransport` and other requests using another `NetworkTransport`. Ideal for sending subscriptions via a web socket but everything else via HTTP. public class SplitNetworkTransport { - private let uploadingNetworkTransport: UploadingNetworkTransport - private let webSocketNetworkTransport: NetworkTransport + private let uploadingNetworkTransport: any UploadingNetworkTransport + private let webSocketNetworkTransport: any NetworkTransport public var clientName: String { let httpName = self.uploadingNetworkTransport.clientName @@ -34,7 +34,7 @@ public class SplitNetworkTransport { /// - Parameters: /// - uploadingNetworkTransport: An `UploadingNetworkTransport` to use for non-subscription requests. Should generally be a `RequestChainNetworkTransport` or something similar. /// - webSocketNetworkTransport: A `NetworkTransport` to use for subscription requests. Should generally be a `WebSocketTransport` or something similar. - public init(uploadingNetworkTransport: UploadingNetworkTransport, webSocketNetworkTransport: NetworkTransport) { + public init(uploadingNetworkTransport: any UploadingNetworkTransport, webSocketNetworkTransport: any NetworkTransport) { self.uploadingNetworkTransport = uploadingNetworkTransport self.webSocketNetworkTransport = webSocketNetworkTransport } @@ -47,9 +47,9 @@ extension SplitNetworkTransport: NetworkTransport { public func send(operation: Operation, cachePolicy: CachePolicy, contextIdentifier: UUID? = nil, - context: RequestContext? = nil, + context: (any RequestContext)? = nil, callbackQueue: DispatchQueue = .main, - completionHandler: @escaping (Result, Error>) -> Void) -> Cancellable { + completionHandler: @escaping (Result, any Error>) -> Void) -> any Cancellable { if Operation.operationType == .subscription { return webSocketNetworkTransport.send(operation: operation, cachePolicy: cachePolicy, @@ -75,9 +75,9 @@ extension SplitNetworkTransport: UploadingNetworkTransport { public func upload( operation: Operation, files: [GraphQLFile], - context: RequestContext?, + context: (any RequestContext)?, callbackQueue: DispatchQueue = .main, - completionHandler: @escaping (Result, Error>) -> Void) -> Cancellable { + completionHandler: @escaping (Result, any Error>) -> Void) -> any Cancellable { return uploadingNetworkTransport.upload(operation: operation, files: files, context: context, diff --git a/apollo-ios/Sources/ApolloWebSocket/WebSocketClient.swift b/apollo-ios/Sources/ApolloWebSocket/WebSocketClient.swift index 91b0e887c..8f73fe568 100644 --- a/apollo-ios/Sources/ApolloWebSocket/WebSocketClient.swift +++ b/apollo-ios/Sources/ApolloWebSocket/WebSocketClient.swift @@ -12,7 +12,7 @@ public protocol WebSocketClient: AnyObject { /// /// - Note: The `WebSocketTransport` will set itself as the delgate for the client. Consumers /// should set themselves as the delegate for the `WebSocketTransport` to observe events. - var delegate: WebSocketClientDelegate? { get set } + var delegate: (any WebSocketClientDelegate)? { get set } /// `DispatchQueue` where the websocket client should call all delegate callbacks. var callbackQueue: DispatchQueue { get set } @@ -38,23 +38,23 @@ public protocol WebSocketClientDelegate: AnyObject { /// The websocket client has started a connection to the server. /// - Parameter socket: The `WebSocketClient` that sent the delegate event. - func websocketDidConnect(socket: WebSocketClient) + func websocketDidConnect(socket: any WebSocketClient) /// The websocket client has disconnected from the server. /// - Parameters: /// - socket: The `WebSocketClient` that sent the delegate event. /// - error: An optional error if an error occured. - func websocketDidDisconnect(socket: WebSocketClient, error: Error?) + func websocketDidDisconnect(socket: any WebSocketClient, error: (any Error)?) /// The websocket client received message text from the server /// - Parameters: /// - socket: The `WebSocketClient` that sent the delegate event. /// - text: The text received from the server. - func websocketDidReceiveMessage(socket: WebSocketClient, text: String) + func websocketDidReceiveMessage(socket: any WebSocketClient, text: String) /// The websocket client received data from the server /// - Parameters: /// - socket: The `WebSocketClient` that sent the delegate event. /// - data: The data received from the server. - func websocketDidReceiveData(socket: WebSocketClient, data: Data) + func websocketDidReceiveData(socket: any WebSocketClient, data: Data) } diff --git a/apollo-ios/Sources/ApolloWebSocket/WebSocketError.swift b/apollo-ios/Sources/ApolloWebSocket/WebSocketError.swift index f9655ecaa..a314e80fa 100644 --- a/apollo-ios/Sources/ApolloWebSocket/WebSocketError.swift +++ b/apollo-ios/Sources/ApolloWebSocket/WebSocketError.swift @@ -35,7 +35,7 @@ public struct WebSocketError: Error, LocalizedError { public let payload: JSONObject? /// The underlying error, or nil if one was not returned - public let error: Error? + public let error: (any Error)? /// The kind of problem which occurred. public let kind: ErrorKind diff --git a/apollo-ios/Sources/ApolloWebSocket/WebSocketTask.swift b/apollo-ios/Sources/ApolloWebSocket/WebSocketTask.swift index b2557fda5..01369803a 100644 --- a/apollo-ios/Sources/ApolloWebSocket/WebSocketTask.swift +++ b/apollo-ios/Sources/ApolloWebSocket/WebSocketTask.swift @@ -16,7 +16,7 @@ final class WebSocketTask: Cancellable { /// - Parameter completionHandler: A completion handler to fire when the operation has a result. init(_ ws: WebSocketTransport, _ operation: Operation, - _ completionHandler: @escaping (_ result: Result) -> Void) { + _ completionHandler: @escaping (_ result: Result) -> Void) { sequenceNumber = ws.sendHelper(operation: operation, resultHandler: completionHandler) transport = ws } diff --git a/apollo-ios/Sources/ApolloWebSocket/WebSocketTransport.swift b/apollo-ios/Sources/ApolloWebSocket/WebSocketTransport.swift index 91d67c51d..9405ae153 100644 --- a/apollo-ios/Sources/ApolloWebSocket/WebSocketTransport.swift +++ b/apollo-ios/Sources/ApolloWebSocket/WebSocketTransport.swift @@ -9,13 +9,13 @@ import Foundation public protocol WebSocketTransportDelegate: AnyObject { func webSocketTransportDidConnect(_ webSocketTransport: WebSocketTransport) func webSocketTransportDidReconnect(_ webSocketTransport: WebSocketTransport) - func webSocketTransport(_ webSocketTransport: WebSocketTransport, didDisconnectWithError error:Error?) + func webSocketTransport(_ webSocketTransport: WebSocketTransport, didDisconnectWithError error:(any Error)?) } public extension WebSocketTransportDelegate { func webSocketTransportDidConnect(_ webSocketTransport: WebSocketTransport) {} func webSocketTransportDidReconnect(_ webSocketTransport: WebSocketTransport) {} - func webSocketTransport(_ webSocketTransport: WebSocketTransport, didDisconnectWithError error:Error?) {} + func webSocketTransport(_ webSocketTransport: WebSocketTransport, didDisconnectWithError error:(any Error)?) {} func webSocketTransport(_ webSocketTransport: WebSocketTransport, didReceivePingData: Data?) {} func webSocketTransport(_ webSocketTransport: WebSocketTransport, didReceivePongData: Data?) {} } @@ -24,12 +24,12 @@ public extension WebSocketTransportDelegate { /// A network transport that uses web sockets requests to send GraphQL subscription operations to a server. public class WebSocketTransport { - public weak var delegate: WebSocketTransportDelegate? + public weak var delegate: (any WebSocketTransportDelegate)? - let websocket: WebSocketClient + let websocket: any WebSocketClient let store: ApolloStore? private(set) var config: Configuration - @Atomic var error: Error? + @Atomic var error: (any Error)? let serializationFormat = JSONSerializationFormat.self /// non-private for testing - you should not use this directly @@ -49,7 +49,7 @@ public class WebSocketTransport { private var queue: [Int: String] = [:] - private var subscribers = [String: (Result) -> Void]() + private var subscribers = [String: (Result) -> Void]() private var subscriptions : [String: String] = [:] let processingQueue = DispatchQueue(label: "com.apollographql.WebSocketTransport") @@ -96,10 +96,10 @@ public class WebSocketTransport { /// [optional]The payload to send on connection. Defaults to an empty `JSONEncodableDictionary`. public fileprivate(set) var connectingPayload: JSONEncodableDictionary? /// The `RequestBodyCreator` to use when serializing requests. Defaults to an `ApolloRequestBodyCreator`. - public let requestBodyCreator: RequestBodyCreator + public let requestBodyCreator: any RequestBodyCreator /// The `OperationMessageIdCreator` used to generate a unique message identifier per request. /// Defaults to `ApolloSequencedOperationMessageIdCreator`. - public let operationMessageIdCreator: OperationMessageIdCreator + public let operationMessageIdCreator: any OperationMessageIdCreator /// The designated initializer public init( @@ -110,8 +110,8 @@ public class WebSocketTransport { allowSendingDuplicates: Bool = true, connectOnInit: Bool = true, connectingPayload: JSONEncodableDictionary? = [:], - requestBodyCreator: RequestBodyCreator = ApolloRequestBodyCreator(), - operationMessageIdCreator: OperationMessageIdCreator = ApolloSequencedOperationMessageIdCreator() + requestBodyCreator: any RequestBodyCreator = ApolloRequestBodyCreator(), + operationMessageIdCreator: any OperationMessageIdCreator = ApolloSequencedOperationMessageIdCreator() ) { self.clientName = clientName self.clientVersion = clientVersion @@ -130,7 +130,7 @@ public class WebSocketTransport { /// Note: Will return `false` from the getter and no-op the setter for implementations that do not conform to `SOCKSProxyable`. public var enableSOCKSProxy: Bool { get { - guard let websocket = websocket as? SOCKSProxyable else { + guard let websocket = websocket as? (any SOCKSProxyable) else { // If it's not proxyable, then the proxy can't be enabled return false } @@ -139,7 +139,7 @@ public class WebSocketTransport { } set { - guard var websocket = websocket as? SOCKSProxyable else { + guard var websocket = websocket as? (any SOCKSProxyable) else { // If it's not proxyable, there's nothing to do here. return } @@ -156,7 +156,7 @@ public class WebSocketTransport { /// - config: A `WebSocketTransport.Configuration` object with options for configuring the /// web socket connection. Defaults to a configuration with default values. public init( - websocket: WebSocketClient, + websocket: any WebSocketClient, store: ApolloStore? = nil, config: Configuration = Configuration() ) { @@ -253,7 +253,7 @@ public class WebSocketTransport { } } - private func notifyErrorAllHandlers(_ error: Error) { + private func notifyErrorAllHandlers(_ error: any Error) { for (_, handler) in subscribers { handler(.failure(error)) } @@ -323,7 +323,7 @@ public class WebSocketTransport { self.websocket.delegate = nil } - func sendHelper(operation: Operation, resultHandler: @escaping (_ result: Result) -> Void) -> String? { + func sendHelper(operation: Operation, resultHandler: @escaping (_ result: Result) -> Void) -> String? { let body = config.requestBodyCreator.requestBody(for: operation, sendQueryDocument: true, autoPersistQuery: false) @@ -438,11 +438,11 @@ extension WebSocketTransport: NetworkTransport { operation: Operation, cachePolicy: CachePolicy, contextIdentifier: UUID? = nil, - context: RequestContext? = nil, + context: (any RequestContext)? = nil, callbackQueue: DispatchQueue = .main, - completionHandler: @escaping (Result, Error>) -> Void) -> Cancellable { + completionHandler: @escaping (Result, any Error>) -> Void) -> any Cancellable { - func callCompletion(with result: Result, Error>) { + func callCompletion(with result: Result, any Error>) { callbackQueue.async { completionHandler(result) } @@ -497,7 +497,7 @@ extension WebSocketTransport: NetworkTransport { extension WebSocketTransport: WebSocketClientDelegate { - public func websocketDidConnect(socket: WebSocketClient) { + public func websocketDidConnect(socket: any WebSocketClient) { self.handleConnection() } @@ -525,7 +525,7 @@ extension WebSocketTransport: WebSocketClientDelegate { self.reconnected = true } - public func websocketDidDisconnect(socket: WebSocketClient, error: Error?) { + public func websocketDidDisconnect(socket: any WebSocketClient, error: (any Error)?) { self.$socketConnectionState.mutate { $0 = .disconnected } if let error = error { handleDisconnection(with: error) @@ -536,7 +536,7 @@ extension WebSocketTransport: WebSocketClientDelegate { } } - private func handleDisconnection(with error: Error) { + private func handleDisconnection(with error: any Error) { // Set state to `.failed`, and grab its previous value. let previousState: SocketConnectionState = self.$socketConnectionState.mutate { socketConnectionState in let previousState = socketConnectionState @@ -590,11 +590,11 @@ extension WebSocketTransport: WebSocketClientDelegate { } } - public func websocketDidReceiveMessage(socket: WebSocketClient, text: String) { + public func websocketDidReceiveMessage(socket: any WebSocketClient, text: String) { self.processMessage(text: text) } - public func websocketDidReceiveData(socket: WebSocketClient, data: Data) { + public func websocketDidReceiveData(socket: any WebSocketClient, data: Data) { self.processMessage(data: data) }