From b7c5e804368e351416e3946fad07a74281a2f245 Mon Sep 17 00:00:00 2001 From: Glen Date: Thu, 19 Sep 2024 15:21:09 +0200 Subject: [PATCH 1/5] Updated target frameworks --- .build/.vscode/launch.json | 26 - .build/.vscode/settings.json | 3 - .build/.vscode/tasks.json | 24 - .build/Build.Environment.cs | 1 - .build/Build.csproj | 2 +- .github/workflows/ci.yml | 12 +- .github/workflows/coverage.yml | 12 +- .github/workflows/release.yml | 3 +- global.json | 2 +- .../src/CookieCrumble/CookieCrumble.csproj | 4 - .../QueryPlanSnapshotValueFormatter.cs | 2 - .../src/CookieCrumble/Snapshot.cs | 2 - .../src/CookieCrumble/TestEnvironment.cs | 13 +- .../CookieCrumble.Tests.csproj | 2 - src/Directory.Build.props | 9 +- src/Directory.Packages.props | 100 +- src/GreenDonut/.vscode/tasks.json | 24 - .../src/Core/CreateDataLoaderBranch.cs | 2 - src/GreenDonut/src/Core/DataLoaderBase.cs | 4 - .../src/Core/DataLoaderFetchContext.cs | 8 - .../DataLoaderServiceCollectionExtensions.cs | 14 - src/GreenDonut/src/Core/GreenDonut.csproj | 5 - src/GreenDonut/src/Core/IDataLoader.cs | 5 - .../Projections/DefaultSelectorBuilder.cs | 4 - .../src/Core/Projections/ExpressionHelpers.cs | 2 - .../Core/Projections/ISelectionDataLoader.cs | 3 - .../src/Core/Projections/ISelectorBuilder.cs | 4 - .../Core/Projections/SelectionDataLoader.cs | 2 - .../SelectionDataLoaderExtensions.cs | 4 - src/GreenDonut/src/Core/Promise.cs | 4 - src/GreenDonut/src/Core/PromiseCache.cs | 12 - src/GreenDonut/src/Core/PromiseCacheKey.cs | 56 - src/GreenDonut/src/Directory.Build.props | 4 - src/GreenDonut/test/Directory.Build.props | 1 - .../ApolloFederation/.vscode/tasks.json | 24 - .../ApolloFederation/Directory.Build.props | 4 - .../AspNetCore/.vscode/launch.json | 30 - .../AspNetCore/.vscode/settings.json | 3 - .../AspNetCore/.vscode/tasks.json | 24 - .../AspNetCore/Directory.Build.props | 4 - .../OpaService.cs | 16 - .../Request/DefaultQueryRequestFactory.cs | 2 +- .../EndpointRouteBuilderExtensions.cs | 2 - ...olateAspNetCoreHostingBuilderExtensions.cs | 2 - ...teAspNetCoreServiceCollectionExtensions.cs | 44 +- .../PersistedOperationMiddleware.cs | 2 - .../DefaultHttpResponseFormatter.cs | 3 - ...HotChocolate.Transport.Abstractions.csproj | 9 - .../Serialization/JsonOptionDefaults.cs | 11 - .../DefaultGraphQLHttpClient.cs | 20 - .../GraphQLHttpEventStreamProcessor.cs | 26 - .../src/Transport.Http/GraphQLHttpResponse.cs | 51 - .../HotChocolate.Transport.Http.csproj | 4 - ...tChocolate.Transport.Sockets.Client.csproj | 9 - .../GraphQLOverWebSocket/MessageHelper.cs | 16 - .../Transport.Sockets.Client/SocketClient.cs | 47 - .../HotChocolate.Transport.Sockets.csproj | 4 - .../ServerTestBase.cs | 4 - .../test/AspNetCore.Tests/CostTests.cs | 2 - .../HttpGetSchemaMiddlewareTests.cs | 24 - .../AspNetCore.Tests/IntrospectionTests.cs | 2 - .../PersistedOperationMiddlewareTests.cs | 2 - ..._Explicit_Route_Explicit_Pattern_NET6.snap | 131 - ...nload_GraphQL_SDL_Explicit_Route_NET6.snap | 131 - ...lewareTests.Download_GraphQL_SDL_NET6.snap | 131 - ...ewareTests.Download_GraphQL_Schema_NET6.md | 145 - ...QL_Types_SDL_Character_and_Query_NET6.snap | 22 - ...Tests.Download_GraphQL_Types_SDL_NET6.snap | 13 - .../AzureFunctions/.vscode/launch.json | 26 - .../AzureFunctions/.vscode/tasks.json | 24 - .../AzureFunctions/Directory.Build.props | 5 - .../AzureFunctions/test/Directory.Build.props | 1 - .../Caching/Directory.Build.props | 4 - .../Caching/CacheControlTypeInterceptor.cs | 4 - .../Caching/test/Caching.Tests/SchemaTests.cs | 4 - src/HotChocolate/Core/.vscode/settings.json | 3 - src/HotChocolate/Core/.vscode/tasks.json | 24 - .../DefaultQueryableExecutable.cs | 20 - .../Core/src/Abstractions/Error.cs | 2 + .../Core/src/Abstractions/ErrorBuilder.cs | 2 + .../Execution/OperationRequestBuilder.cs | 9 +- .../Execution/OperationResultHelper.cs | 4 +- .../Execution/OrderedDictionary.cs | 9 +- .../Core/src/Abstractions/ExtensionData.cs | 9 - .../Core/src/Abstractions/FieldResult.cs | 36 - .../src/Abstractions/GraphQLTypeAttribute.cs | 2 - .../HotChocolate.Abstractions.csproj | 5 - .../Core/src/Abstractions/IFieldResult.cs | 4 - .../Core/src/Abstractions/Optional.cs | 2 - .../Core/src/Abstractions/ServiceAttribute.cs | 2 - ...orizationTypeInterceptor.ObjectTypeInfo.cs | 2 - .../AuthorizationTypeInterceptor.State.cs | 2 - .../AuthorizationTypeInterceptor.TypeInfo.cs | 2 - ...horizationTypeInterceptor.UnionTypeInfo.cs | 2 - .../AuthorizationTypeInterceptor.cs | 8 - .../HotChocolate.Authorization.csproj | 4 - .../Core/src/Core/HotChocolate.Core.csproj | 12 +- .../Core/src/Directory.Build.props | 1 - ...uestExecutorServiceCollectionExtensions.cs | 4 - .../ExecutionRequestExecutorExtensions.cs | 26 - .../Execution/HotChocolate.Execution.csproj | 17 +- .../Processing/MiddlewareContext.Arguments.cs | 4 - .../Processing/MiddlewareContext.Global.cs | 2 - .../Processing/MiddlewareContext.Pure.cs | 2 - .../Execution/Processing/OperationCompiler.cs | 29 - .../Processing/Tasks/ResolverTask.Execute.cs | 6 - .../Processing/Tasks/ResolverTaskFactory.cs | 8 - .../src/Execution/Processing/WorkQueue.cs | 12 +- .../Processing/WorkScheduler.Pause.cs | 4 - .../src/Execution/Processing/WorkScheduler.cs | 30 - .../Projections/FieldRequirementsMetadata.cs | 2 - ...tChocolateExecutionDataLoaderExtensions.cs | 6 - .../src/Execution/Projections/PropertyNode.cs | 2 - .../Projections/PropertyTreeBuilder.cs | 2 - .../RequirementsTypeInterceptor.cs | 2 - .../Projections/SelectionExpressionBuilder.cs | 2 - .../Core/src/Execution/RequestExecutor.cs | 5 - .../src/Execution/RequestExecutorResolver.cs | 13 - .../Serialization/JsonResultFormatter.cs | 23 +- .../src/Features/ReadOnlyFeatureCollection.cs | 10 - .../src/Fetching/DataLoaderScopeHolder.cs | 10 - .../src/Fetching/ExecutionDataLoaderScope.cs | 6 - ...HotChocolate.Subscriptions.InMemory.csproj | 4 - .../HotChocolate.Subscriptions.Nats.csproj | 4 - .../Core/src/Subscriptions.Nats/readme.md | 3 - .../Subscriptions.Postgres/ContinuousTask.cs | 8 - ...HotChocolate.Subscriptions.Postgres.csproj | 8 - ...HotChocolate.Subscriptions.RabbitMQ.csproj | 4 - .../HotChocolate.Subscriptions.Redis.csproj | 4 - ...ubscriptions.Serializers.Newtonsoft.csproj | 4 - .../HotChocolate.Subscriptions.csproj | 4 - .../Core/src/Types.Analyzers/Errors.cs | 32 +- .../HotChocolate.Types.Analyzers.csproj | 4 +- .../Properties/SourceGenResources.Designer.cs | 81 +- .../Properties/SourceGenResources.resx | 4 +- .../CursorPagingArguments.cs | 4 - .../CursorPagingHandler.cs | 10 - .../Core/src/Types.Errors/ErrorAttribute.cs | 2 - .../QueryConventionTypeInterceptor.cs | 4 - .../src/Types.Scalars.Upload/StreamFile.cs | 8 - .../src/Types.Scalars/EmailAddressType.cs | 12 - .../Core/src/Types.Scalars/HexColorType.cs | 12 - .../Core/src/Types.Scalars/HslType.cs | 12 - .../Core/src/Types.Scalars/HslaType.cs | 12 - .../Core/src/Types.Scalars/IPv4Type.cs | 12 - .../Core/src/Types.Scalars/IPv6Type.cs | 12 - .../Core/src/Types.Scalars/IsbnType.cs | 12 - .../Core/src/Types.Scalars/PhoneNumberType.cs | 12 - .../Core/src/Types.Scalars/RgbType.cs | 12 - .../Core/src/Types.Scalars/RgbaType.cs | 12 - .../HotChocolate.Types.Shared.csproj | 6 +- .../Configuration/AggregateTypeInterceptor.cs | 4 - .../SchemaBuilderExtensions.Document.cs | 4 - .../Core/src/Types/HotChocolate.Types.csproj | 5 - .../Core/src/Types/Internal/IExtendedType.cs | 2 - .../Core/src/Types/Internal/TypeComponent.cs | 30 - .../src/Types/Internal/TypeDiscoveryInfo.cs | 10 - .../Resolvers/DefaultResolverCompiler.cs | 20 - .../Parameters/ServiceExpressionHelper.cs | 6 - .../ServiceParameterExpressionBuilder.cs | 10 - .../src/Types/Resolvers/IResolverContext.cs | 2 - .../Core/src/Types/Schema.Initialization.cs | 6 - src/HotChocolate/Core/src/Types/Schema.cs | 6 - .../Core/src/Types/SchemaTools.cs | 3 - .../Core/src/Types/SchemaTypes.cs | 12 - .../Attributes/ExtendObjectTypeAttribute.cs | 2 - .../Conventions/DefaultTypeInspector.cs | 6 - .../Descriptors/Definitions/BindableList.cs | 4 - .../src/Types/Types/DirectiveCollection.cs | 4 - .../Types/Types/EnumType.Initialization.cs | 19 - .../ArgumentDescriptorExtensions.cs | 5 +- .../DirectiveArgumentDescriptorExtensions.cs | 5 +- .../InputObjectTypeDescriptorExtensions.cs | 5 +- .../Core/src/Types/Types/FieldCollection.cs | 33 - .../Interceptors/ResolverTypeInterceptor.cs | 7 - .../Relay/Extensions/RelayIdFieldHelpers.cs | 7 - .../src/Types/Types/Relay/NodeResolverInfo.cs | 2 - .../Relay/NodeResolverTypeInterceptor.cs | 4 - .../CompositeNodeIdValueSerializer.cs | 4 - .../Serialization/DefaultNodeIdSerializer.cs | 6 - .../GuidNodeIdValueSerializer.cs | 4 - .../OptimizedNodeIdSerializer.cs | 17 - .../Core/src/Types/Types/Scalars/Scalars.cs | 2 - .../Utilities/DefaultTypeConverter.Setup.cs | 2 - .../src/Types/Utilities/ListTypeConverter.cs | 4 - .../Utilities/ReferenceEqualityComparer.cs | 60 - .../InputObjectConstructorResolver.cs | 4 - .../Core/src/Validation/DocumentValidator.cs | 4 - .../Core/src/Validation/Rules/FieldVisitor.cs | 29 - .../Abstractions.Tests/ErrorBuilderTests.cs | 2 + .../Core/test/Directory.Build.props | 1 - .../DependencyInjectionTests.cs | 2 - .../HotChocolate.Execution.Tests.csproj | 2 +- .../Projections/ProjectableDataLoaderTests.cs | 54 - ...aLoaderTests.Branches_Are_Merged_NET7_0.md | 32 - ...Tests.Brand_Details_Country_Name_NET7_0.md | 27 - ..._With_Details_As_Custom_Resolver_NET7_0.md | 27 - ...rand_Details_Requires_Brand_Name_NET7_0.md | 22 - ...aLoaderTests.Brand_Only_TypeName_NET7_0.md | 22 - ...derTests.Brand_Products_TypeName_NET7_0.md | 22 - ...eDataLoaderTests.Brand_With_Name_NET7_0.md | 22 - ...leDataLoaderTests.Do_Not_Project_NET7_0.md | 22 - ...leDataLoaderTests.Force_A_Branch_NET7_0.md | 36 - ...derTests.Manual_Include_Of_Brand_NET7_0.md | 23 - ...ct_With_Name_And_Brand_With_Name_NET7_0.md | 26 - ...Tests.Project_And_Do_Not_Project_NET7_0.md | 28 - ...colate.Subscriptions.Postgres.Tests.csproj | 1 - .../HotChocolate.Types.Analyzers.Tests.csproj | 7 +- .../test/Types.Analyzers.Tests/TestHelper.cs | 8 +- ..._GenericBatchDataLoader_MatchesSnapshot.md | 6 +- .../HotChocolate.Types.Records.Tests.csproj | 4 - .../Resolvers/ResolverServiceTests.cs | 4 - .../Types/ObjectTypeExtensionTests.cs | 8 - .../test/Types.Tests/Types/ObjectTypeTests.cs | 4 - .../Types/Scalars/DateTypeTests.cs | 4 - .../CostAnalysis/Directory.Build.props | 4 - ...ctionQuery_ReturnsExpectedResult_NET7_0.md | 117 - ...ctionQuery_ReturnsExpectedResult_NET8_0.md | 117 - ..._ListQuery_ReturnsExpectedResult_NET7_0.md | 78 - ..._ListQuery_ReturnsExpectedResult_NET8_0.md | 63 - src/HotChocolate/Data/.vscode/launch.json | 27 - src/HotChocolate/Data/.vscode/settings.json | 2 - src/HotChocolate/Data/.vscode/tasks.json | 24 - src/HotChocolate/Data/Directory.Build.props | 1 - .../Attributes/UseFilteringAttribute.cs | 2 - .../FilterConventionDescriptorExtensions.cs | 12 +- ...ojectionObjectFieldDescriptorExtensions.cs | 2 - .../Sorting/Attributes/UseSortingAttribute.cs | 2 - .../Data.AutoMapper.Tests/ProjectToTests.cs | 6 +- ...oTests.Execute_ManyToOne_Deep_NET8_0.snap} | 0 ...ToTests.Execute_ManyToOne_Deep_NET9_0.snap | 107 + ...jectToTests.Execute_ManyToOne_NET8_0.snap} | 0 ...ojectToTests.Execute_ManyToOne_NET9_0.snap | 56 + ...ToTests.Execute_OneToOne_Deep_NET8_0.snap} | 0 ...tToTests.Execute_OneToOne_Deep_NET9_0.snap | 73 + .../IntegrationTests.cs | 4 - ....Paging_Next_2_With_User_Sorting_NET6_0.md | 24 - .../QueryableFilterVisitorBooleanTests.cs | 2 +- .../QueryableFilterVisitorComparableTests.cs | 14 +- .../QueryableFilterVisitorEnumTests.cs | 6 +- .../QueryableFilterVisitorExpressionTests.cs | 2 +- .../QueryableFilterVisitorListTests.cs | 8 +- .../QueryableFilterVisitorObjectTests.cs | 10 +- .../QueryableFilterVisitorStringTests.cs | 8 +- ...e_NullableBooleanNotEqual_Expression.snap} | 0 ...ableBooleanNotEqual_Expression_NET6_0.snap | 72 - ...ableBooleanNotEqual_Expression_NET7_0.snap | 72 - ...rableTests.Create_ShortIn_Expression.snap} | 0 ...ests.Create_ShortIn_Expression_NET6_0.snap | 73 - ...ests.Create_ShortIn_Expression_NET7_0.snap | 73 - ...leTests.Create_ShortNotIn_Expression.snap} | 0 ...s.Create_ShortNotIn_Expression_NET6_0.snap | 67 - ...s.Create_ShortNotIn_Expression_NET7_0.snap | 67 - ...ate_ShortNullableIn_Expression_NET7_0.snap | 68 - ...te_ShortNullableIn_Expression_NET9_0.snap} | 21 +- ...ate_ShortNullableNotEqual_Expression.snap} | 0 ...reaterThanOrEquals_Expression_NET8_0.snap} | 0 ...GreaterThanOrEquals_Expression_NET9_0.snap | 111 + ...ableNotGreaterThan_Expression_NET8_0.snap} | 0 ...ableNotGreaterThan_Expression_NET9_0.snap} | 61 +- ..._ShortNullableNotIn_Expression_NET6_0.snap | 68 - ...ShortNullableNotIn_Expression_NET9_0.snap} | 21 +- ...tLowerThanOrEquals_Expression_NET8_0.snap} | 0 ...otLowerThanOrEquals_Expression_NET9_0.snap | 111 + ...llableNotLowerThan_Expression_NET8_0.snap} | 0 ...llableNotLowerThan_Expression_NET9_0.snap} | 63 +- ...orEnumTests.Create_EnumIn_Expression.snap} | 0 ...Tests.Create_EnumIn_Expression_NET6_0.snap | 68 - ...Tests.Create_EnumIn_Expression_NET7_0.snap | 68 - ...numTests.Create_EnumNotIn_Expression.snap} | 0 ...ts.Create_EnumNotIn_Expression_NET6_0.snap | 74 - ...ts.Create_EnumNotIn_Expression_NET7_0.snap | 74 - ...eate_NullableEnumIn_Expression_NET7_0.snap | 65 - ...ate_NullableEnumIn_Expression_NET9_0.snap} | 21 +- ...eate_NullableEnumNotEqual_Expression.snap} | 0 ...ullableEnumNotEqual_Expression_NET6_0.snap | 90 - ...ullableEnumNotEqual_Expression_NET7_0.snap | 90 - ...e_NullableEnumNotIn_Expression_NET7_0.snap | 80 - ..._NullableEnumNotIn_Expression_NET9_0.snap} | 21 +- ...nTests.Create_StringConcatExpression.snap} | 0 ....Create_StringConcatExpression_NET6_0.snap | 56 - ....Create_StringConcatExpression_NET7_0.snap | 56 - ...ArrayAllObjectStringEqual_Expression.snap} | 0 ...llObjectStringEqual_Expression_NET6_0.snap | 74 - ...llObjectStringEqual_Expression_NET7_0.snap | 74 - ...ArrayAnyObjectStringEqual_Expression.snap} | 0 ...nyObjectStringEqual_Expression_NET6_0.snap | 131 - ...nyObjectStringEqual_Expression_NET7_0.snap | 131 - ...rrayNoneObjectStringEqual_Expression.snap} | 0 ...neObjectStringEqual_Expression_NET6_0.snap | 167 - ...neObjectStringEqual_Expression_NET7_0.snap | 167 - ...ObjectStringEqualWithNull_Expression.snap} | 0 ...StringEqualWithNull_Expression_NET6_0.snap | 154 - ...StringEqualWithNull_Expression_NET7_0.snap | 154 - ...NestedArrayAnyStringEqual_Expression.snap} | 0 ...ArrayAnyStringEqual_Expression_NET6_0.snap | 143 - ...ArrayAnyStringEqual_Expression_NET7_0.snap | 143 - ...estedArraySomeStringEqual_Expression.snap} | 0 ...rraySomeStringEqual_Expression_NET6_0.snap | 73 - ...rraySomeStringEqual_Expression_NET8_0.snap | 73 - ...Tests.Create_ObjectEnumIn_Expression.snap} | 0 ...Create_ObjectEnumIn_Expression_NET6_0.snap | 81 - ...Create_ObjectEnumIn_Expression_NET7_0.snap | 81 - ...bjectNullableEnumIn_Expression_NET7_0.snap | 78 - ...jectNullableEnumIn_Expression_NET9_0.snap} | 21 +- ...jectNullableShortIn_Expression_NET7_0.snap | 98 - ...ectNullableShortIn_Expression_NET9_0.snap} | 21 +- ...ests.Create_ObjectShortIn_Expression.snap} | 0 ...reate_ObjectShortIn_Expression_NET6_0.snap | 93 - ...reate_ObjectShortIn_Expression_NET7_0.snap | 93 - ...sts.Create_ObjectStringIn_Expression.snap} | 0 ...eate_ObjectStringIn_Expression_NET6_0.snap | 93 - ...eate_ObjectStringIn_Expression_NET7_0.snap | 93 - ...te_NullableStringContains_Expression.snap} | 0 ...lableStringContains_Expression_NET6_0.snap | 71 - ...lableStringContains_Expression_NET7_0.snap | 71 - ...lableStringEndsWith_Expression_NET6_0.snap | 71 - ...lableStringEndsWith_Expression_NET7_0.snap | 71 - ...ableStringEndsWith_Expression_NET9_0.snap} | 8 +- ...te_NullableStringIn_Expression_NET7_0.snap | 65 - ...e_NullableStringIn_Expression_NET9_0.snap} | 21 +- ...bleStringNoContains_Expression_NET6_0.snap | 77 - ...leStringNoContains_Expression_NET9_0.snap} | 4 +- ...leStringNotEndsWith_Expression_NET6_0.snap | 77 - ...eStringNotEndsWith_Expression_NET9_0.snap} | 8 +- ...te_NullableStringNotEqual_Expression.snap} | 0 ...lableStringNotEqual_Expression_NET6_0.snap | 72 - ...lableStringNotEqual_Expression_NET7_0.snap | 72 - ...NullableStringNotIn_Expression_NET7_0.snap | 62 - ...ullableStringNotIn_Expression_NET9_0.snap} | 21 +- ...StringNotStartsWith_Expression_NET6_0.snap | 77 - ...StringNotStartsWith_Expression_NET7_0.snap | 77 - ...tringNotStartsWith_Expression_NET9_0.snap} | 14 +- ...bleStringStartsWith_Expression_NET6_0.snap | 71 - ...bleStringStartsWith_Expression_NET7_0.snap | 71 - ...leStringStartsWith_Expression_NET9_0.snap} | 8 +- ...sts.Create_StringContains_Expression.snap} | 0 ...eate_StringContains_Expression_NET6_0.snap | 71 - ...eate_StringContains_Expression_NET7_0.snap | 71 - ...ate_StringEndsWith_Expression_NET9_0.snap} | 8 +- ...ringTests.Create_StringIn_Expression.snap} | 0 ...sts.Create_StringIn_Expression_NET6_0.snap | 70 - ...sts.Create_StringIn_Expression_NET7_0.snap | 70 - ...te_StringNoContains_Expression_NET6_0.snap | 71 - ...e_StringNoContains_Expression_NET9_0.snap} | 4 +- ...e_StringNotEndsWith_Expression_NET6_0.snap | 71 - ..._StringNotEndsWith_Expression_NET9_0.snap} | 8 +- ....Create_StringNotIn_Expression_NET7_0.snap | 63 - ...Create_StringNotIn_Expression_NET9_0.snap} | 14 +- ...tringNotStartsWith_Expression_NET9_0.snap} | 8 +- ...e_StringStartsWith_Expression_NET9_0.snap} | 8 +- .../QueryableFilterVisitorTimeOnlyTests.cs | 2 - .../FilterAttributeTests.cs | 2 - .../QueryableProjectionFilterTests.cs | 8 +- .../QueryableProjectionHashSetTest.cs | 4 +- .../QueryableProjectionSetTest.cs | 4 +- .../QueryableProjectionSortedSetTest.cs | 4 +- .../QueryableProjectionSortingTests.cs | 4 +- ...eepFilterObjectTwoProjections_NET8_0.snap} | 0 ...DeepFilterObjectTwoProjections_NET9_0.snap | 42 + ...ObjectTwoProjections_Nullable_NET8_0.snap} | 0 ...rObjectTwoProjections_Nullable_NET9_0.snap | 45 + ...bjectDifferentLevelProjection_NET8_0.snap} | 0 ...ObjectDifferentLevelProjection_NET9_0.snap | 44 + ...erentLevelProjection_Nullable_NET8_0.snap} | 0 ...ferentLevelProjection_Nullable_NET9_0.snap | 49 + ...eepFilterObjectTwoProjections_NET8_0.snap} | 0 ...DeepFilterObjectTwoProjections_NET9_0.snap | 46 + ...bjectDifferentLevelProjection_NET8_0.snap} | 0 ...ObjectDifferentLevelProjection_NET9_0.snap | 48 + ...eepFilterObjectTwoProjections_NET8_0.snap} | 0 ...DeepFilterObjectTwoProjections_NET9_0.snap | 46 + ...bjectDifferentLevelProjection_NET8_0.snap} | 0 ...ObjectDifferentLevelProjection_NET9_0.snap | 48 + ...eepFilterObjectTwoProjections_NET8_0.snap} | 0 ...DeepFilterObjectTwoProjections_NET9_0.snap | 46 + ...bjectDifferentLevelProjection_NET8_0.snap} | 0 ...ObjectDifferentLevelProjection_NET9_0.snap | 48 + ...eepFilterObjectTwoProjections_NET8_0.snap} | 0 ...DeepFilterObjectTwoProjections_NET9_0.snap | 70 + ...ObjectDifferentLevelProjection_NET8_0.snap | 72 + ...ObjectDifferentLevelProjection_NET9_0.snap | 72 + .../QueryableSortVisitorExpressionTests.cs | 2 +- ...nTests.Create_StringConcatExpression.snap} | 0 ....Create_StringConcatExpression_NET6_0.snap | 49 - ....Create_StringConcatExpression_NET7_0.snap | 49 - .../Data.Sorting.Tests/SortAttributeTests.cs | 2 - .../Data/test/Data.Tests/ExecutableTests.cs | 3 +- ...yOneItem_When_SingleOrDefault_NET8_0.snap} | 0 ...lyOneItem_When_SingleOrDefault_NET9_0.snap | 17 + .../Diagnostics/Directory.Build.props | 4 - .../Diagnostics.Tests/ActivityTestHelper.cs | 18 +- .../QueryInstrumentationTests.cs | 52 - .../ServerInstrumentationTests.cs | 52 - ...onTests.Allow_document_to_be_captured.snap | 4 +- ...s.Allow_document_to_be_captured__NET7.snap | 141 - ...r_error_that_deletes_the_whole_result.snap | 33 +- ...r_that_deletes_the_whole_result__NET7.snap | 171 - ...or_that_deletes_the_whole_result_deep.snap | 29 +- ...t_deletes_the_whole_result_deep__NET7.snap | 88 - ...e_operation_display_name_with_1_field.snap | 4 +- ...ation_display_name_with_1_field__NET7.snap | 133 - ...tion_display_name_with_1_field_and_op.snap | 4 +- ...isplay_name_with_1_field_and_op__NET7.snap | 137 - ...e_operation_display_name_with_3_field.snap | 4 +- ...ation_display_name_with_3_field__NET7.snap | 213 - ...e_operation_display_name_with_4_field.snap | 4 +- ...ation_display_name_with_4_field__NET7.snap | 253 - ...peration_name_is_used_as_request_name.snap | 4 +- ...on_name_is_used_as_request_name__NET7.snap | 137 - ...lidation_activity_has_an_error_status.snap | 24 +- ...on_activity_has_an_error_status__NET7.snap | 84 - ...nTests.Track_data_loader_events__NET7.snap | 83 - ...ck_data_loader_events_with_keys__NET7.snap | 83 - ...vents_of_a_simple_query_default__NET7.snap | 76 - ...ack_events_of_a_simple_query_detailed.snap | 4 +- ...ents_of_a_simple_query_detailed__NET7.snap | 133 - ...tionTests.Http_Get_SDL_download__NET7.snap | 16 - ...ts.Http_Get_SingleRequest_GetHeroName.snap | 16 +- ...p_Get_SingleRequest_GetHeroName__NET7.snap | 166 - ...s.Http_Post_SingleRequest_GetHeroName.snap | 16 +- ...ost_SingleRequest_GetHeroName_Default.snap | 4 +- ...ngleRequest_GetHeroName_Default__NET7.snap | 134 - ..._Post_SingleRequest_GetHeroName__NET7.snap | 170 - ....Http_Post_add_query_to_http_activity.snap | 16 +- ...Post_add_query_to_http_activity__NET7.snap | 186 - ...p_Post_add_variables_to_http_activity.snap | 16 +- ..._add_variables_to_http_activity__NET7.snap | 186 - ...s.Http_Post_capture_deferred_response.snap | 16 +- ..._Post_capture_deferred_response__NET7.snap | 212 - ...t_ensure_list_path_is_correctly_built.snap | 16 +- ...re_list_path_is_correctly_built__NET7.snap | 330 - ...mentationTests.Http_Post_parser_error.snap | 24 +- ...ionTests.Http_Post_parser_error__NET7.snap | 59 - ...not_automatically_added_to_activities.snap | 16 +- ...tomatically_added_to_activities__NET7.snap | 182 - ...onTests.Http_Post_with_extensions_map.snap | 16 +- ...s.Http_Post_with_extensions_map__NET7.snap | 186 - ...g_error_when_rename_root_is_activated.snap | 24 +- ...r_when_rename_root_is_activated__NET7.snap | 59 - ...n_error_when_rename_root_is_activated.snap | 24 +- ...r_when_rename_root_is_activated__NET7.snap | 105 - src/HotChocolate/Fusion/.vscode/settings.json | 3 - src/HotChocolate/Fusion/.vscode/tasks.json | 24 - src/HotChocolate/Fusion/Directory.Build.props | 4 - .../Aspire/HotChocolate.Fusion.Aspire.csproj | 3 - ...olate.Fusion.Aspire.Analyzers.Tests.csproj | 2 - src/HotChocolate/Language/.vscode/launch.json | 25 - src/HotChocolate/Language/.vscode/tasks.json | 24 - .../Language/src/Directory.Build.props | 7 +- .../Language.SyntaxTree/DirectiveLocation.cs | 6 +- .../Extensions/HashCodeExtensions.cs | 4 +- .../HotChocolate.Language.SyntaxTree.csproj | 2 +- .../SyntaxEqualityComparer.cs | 18 +- .../Utilities/SyntaxPrinter.cs | 8 +- .../Language.Utf8/Utf8GraphQLParser.Syntax.cs | 60 +- .../src/Language.Utf8/Utf8GraphQLParser.cs | 12 +- .../Language.Web/DocumentHashProviderBase.cs | 12 +- .../Language.Web/MD5DocumentHashProvider.cs | 12 +- .../Language.Web/Sha1DocumentHashProvider.cs | 8 +- .../Sha256DocumentHashProvider.cs | 12 +- .../Language/test/Directory.Build.props | 1 - src/HotChocolate/Marten/Directory.Build.props | 1 - src/HotChocolate/MongoDb/.vscode/launch.json | 27 - .../MongoDb/.vscode/settings.json | 2 - src/HotChocolate/MongoDb/.vscode/tasks.json | 24 - .../MongoDb/Directory.Build.props | 1 - ...oDbFilterConventionDescriptorExtensions.cs | 4 - .../Relay/ObjectIdNodeIdValueSerializer.cs | 2 +- .../OpenApi/Directory.Build.props | 4 - .../RequestExecutorBuilderExtensions.cs | 2 +- .../Extensions/StringExtensions.cs | 4 +- .../Pagination/Directory.Build.props | 1 - .../Pagination/src/Directory.Build.props | 4 +- ...ePaginationBatchingDataLoaderExtensions.cs | 2 - .../StringCursorKeySerializer.cs | 13 - .../CursorKeySerializerHelperTests.cs | 2 - ...te.Pagination.EntityFramework.Tests.csproj | 2 +- .../PagingHelperIntegrationTests.cs | 12 - ...gHelperTests.Nested_Paging_First_2_NET6.md | 68 - ...gHelperTests.Nested_Paging_First_2_NET7.md | 68 - ...ed_Paging_First_2_With_Projections_NET6.md | 68 - ...ed_Paging_First_2_With_Projections_NET7.md | 68 - .../PersistedOperations/.vscode/tasks.json | 24 - .../src/Directory.Build.props | 4 - .../FileSystemOperationDocumentStorage.cs | 8 - .../test/Directory.Build.props | 1 - .../Primitives/src/Directory.Build.props | 5 +- .../Primitives/HotChocolate.Primitives.csproj | 5 - .../Primitives/src/Primitives/NameUtils.cs | 2 - src/HotChocolate/Raven/Directory.Build.props | 1 - .../ConventionTests.cs | 7 - ...pe_Should_NotContainAllOperation_NET6.snap | 53 - .../Data.Raven.Tests/AnnotationBasedTests.cs | 4 - .../Skimmed/Directory.Build.props | 4 - .../Skimmed/src/Directory.Build.props | 4 +- .../ReadOnlyObjectTypeDefinitionCollection.cs | 2 +- src/HotChocolate/Spatial/.vscode/launch.json | 24 - src/HotChocolate/Spatial/.vscode/tasks.json | 24 - .../Spatial/Directory.Build.props | 1 - .../Types/HotChocolate.Types.Spatial.csproj | 1 - .../HotChocolate.Types.Spatial.Tests.csproj | 1 - src/HotChocolate/Utilities/.vscode/tasks.json | 24 - .../Utilities/src/Directory.Build.props | 4 - .../ServiceCollectionExtensions.cs | 12 - ...otChocolate.Utilities.Introspection.csproj | 4 - .../Utilities/src/Utilities/ArrayWriter.cs | 10 - .../DependencyInjection/ServiceFactory.cs | 10 +- .../Utilities/HotChocolate.Utilities.csproj | 10 +- .../src/Utilities/MiddlewareCompiler.cs | 22 - .../Utilities/test/Directory.Build.props | 1 - .../IntrospectionClientTests.cs | 4 - ...tionClientTests.IntrospectServer_NET6.snap | 125 - src/Nullable.props | 4 +- src/StrawberryShake/Client/.vscode/tasks.json | 24 - .../Client/src/Core/Json/JsonResultPatcher.cs | 43 - .../Core/Serialization/SerializerResolver.cs | 7 - .../src/Core/StrawberryShake.Core.csproj | 11 - .../Client/src/Directory.Build.props | 1 - .../StrawberryShake.Persistence.SQLite.csproj | 5 - .../src/Razor/StrawberryShake.Razor.csproj | 1 - .../src/Transport.Http/HttpConnection.cs | 27 +- .../src/Transport.Http/ResponseEnumerable.cs | 9 - .../StrawberryShake.Transport.Http.csproj | 4 - ...trawberryShake.Transport.WebSockets.csproj | 4 - .../Client/test/Directory.Build.props | 1 - .../CodeGeneration/.vscode/tasks.json | 24 - .../Analyzers/FieldCollector.cs | 2 + .../Analyzers/FragmentHelper.cs | 2 + .../CodeGeneration/src/Directory.Build.props | 1 - .../InputGeneratorTests.cs | 2 - ...nyScalarDefaultSerializationTest.Client.cs | 35 +- .../Integration/EntityIdOrDataTest.Client.cs | 165 +- .../Integration/MultiProfileTest.Client.cs | 478 +- ...tarWarsGetFriendsDeferInListTest.Client.cs | 332 +- .../StarWarsGetFriendsDeferredTest.Client.cs | 337 +- .../StarWarsGetFriendsNoStoreTest.Client.cs | 128 +- .../StarWarsGetFriendsTest.Client.cs | 209 +- .../Integration/StarWarsGetHeroTest.Client.cs | 114 +- .../StarWarsGetHeroTraitsTest.Client.cs | 126 +- .../StarWarsIntrospectionTest.Client.cs | 1114 ++- .../Integration/StarWarsIntrospectionTest.cs | 4 - ...tarWarsOnReviewSubCompletionTest.Client.cs | 107 +- ...tarWarsOnReviewSubGraphQLSSETest.Client.cs | 107 +- .../StarWarsOnReviewSubNoStoreTest.Client.cs | 104 +- ...StarWarsTypeNameOnInterfacesTest.Client.cs | 109 +- .../StarWarsTypeNameOnUnionsTest.Client.cs | 129 +- .../StarWarsUnionListTest.Client.cs | 266 +- .../Integration/UploadScalarTest.Client.cs | 335 +- .../UploadScalar_InMemoryTest.Client.cs | 335 +- .../Integration/__snapshots__/NET6.snap | 6642 ----------------- ...ectionGeneratorTests.Default_Combined.snap | 259 +- ...sts.Default_DifferentTransportMethods.snap | 259 +- ...ectionGeneratorTests.Default_InMemory.snap | 259 +- ...onGeneratorTests.Default_MultiProfile.snap | 259 +- ...ectionGeneratorTests.Default_Mutation.snap | 99 +- ...InjectionGeneratorTests.Default_Query.snap | 80 +- ...onGeneratorTests.Default_Subscription.snap | 88 +- ...ookClient_DataInEntity_UnionDataTypes.snap | 189 +- ...aInEntity_UnionDataTypes_With_Records.snap | 189 +- ...ookClient_DataOnly_InterfaceDataTypes.snap | 127 +- ...aOnly_InterfaceDataTypes_With_Records.snap | 127 +- ...te_BookClient_DataOnly_UnionDataTypes.snap | 107 +- ..._DataOnly_UnionDataTypes_With_Records.snap | 107 +- ...rate_ChatClient_ConnectionNotAnEntity.snap | 148 +- ...nt_ConnectionNotAnEntity_With_Records.snap | 148 +- ...lient_MapperMapsEntityOnRootCorrectly.snap | 675 +- ...apsEntityOnRootCorrectly_With_Records.snap | 675 +- ...ryGeneratorTests.Simple_ComplexEntity.snap | 93 +- ...torTests.Simple_DateTimeOffset_Entity.snap | 87 +- ...FactoryGeneratorTests.Simple_IdEntity.snap | 87 +- ...FactoryGeneratorTests.Simple_NoEntity.snap | 69 +- ...toryGeneratorTests.Simple_Uuid_Entity.snap | 87 +- ...tityOrIdGeneratorTests.InterfaceField.snap | 177 +- ...ntityOrIdGeneratorTests.InterfaceList.snap | 177 +- ...GeneratorTests.NonNullableValueTypeId.snap | 165 +- .../EntityOrIdGeneratorTests.UnionField.snap | 165 +- .../EntityOrIdGeneratorTests.UnionList.snap | 165 +- ...yOrIdGeneratorTests.UnionListInEntity.snap | 204 +- ...dGeneratorTests.UnionWithNestedObject.snap | 343 +- ....Generate_ChatClient_InvalidNullCheck.snap | 164 +- ...ErrorGeneratorTests.Generate_NoErrors.snap | 130 +- ...pe_Fields_Are_Inspected_For_LeafTypes.snap | 176 +- ...InputGeneratorTests.KeywordCollisions.snap | 180 +- ...eneratorTests.Operation_With_Comments.snap | 145 +- ...tion_With_Comments_With_Input_Records.snap | 145 +- ...ests.Operation_With_ComplexInputTypes.snap | 69 +- ...ests.Operation_With_Complex_Arguments.snap | 145 +- ...orTests.Operation_With_FirstNonUpload.snap | 101 +- ...torTests.Operation_With_LastNonUpload.snap | 101 +- ...ratorTests.Operation_With_UploadAsArg.snap | 339 +- ...peration_With_UploadInDeepInputObject.snap | 65 +- ...ts.Operation_With_UploadInInputObject.snap | 62 +- ...ests.Generate_StarWarsIntegrationTest.snap | 229 +- ...torTests.Interface_With_Default_Names.snap | 89 +- ...e_With_Fragment_Definition_Two_Models.snap | 277 +- ...torTests.Operation_With_Leaf_Argument.snap | 108 +- ...torTests.Operation_With_Type_Argument.snap | 169 +- ...neratorTests.StarWarsTypeNameOnUnions.snap | 63 +- ...rWarsGeneratorTests.StarWarsUnionList.snap | 109 +- ...Tests.Subscription_With_Default_Names.snap | 102 +- ...sts.Generate_ChatClient_AllOperations.snap | 1935 ++++- ...NullableValueType_WithoutGlobal_Input.snap | 62 +- ...atorTests.NonNullable_ValueType_Input.snap | 62 +- ...ionGeneratorTests.Nullable_List_Input.snap | 63 +- ...neratorTests.Nullable_ValueType_Input.snap | 62 +- ...sts.Operation_With_MultipleOperations.snap | 446 +- ...ests.Response_Name_Is_Correctly_Cased.snap | 60 +- ...onGeneratorTests.Simple_Custom_Scalar.snap | 13 +- ...esultTypeGeneratorTests.Nested_Entity.snap | 481 +- ...eneratorTests.Operation_With_Comments.snap | 168 +- ...torTests.Operation_With_Complex_Types.snap | 168 +- ...atorTests.Operation_With_NullableData.snap | 197 +- .../ScalarGeneratorTests.Any_Scalar.snap | 68 +- .../ScalarGeneratorTests.Any_Type.snap | 69 +- ...arGeneratorTests.ByteArray_ScalarType.snap | 46 +- ...omplete_Schema_With_Uuid_And_DateTime.snap | 175 +- ...rTests.Custom_Scalar_With_RuntimeType.snap | 69 +- ...ar_With_RuntimeType_ValueType_AsInput.snap | 95 +- ....Custom_Scalar_With_SerializationType.snap | 69 +- ...ith_SerializationType_And_RuntimeType.snap | 69 +- ...ustom_Scalar_With_Unknown_RuntimeType.snap | 69 +- ...larGeneratorTests.Only_Custom_Scalars.snap | 61 +- ...rTests.Scalars_Are_Correctly_Inferred.snap | 117 +- ...arGeneratorTests.Simple_Custom_Scalar.snap | 69 +- ...rGeneratorTests.TimeSpan_Not_Detected.snap | 131 +- .../ScalarGeneratorTests.Uri_Type.snap | 66 +- .../ScalarGeneratorTests.Uuid_Type.snap | 68 +- ...aGeneratorTests.Create_DataType_Query.snap | 83 +- ...hemaGeneratorTests.Create_GetFeatById.snap | 218 +- ...emaGeneratorTests.Create_GetFeatsPage.snap | 248 +- ...pleSearch_From_ActiveDirectory_Schema.snap | 569 +- ...atorTests.Create_Query_With_Skip_Take.snap | 213 +- ...orTests.Create_UpdateMembers_Mutation.snap | 164 +- ...ests.EnumWithUnderscorePrefixedValues.snap | 40 +- ...eratorTests.FieldsWithUnderlineInName.snap | 887 ++- ...emaGeneratorTests.Full_Extension_File.snap | 138 +- .../SchemaGeneratorTests.HasuraMutation.snap | 198 +- ...hemaGeneratorTests.IntrospectionQuery.snap | 1114 ++- ...eneratorTests.LowerCaseScalarArgument.snap | 134 +- ...GeneratorTests.MultiLineDocumentation.snap | 30 +- ...aGeneratorTests.NodeTypenameCollision.snap | 97 +- .../SchemaGeneratorTests.NonNullLists.snap | 188 +- ...chemaGeneratorTests.QueryInterference.snap | 883 ++- ...atorTests.Query_With_Nested_Fragments.snap | 315 +- ...eneratorTests.Schema_With_Spec_Errors.snap | 138 +- ..._Client_With_Internal_Access_Modifier.snap | 130 +- ...ests.Generate_StarWarsIntegrationTest.snap | 232 +- ...torTests.Interface_With_Default_Names.snap | 130 +- ...e_With_Fragment_Definition_Two_Models.snap | 358 +- ...torTests.Operation_With_Leaf_Argument.snap | 149 +- ...torTests.Operation_With_Type_Argument.snap | 172 +- ...neratorTests.StarWarsTypeNameOnUnions.snap | 129 +- ...rWarsGeneratorTests.StarWarsUnionList.snap | 173 +- ...Tests.Subscription_With_Default_Names.snap | 105 +- ...azorGeneratorTests.Query_And_Mutation.snap | 240 +- .../CodeGeneration/test/Directory.Build.props | 1 - src/StrawberryShake/Directory.Build.props | 5 - .../Blazor/StrawberryShake.Blazor.csproj | 2 - .../Common/MSBuild/StrawberryShake.targets | 10 +- .../MetaPackages/Directory.Build.props | 1 - .../Maui/StrawberryShake.Maui.csproj | 2 - .../Server/StrawberryShake.Server.csproj | 2 - .../Tooling/.vscode/launch.json | 33 - .../Tooling/.vscode/tasks.json | 24 - .../Tooling/Directory.Build.props | 4 - ...StrawberryShake.Tools.Configuration.csproj | 1 - .../JsonConsoleOutputCommand.cs | 4 - templates/StarWars/content/StarWars.csproj | 2 +- .../.template.config/template.json | 12 +- ...te.Template.AzureFunctions.Isolated.csproj | 8 +- .../v12/function-isolated/local.settings.json | 11 +- .../function/.template.config/template.json | 12 +- .../.template.config/template.json | 10 +- .../v12/gateway-aspire/.vscode/tasks.json | 24 - ...otChocolate.Template.Gateway.Aspire.csproj | 4 +- .../.template.config/template.json | 10 +- templates/v12/gateway-bcp/.vscode/tasks.json | 24 - ...tChocolate.Template.Gateway.Managed.csproj | 4 +- .../gateway/.template.config/template.json | 10 +- templates/v12/gateway/.vscode/tasks.json | 24 - .../HotChocolate.Template.Gateway.csproj | 2 +- .../v12/server/.template.config/template.json | 14 +- templates/v12/server/.vscode/tasks.json | 24 - .../HotChocolate.Template.Server.csproj | 2 +- 685 files changed, 26254 insertions(+), 21652 deletions(-) delete mode 100644 .build/.vscode/launch.json delete mode 100644 .build/.vscode/settings.json delete mode 100644 .build/.vscode/tasks.json delete mode 100644 src/GreenDonut/.vscode/tasks.json delete mode 100644 src/HotChocolate/ApolloFederation/.vscode/tasks.json delete mode 100644 src/HotChocolate/AspNetCore/.vscode/launch.json delete mode 100644 src/HotChocolate/AspNetCore/.vscode/settings.json delete mode 100644 src/HotChocolate/AspNetCore/.vscode/tasks.json delete mode 100644 src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route_Explicit_Pattern_NET6.snap delete mode 100644 src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route_NET6.snap delete mode 100644 src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_NET6.snap delete mode 100644 src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema_NET6.md delete mode 100644 src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Types_SDL_Character_and_Query_NET6.snap delete mode 100644 src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Types_SDL_NET6.snap delete mode 100644 src/HotChocolate/AzureFunctions/.vscode/launch.json delete mode 100644 src/HotChocolate/AzureFunctions/.vscode/tasks.json delete mode 100644 src/HotChocolate/Core/.vscode/settings.json delete mode 100644 src/HotChocolate/Core/.vscode/tasks.json delete mode 100644 src/HotChocolate/Core/src/Types/Utilities/ReferenceEqualityComparer.cs delete mode 100644 src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Branches_Are_Merged_NET7_0.md delete mode 100644 src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_NET7_0.md delete mode 100644 src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_With_Details_As_Custom_Resolver_NET7_0.md delete mode 100644 src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_NET7_0.md delete mode 100644 src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_Only_TypeName_NET7_0.md delete mode 100644 src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_Products_TypeName_NET7_0.md delete mode 100644 src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_NET7_0.md delete mode 100644 src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Do_Not_Project_NET7_0.md delete mode 100644 src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Force_A_Branch_NET7_0.md delete mode 100644 src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Manual_Include_Of_Brand_NET7_0.md delete mode 100644 src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Product_With_Name_And_Brand_With_Name_NET7_0.md delete mode 100644 src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Project_And_Do_Not_Project_NET7_0.md delete mode 100644 src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/StaticQueryAnalysisTests.Execute_ConnectionQuery_ReturnsExpectedResult_NET7_0.md delete mode 100644 src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/StaticQueryAnalysisTests.Execute_ConnectionQuery_ReturnsExpectedResult_NET8_0.md delete mode 100644 src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/StaticQueryAnalysisTests.Execute_ListQuery_ReturnsExpectedResult_NET7_0.md delete mode 100644 src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/StaticQueryAnalysisTests.Execute_ListQuery_ReturnsExpectedResult_NET8_0.md delete mode 100644 src/HotChocolate/Data/.vscode/launch.json delete mode 100644 src/HotChocolate/Data/.vscode/settings.json delete mode 100644 src/HotChocolate/Data/.vscode/tasks.json rename src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/{ProjectToTests.Execute_ManyToOne_Deep.snap => ProjectToTests.Execute_ManyToOne_Deep_NET8_0.snap} (100%) create mode 100644 src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_ManyToOne_Deep_NET9_0.snap rename src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/{ProjectToTests.Execute_ManyToOne.snap => ProjectToTests.Execute_ManyToOne_NET8_0.snap} (100%) create mode 100644 src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_ManyToOne_NET9_0.snap rename src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/{ProjectToTests.Execute_OneToOne_Deep.snap => ProjectToTests.Execute_OneToOne_Deep_NET8_0.snap} (100%) create mode 100644 src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_OneToOne_Deep_NET9_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_User_Sorting_NET6_0.md rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression_NET8_0.snap => QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression.snap} (100%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorComparableTests.Create_ShortIn_Expression_NET8_0.snap => QueryableFilterVisitorComparableTests.Create_ShortIn_Expression.snap} (100%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression_NET8_0.snap => QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression.snap} (100%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression_NET7_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET6_0.snap => QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET9_0.snap} (67%) rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression_NET8_0.snap => QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression.snap} (100%) rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThanOrEquals_Expression.snap => QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThanOrEquals_Expression_NET8_0.snap} (100%) create mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThanOrEquals_Expression_NET9_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThan_Expression.snap => QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThan_Expression_NET8_0.snap} (100%) rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression_NET7_0.snap => QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThan_Expression_NET9_0.snap} (52%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET6_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET7_0.snap => QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET9_0.snap} (63%) rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThanOrEquals_Expression.snap => QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThanOrEquals_Expression_NET8_0.snap} (100%) create mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThanOrEquals_Expression_NET9_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThan_Expression.snap => QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThan_Expression_NET8_0.snap} (100%) rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression_NET6_0.snap => QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThan_Expression_NET9_0.snap} (53%) rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorEnumTests.Create_EnumIn_Expression_NET8_0.snap => QueryableFilterVisitorEnumTests.Create_EnumIn_Expression.snap} (100%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression_NET8_0.snap => QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression.snap} (100%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression_NET7_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET6_0.snap => QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET9_0.snap} (66%) rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET8_0.snap => QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression.snap} (100%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET7_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET6_0.snap => QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET9_0.snap} (68%) rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorExpressionTests.Create_StringConcatExpression_NET8_0.snap => QueryableFilterVisitorExpressionTests.Create_StringConcatExpression.snap} (100%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET8_0.snap => QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression.snap} (100%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorListTests.Create_ArrayAnyObjectStringEqual_Expression_NET8_0.snap => QueryableFilterVisitorListTests.Create_ArrayAnyObjectStringEqual_Expression.snap} (100%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAnyObjectStringEqual_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAnyObjectStringEqual_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET8_0.snap => QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression.snap} (100%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET8_0.snap => QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression.snap} (100%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArrayAnyStringEqual_Expression_NET8_0.snap => QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArrayAnyStringEqual_Expression.snap} (100%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArrayAnyStringEqual_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArrayAnyStringEqual_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression_NET7_0.snap => QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression.snap} (100%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression_NET8_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression_NET8_0.snap => QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression.snap} (100%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression_NET7_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET6_0.snap => QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET9_0.snap} (73%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET6_0.snap => QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET9_0.snap} (77%) rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression_NET8_0.snap => QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression.snap} (100%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression_NET8_0.snap => QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression.snap} (100%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET8_0.snap => QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression.snap} (100%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET7_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET6_0.snap => QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET9_0.snap} (80%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET6_0.snap => QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET9_0.snap} (66%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression_NET6_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression_NET7_0.snap => QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression_NET9_0.snap} (87%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET6_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET7_0.snap => QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET9_0.snap} (79%) rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET8_0.snap => QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression.snap} (100%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET7_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET6_0.snap => QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET9_0.snap} (61%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET7_0.snap => QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET9_0.snap} (75%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET7_0.snap => QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET9_0.snap} (76%) rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorStringTests.Create_StringContains_Expression_NET8_0.snap => QueryableFilterVisitorStringTests.Create_StringContains_Expression.snap} (100%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET7_0.snap => QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET9_0.snap} (81%) rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorStringTests.Create_StringIn_Expression_NET8_0.snap => QueryableFilterVisitorStringTests.Create_StringIn_Expression.snap} (100%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression_NET7_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNoContains_Expression_NET6_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorStringTests.Create_StringNoContains_Expression_NET7_0.snap => QueryableFilterVisitorStringTests.Create_StringNoContains_Expression_NET9_0.snap} (89%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET6_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET7_0.snap => QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET9_0.snap} (81%) delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET6_0.snap => QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET9_0.snap} (79%) rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET6_0.snap => QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET9_0.snap} (74%) rename src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/{QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET6_0.snap => QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET9_0.snap} (75%) rename src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/{QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections.snap => QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_NET8_0.snap} (100%) create mode 100644 src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_NET9_0.snap rename src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/{QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_Nullable.snap => QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_Nullable_NET8_0.snap} (100%) create mode 100644 src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_Nullable_NET9_0.snap rename src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/{QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection.snap => QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_NET8_0.snap} (100%) create mode 100644 src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_NET9_0.snap rename src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/{QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_Nullable.snap => QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_Nullable_NET8_0.snap} (100%) create mode 100644 src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_Nullable_NET9_0.snap rename src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/{QueryableProjectionHashSetTests.Create_DeepFilterObjectTwoProjections.snap => QueryableProjectionHashSetTests.Create_DeepFilterObjectTwoProjections_NET8_0.snap} (100%) create mode 100644 src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_DeepFilterObjectTwoProjections_NET9_0.snap rename src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/{QueryableProjectionHashSetTests.Create_ListObjectDifferentLevelProjection.snap => QueryableProjectionHashSetTests.Create_ListObjectDifferentLevelProjection_NET8_0.snap} (100%) create mode 100644 src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_ListObjectDifferentLevelProjection_NET9_0.snap rename src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/{QueryableProjectionISetTests.Create_DeepFilterObjectTwoProjections.snap => QueryableProjectionISetTests.Create_DeepFilterObjectTwoProjections_NET8_0.snap} (100%) create mode 100644 src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_DeepFilterObjectTwoProjections_NET9_0.snap rename src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/{QueryableProjectionISetTests.Create_ListObjectDifferentLevelProjection.snap => QueryableProjectionISetTests.Create_ListObjectDifferentLevelProjection_NET8_0.snap} (100%) create mode 100644 src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_ListObjectDifferentLevelProjection_NET9_0.snap rename src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/{QueryableProjectionSortedSetTests.Create_DeepFilterObjectTwoProjections.snap => QueryableProjectionSortedSetTests.Create_DeepFilterObjectTwoProjections_NET8_0.snap} (100%) create mode 100644 src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_DeepFilterObjectTwoProjections_NET9_0.snap rename src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/{QueryableProjectionSortedSetTests.Create_ListObjectDifferentLevelProjection.snap => QueryableProjectionSortedSetTests.Create_ListObjectDifferentLevelProjection_NET8_0.snap} (100%) create mode 100644 src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_ListObjectDifferentLevelProjection_NET9_0.snap rename src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/{QueryableProjectionSortingTests.Create_DeepFilterObjectTwoProjections.snap => QueryableProjectionSortingTests.Create_DeepFilterObjectTwoProjections_NET8_0.snap} (100%) create mode 100644 src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_DeepFilterObjectTwoProjections_NET9_0.snap create mode 100644 src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_ListObjectDifferentLevelProjection_NET8_0.snap create mode 100644 src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_ListObjectDifferentLevelProjection_NET9_0.snap rename src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/__snapshots__/{QueryableSortVisitorExpressionTests.Create_StringConcatExpression_NET8_0.snap => QueryableSortVisitorExpressionTests.Create_StringConcatExpression.snap} (100%) delete mode 100644 src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/__snapshots__/QueryableSortVisitorExpressionTests.Create_StringConcatExpression_NET6_0.snap delete mode 100644 src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/__snapshots__/QueryableSortVisitorExpressionTests.Create_StringConcatExpression_NET7_0.snap rename src/HotChocolate/Data/test/Data.Tests/__snapshots__/{ExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault.snap => ExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET8_0.snap} (100%) create mode 100644 src/HotChocolate/Data/test/Data.Tests/__snapshots__/ExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET9_0.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Allow_document_to_be_captured__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result_deep__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field_and_op__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_3_field__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_4_field__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_operation_name_is_used_as_request_name__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_that_the_validation_activity_has_an_error_status__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_data_loader_events__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_data_loader_events_with_keys__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_events_of_a_simple_query_default__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_events_of_a_simple_query_detailed__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Get_SDL_download__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Get_SingleRequest_GetHeroName__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName_Default__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_query_to_http_activity__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_variables_to_http_activity__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_capture_deferred_response__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_ensure_list_path_is_correctly_built__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_parser_error__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_variables_are_not_automatically_added_to_activities__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_with_extensions_map__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Parsing_error_when_rename_root_is_activated__NET7.snap delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Validation_error_when_rename_root_is_activated__NET7.snap delete mode 100644 src/HotChocolate/Fusion/.vscode/settings.json delete mode 100644 src/HotChocolate/Fusion/.vscode/tasks.json delete mode 100644 src/HotChocolate/Language/.vscode/launch.json delete mode 100644 src/HotChocolate/Language/.vscode/tasks.json delete mode 100644 src/HotChocolate/MongoDb/.vscode/launch.json delete mode 100644 src/HotChocolate/MongoDb/.vscode/settings.json delete mode 100644 src/HotChocolate/MongoDb/.vscode/tasks.json delete mode 100644 src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_NET6.md delete mode 100644 src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_NET7.md delete mode 100644 src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_With_Projections_NET6.md delete mode 100644 src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_With_Projections_NET7.md delete mode 100644 src/HotChocolate/PersistedOperations/.vscode/tasks.json delete mode 100644 src/HotChocolate/Raven/test/Data.Raven.Filters.Tests/__snapshots__/ConventionTests.ListType_Should_NotContainAllOperation_NET6.snap delete mode 100644 src/HotChocolate/Spatial/.vscode/launch.json delete mode 100644 src/HotChocolate/Spatial/.vscode/tasks.json delete mode 100644 src/HotChocolate/Utilities/.vscode/tasks.json delete mode 100644 src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__snapshots__/IntrospectionClientTests.IntrospectServer_NET6.snap delete mode 100644 src/StrawberryShake/Client/.vscode/tasks.json delete mode 100644 src/StrawberryShake/CodeGeneration/.vscode/tasks.json delete mode 100644 src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/__snapshots__/NET6.snap delete mode 100644 src/StrawberryShake/Tooling/.vscode/launch.json delete mode 100644 src/StrawberryShake/Tooling/.vscode/tasks.json delete mode 100644 templates/v12/gateway-aspire/.vscode/tasks.json delete mode 100644 templates/v12/gateway-bcp/.vscode/tasks.json delete mode 100644 templates/v12/gateway/.vscode/tasks.json delete mode 100644 templates/v12/server/.vscode/tasks.json diff --git a/.build/.vscode/launch.json b/.build/.vscode/launch.json deleted file mode 100644 index 71dd21ed9ca..00000000000 --- a/.build/.vscode/launch.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - // Use IntelliSense to find out which attributes exist for C# debugging - // Use hover for the description of the existing attributes - // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md - "name": ".NET Core Launch (console)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/bin/Debug/net6.0/Build.dll", - "args": [], - "cwd": "${workspaceFolder}", - // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console - "console": "internalConsole", - "stopAtEntry": false - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach" - } - ] -} \ No newline at end of file diff --git a/.build/.vscode/settings.json b/.build/.vscode/settings.json deleted file mode 100644 index e2c353b2c40..00000000000 --- a/.build/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "dotnet.defaultSolution": ".build.sln" -} diff --git a/.build/.vscode/tasks.json b/.build/.vscode/tasks.json deleted file mode 100644 index 31c32bd3457..00000000000 --- a/.build/.vscode/tasks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "shell", - "args": [ - "build", - // Ask dotnet build to generate full paths for file names. - "/property:GenerateFullPaths=true", - // Do not generate summary otherwise it leads to duplicate errors in Problems panel - "/consoleloggerparameters:NoSummary" - ], - "group": "build", - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/.build/Build.Environment.cs b/.build/Build.Environment.cs index c029cca66cc..fe25239dd9f 100644 --- a/.build/Build.Environment.cs +++ b/.build/Build.Environment.cs @@ -6,7 +6,6 @@ partial class Build const string Release = "Release"; const string Net50 = "net5.0"; const string Net60 = "net6.0"; - const string Net70 = "net7.0"; readonly int DegreeOfParallelism = 2; diff --git a/.build/Build.csproj b/.build/Build.csproj index 8e7cc9e2f82..fc0931ecdcc 100644 --- a/.build/Build.csproj +++ b/.build/Build.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 CS0649;CS0169 .. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27c286aa55b..4b9f0e5c13e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -150,8 +150,8 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: | - 7.x 8.x + 9.x - name: Generate Test Matrix run: dotnet run --project ./.build -- GenerateMatrix @@ -180,13 +180,12 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: | - 6.x - 7.x 8.x + 9.x - name: Run Build id: run-build - run: dotnet build ${{ matrix.path }} --framework net8.0 --verbosity q + run: dotnet build ${{ matrix.path }} --framework net9.0 --verbosity q timeout-minutes: 5 - name: Run tests @@ -196,7 +195,7 @@ jobs: run: > dotnet test ${{ matrix.path }} --collect:"XPlat Code Coverage;Format=opencover" - --framework net8.0 + --framework net9.0 --logger trx --no-build -- @@ -243,9 +242,8 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: | - 6.x - 7.x 8.x + 9.x - name: Create All.sln if: ${{ !cancelled() }} diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 74a4d053a7d..9608d0618d0 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -29,8 +29,8 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: | - 7.x 8.x + 9.x - name: Generate Test Matrix run: dotnet run --project ./.build -- GenerateMatrix @@ -58,13 +58,12 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: | - 6.x - 7.x 8.x + 9.x - name: Run Build id: run-build - run: dotnet build ${{ matrix.path }} --framework net8.0 --verbosity q + run: dotnet build ${{ matrix.path }} --framework net9.0 --verbosity q timeout-minutes: 5 - name: Run tests @@ -74,7 +73,7 @@ jobs: run: > dotnet test ${{ matrix.path }} --collect:"XPlat Code Coverage;Format=opencover" - --framework net8.0 + --framework net9.0 --logger trx --no-build --verbosity q @@ -127,9 +126,8 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: | - 6.x - 7.x 8.x + 9.x - name: Create All.sln if: ${{ !cancelled() }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 262be868e6f..3b3e9785452 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,9 +18,8 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: | - 6.x - 7.x 8.x + 9.x - name: Get the version id: get_version diff --git a/global.json b/global.json index 17c0c8e40e1..6f6147294ba 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.101", + "version": "9.0.100-rc.1.24452.12", "rollForward": "latestMinor" } } diff --git a/src/CookieCrumble/src/CookieCrumble/CookieCrumble.csproj b/src/CookieCrumble/src/CookieCrumble/CookieCrumble.csproj index cab13a0302a..8aab1c4b070 100644 --- a/src/CookieCrumble/src/CookieCrumble/CookieCrumble.csproj +++ b/src/CookieCrumble/src/CookieCrumble/CookieCrumble.csproj @@ -1,7 +1,6 @@ - $(Library2TargetFrameworks) true CookieCrumble CookieCrumble @@ -19,9 +18,6 @@ - - - diff --git a/src/CookieCrumble/src/CookieCrumble/Formatters/QueryPlanSnapshotValueFormatter.cs b/src/CookieCrumble/src/CookieCrumble/Formatters/QueryPlanSnapshotValueFormatter.cs index 3a60736c256..3cc1714bc3b 100644 --- a/src/CookieCrumble/src/CookieCrumble/Formatters/QueryPlanSnapshotValueFormatter.cs +++ b/src/CookieCrumble/src/CookieCrumble/Formatters/QueryPlanSnapshotValueFormatter.cs @@ -1,4 +1,3 @@ -#if NET8_0_OR_GREATER using System.Buffers; using HotChocolate.Fusion.Execution.Nodes; @@ -9,4 +8,3 @@ internal sealed class QueryPlanSnapshotValueFormatter() : SnapshotValueFormatter protected override void Format(IBufferWriter snapshot, QueryPlan value) => value.Format(snapshot); } -#endif diff --git a/src/CookieCrumble/src/CookieCrumble/Snapshot.cs b/src/CookieCrumble/src/CookieCrumble/Snapshot.cs index e37868ac197..d0c311ae37b 100644 --- a/src/CookieCrumble/src/CookieCrumble/Snapshot.cs +++ b/src/CookieCrumble/src/CookieCrumble/Snapshot.cs @@ -31,9 +31,7 @@ public class Snapshot new HttpResponseSnapshotValueFormatter(), new OperationResultSnapshotValueFormatter(), new JsonElementSnapshotValueFormatter(), -#if NET8_0_OR_GREATER new QueryPlanSnapshotValueFormatter(), -#endif }); private static readonly JsonSnapshotValueFormatter _defaultFormatter = new(); diff --git a/src/CookieCrumble/src/CookieCrumble/TestEnvironment.cs b/src/CookieCrumble/src/CookieCrumble/TestEnvironment.cs index 48e211fb0d1..afef6c96007 100644 --- a/src/CookieCrumble/src/CookieCrumble/TestEnvironment.cs +++ b/src/CookieCrumble/src/CookieCrumble/TestEnvironment.cs @@ -7,21 +7,16 @@ namespace CookieCrumble; /// public static class TestEnvironment { -#if NET6_0 +#if NET8_0 /// /// The target framework identifier. /// - public const string TargetFramework = "NET6_0"; -#elif NET7_0 - /// - /// The target framework identifier. - /// - public const string TargetFramework = "NET7_0"; -#elif NET8_0 + public const string TargetFramework = "NET8_0"; +#elif NET9_0 /// /// The target framework identifier. /// - public const string TargetFramework = "NET8_0"; + public const string TargetFramework = "NET9_0"; #endif public static bool IsLocalEnvironment() diff --git a/src/CookieCrumble/test/CookieCrumble.Tests/CookieCrumble.Tests.csproj b/src/CookieCrumble/test/CookieCrumble.Tests/CookieCrumble.Tests.csproj index 14228ff109f..35df7614b65 100644 --- a/src/CookieCrumble/test/CookieCrumble.Tests/CookieCrumble.Tests.csproj +++ b/src/CookieCrumble/test/CookieCrumble.Tests/CookieCrumble.Tests.csproj @@ -1,8 +1,6 @@ - $(Library2TargetFrameworks) - false CookieCrumble.Tests diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 159157aea65..ea52cc49d4c 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -39,13 +39,8 @@ - net8.0; net7.0; net6.0; netstandard2.0 - net8.0; net7.0; net6.0 - net8.0; net7.0 - net8.0; net7.0; net6.0 - net8.0; net7.0; net6.0 - net7.0; net6.0 - net8.0; net7.0; net6.0 + net9.0; net8.0 + net9.0; net8.0; netstandard2.0 netstandard2.0 diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 79733f3ded1..cc97491cc21 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -12,7 +12,8 @@ - + + @@ -27,10 +28,9 @@ - - - - + + + @@ -66,6 +66,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -90,72 +114,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/src/GreenDonut/.vscode/tasks.json b/src/GreenDonut/.vscode/tasks.json deleted file mode 100644 index 31c32bd3457..00000000000 --- a/src/GreenDonut/.vscode/tasks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "shell", - "args": [ - "build", - // Ask dotnet build to generate full paths for file names. - "/property:GenerateFullPaths=true", - // Do not generate summary otherwise it leads to duplicate errors in Problems panel - "/consoleloggerparameters:NoSummary" - ], - "group": "build", - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/src/GreenDonut/src/Core/CreateDataLoaderBranch.cs b/src/GreenDonut/src/Core/CreateDataLoaderBranch.cs index 6dd69ed5177..940688de38c 100644 --- a/src/GreenDonut/src/Core/CreateDataLoaderBranch.cs +++ b/src/GreenDonut/src/Core/CreateDataLoaderBranch.cs @@ -1,4 +1,3 @@ -#if NET6_0_OR_GREATER namespace GreenDonut; /// @@ -18,4 +17,3 @@ public delegate IDataLoader CreateDataLoaderBranch( IDataLoader dataLoader, TState state) where TKey : notnull; -#endif diff --git a/src/GreenDonut/src/Core/DataLoaderBase.cs b/src/GreenDonut/src/Core/DataLoaderBase.cs index b71be64f5fe..0a83f5df253 100644 --- a/src/GreenDonut/src/Core/DataLoaderBase.cs +++ b/src/GreenDonut/src/Core/DataLoaderBase.cs @@ -30,10 +30,8 @@ public abstract partial class DataLoaderBase private readonly int _maxBatchSize; private readonly IDataLoaderDiagnosticEvents _diagnosticEvents; private readonly CancellationToken _ct; -#if NET6_0_OR_GREATER private ImmutableDictionary _branches = ImmutableDictionary.Empty; -#endif private Batch? _currentBatch; /// @@ -259,7 +257,6 @@ public void Set(TKey key, Task value) Cache.TryAdd(cacheKey, new Promise(value)); } } -#if NET6_0_OR_GREATER /// public IDataLoader Branch( @@ -298,7 +295,6 @@ public IDataLoader Branch( return branch; } -#endif private void BatchOperationFailed( Batch batch, diff --git a/src/GreenDonut/src/Core/DataLoaderFetchContext.cs b/src/GreenDonut/src/Core/DataLoaderFetchContext.cs index 4a4535ecaae..5c3d73cc71d 100644 --- a/src/GreenDonut/src/Core/DataLoaderFetchContext.cs +++ b/src/GreenDonut/src/Core/DataLoaderFetchContext.cs @@ -1,10 +1,6 @@ using System.Collections.Immutable; -#if NET8_0_OR_GREATER using System.Diagnostics.CodeAnalysis; -#endif -#if NET6_0_OR_GREATER using GreenDonut.Projections; -#endif namespace GreenDonut; @@ -137,7 +133,6 @@ public TState GetStateOrDefault(string key, TState defaultValue) return defaultValue; } -#if NET6_0_OR_GREATER /// /// Gets the selector builder from the DataLoader state snapshot. @@ -146,9 +141,7 @@ public TState GetStateOrDefault(string key, TState defaultValue) /// /// Returns the selector builder if it exists. /// -#if NET8_0_OR_GREATER [Experimental(Experiments.Projections)] -#endif public ISelectorBuilder GetSelector() { DefaultSelectorBuilder context; @@ -164,5 +157,4 @@ public ISelectorBuilder GetSelector() return context; } -#endif } diff --git a/src/GreenDonut/src/Core/DependencyInjection/DataLoaderServiceCollectionExtensions.cs b/src/GreenDonut/src/Core/DependencyInjection/DataLoaderServiceCollectionExtensions.cs index bc53c78574d..23962347cb8 100644 --- a/src/GreenDonut/src/Core/DependencyInjection/DataLoaderServiceCollectionExtensions.cs +++ b/src/GreenDonut/src/Core/DependencyInjection/DataLoaderServiceCollectionExtensions.cs @@ -1,7 +1,5 @@ using System.Collections.Concurrent; -#if NET8_0_OR_GREATER using System.Collections.Frozen; -#endif using GreenDonut; using GreenDonut.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; @@ -95,18 +93,10 @@ public static T GetDataLoader(this IServiceProvider services) where T : IData internal sealed class DataLoaderScopeFactory { -#if NET8_0_OR_GREATER private readonly FrozenDictionary _registrations; -#else - private readonly Dictionary _registrations; -#endif public DataLoaderScopeFactory(IEnumerable dataLoaderRegistrations) -#if NET8_0_OR_GREATER => _registrations = dataLoaderRegistrations.ToFrozenDictionary(t => t.ServiceType); -#else - => _registrations = dataLoaderRegistrations.ToDictionary(t => t.ServiceType); -#endif public IDataLoaderScope CreateScope(IServiceProvider scopedServiceProvider) => new DefaultDataLoaderScope(scopedServiceProvider, _registrations); @@ -114,11 +104,7 @@ public IDataLoaderScope CreateScope(IServiceProvider scopedServiceProvider) file sealed class DefaultDataLoaderScope( IServiceProvider serviceProvider, -#if NET8_0_OR_GREATER FrozenDictionary registrations) -#else - Dictionary registrations) -#endif : IDataLoaderScope { private readonly ConcurrentDictionary _dataLoaders = new(); diff --git a/src/GreenDonut/src/Core/GreenDonut.csproj b/src/GreenDonut/src/Core/GreenDonut.csproj index e3b8389ee65..22eb70618fb 100644 --- a/src/GreenDonut/src/Core/GreenDonut.csproj +++ b/src/GreenDonut/src/Core/GreenDonut.csproj @@ -16,11 +16,6 @@ - - - - - DataLoaderBase.cs diff --git a/src/GreenDonut/src/Core/IDataLoader.cs b/src/GreenDonut/src/Core/IDataLoader.cs index 4bf0ddc2343..58fb31b8b02 100644 --- a/src/GreenDonut/src/Core/IDataLoader.cs +++ b/src/GreenDonut/src/Core/IDataLoader.cs @@ -1,7 +1,4 @@ using System.Collections.Immutable; -#if NET8_0_OR_GREATER -using GreenDonut.Projections; -#endif namespace GreenDonut; @@ -165,7 +162,6 @@ public interface IDataLoader /// void Set(TKey key, Task value); -#if NET6_0_OR_GREATER /// /// Branches the current DataLoader. /// @@ -185,5 +181,4 @@ IDataLoader Branch( string key, CreateDataLoaderBranch createBranch, TState state); -#endif } diff --git a/src/GreenDonut/src/Core/Projections/DefaultSelectorBuilder.cs b/src/GreenDonut/src/Core/Projections/DefaultSelectorBuilder.cs index ca30af4313c..c8f75df0418 100644 --- a/src/GreenDonut/src/Core/Projections/DefaultSelectorBuilder.cs +++ b/src/GreenDonut/src/Core/Projections/DefaultSelectorBuilder.cs @@ -1,12 +1,9 @@ -#if NET6_0_OR_GREATER using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; namespace GreenDonut.Projections; -#if NET8_0_OR_GREATER [Experimental(Experiments.Projections)] -#endif internal sealed class DefaultSelectorBuilder : ISelectorBuilder { private LambdaExpression? _expression; @@ -47,4 +44,3 @@ public void Add(Expression> selector) return (Expression>)_expression; } } -#endif diff --git a/src/GreenDonut/src/Core/Projections/ExpressionHelpers.cs b/src/GreenDonut/src/Core/Projections/ExpressionHelpers.cs index 5b9640ee071..42ad230b94a 100644 --- a/src/GreenDonut/src/Core/Projections/ExpressionHelpers.cs +++ b/src/GreenDonut/src/Core/Projections/ExpressionHelpers.cs @@ -1,4 +1,3 @@ -#if NET6_0_OR_GREATER using System.Linq.Expressions; using System.Reflection; @@ -102,4 +101,3 @@ protected override Expression VisitParameter(ParameterExpression node) => node == toReplace ? replacement : base.VisitParameter(node); } } -#endif diff --git a/src/GreenDonut/src/Core/Projections/ISelectionDataLoader.cs b/src/GreenDonut/src/Core/Projections/ISelectionDataLoader.cs index 04c34f05945..2b7590eb41f 100644 --- a/src/GreenDonut/src/Core/Projections/ISelectionDataLoader.cs +++ b/src/GreenDonut/src/Core/Projections/ISelectionDataLoader.cs @@ -1,5 +1,3 @@ -#if NET6_0_OR_GREATER - namespace GreenDonut.Projections; /// @@ -25,4 +23,3 @@ public interface ISelectionDataLoader /// IDataLoader Root { get; } } -#endif diff --git a/src/GreenDonut/src/Core/Projections/ISelectorBuilder.cs b/src/GreenDonut/src/Core/Projections/ISelectorBuilder.cs index 0733a3ebd0e..bba414da43f 100644 --- a/src/GreenDonut/src/Core/Projections/ISelectorBuilder.cs +++ b/src/GreenDonut/src/Core/Projections/ISelectorBuilder.cs @@ -1,4 +1,3 @@ -#if NET6_0_OR_GREATER using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; @@ -9,9 +8,7 @@ namespace GreenDonut.Projections; /// by adding expressions that will be merged into a /// single selector expression. /// -#if NET8_0_OR_GREATER [Experimental(Experiments.Projections)] -#endif public interface ISelectorBuilder { /// @@ -41,4 +38,3 @@ public interface ISelectorBuilder /// Expression>? TryCompile(); } -#endif diff --git a/src/GreenDonut/src/Core/Projections/SelectionDataLoader.cs b/src/GreenDonut/src/Core/Projections/SelectionDataLoader.cs index 67271f86479..92d8b02ef1a 100644 --- a/src/GreenDonut/src/Core/Projections/SelectionDataLoader.cs +++ b/src/GreenDonut/src/Core/Projections/SelectionDataLoader.cs @@ -1,4 +1,3 @@ -#if NET6_0_OR_GREATER namespace GreenDonut.Projections; internal sealed class SelectionDataLoader @@ -32,4 +31,3 @@ protected internal override ValueTask FetchAsync( CancellationToken cancellationToken) => _root.FetchAsync(keys, results, context, cancellationToken); } -#endif diff --git a/src/GreenDonut/src/Core/Projections/SelectionDataLoaderExtensions.cs b/src/GreenDonut/src/Core/Projections/SelectionDataLoaderExtensions.cs index fbea2470039..abd0d96a5c9 100644 --- a/src/GreenDonut/src/Core/Projections/SelectionDataLoaderExtensions.cs +++ b/src/GreenDonut/src/Core/Projections/SelectionDataLoaderExtensions.cs @@ -1,4 +1,3 @@ -#if NET6_0_OR_GREATER using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Reflection; @@ -9,9 +8,7 @@ namespace GreenDonut.Projections; /// /// Data loader extensions for projections. /// -#if NET8_0_OR_GREATER [Experimental(Experiments.Projections)] -#endif public static class SelectionDataLoaderExtensions { /// @@ -262,4 +259,3 @@ public static IQueryable Select( return query; } } -#endif diff --git a/src/GreenDonut/src/Core/Promise.cs b/src/GreenDonut/src/Core/Promise.cs index 7996c3dd5d0..c93e8a2464e 100644 --- a/src/GreenDonut/src/Core/Promise.cs +++ b/src/GreenDonut/src/Core/Promise.cs @@ -122,11 +122,7 @@ public void OnComplete( Task.ContinueWith( (task, s) => { -#if NETSTANDARD2_0 - if(task.Status == TaskStatus.RanToCompletion -#else if (task.IsCompletedSuccessfully -#endif && task.Result is not null) { callback(new Promise(task.Result), (TState)s!); diff --git a/src/GreenDonut/src/Core/PromiseCache.cs b/src/GreenDonut/src/Core/PromiseCache.cs index a7f84c82ba7..9ea1a22ca10 100644 --- a/src/GreenDonut/src/Core/PromiseCache.cs +++ b/src/GreenDonut/src/Core/PromiseCache.cs @@ -245,11 +245,7 @@ public IDisposable Subscribe( while (current is not null) { -#if NETSTANDARD2_0 - if(current.Value.Task.Status == TaskStatus.RanToCompletion -#else if (current.Value.Task.IsCompletedSuccessfully -#endif && !current.Value.IsClone && current.Value.Type == type) { @@ -429,11 +425,7 @@ private sealed class Subscription( { public void OnNext(PromiseCacheKey key, Promise promise) { -#if NETSTANDARD2_0 - if(promise.Task.Status == TaskStatus.RanToCompletion -#else if (promise.Task.IsCompletedSuccessfully -#endif && skipCacheKeyType?.Equals(key.Type, StringComparison.Ordinal) != true) { next(owner, promise); @@ -442,11 +434,7 @@ public void OnNext(PromiseCacheKey key, Promise promise) public void OnNext(Promise promise) { -#if NETSTANDARD2_0 - if(promise.Task.Status == TaskStatus.RanToCompletion) -#else if (promise.Task.IsCompletedSuccessfully) -#endif { next(owner, promise); } diff --git a/src/GreenDonut/src/Core/PromiseCacheKey.cs b/src/GreenDonut/src/Core/PromiseCacheKey.cs index db34d070d6b..202c7e55d50 100644 --- a/src/GreenDonut/src/Core/PromiseCacheKey.cs +++ b/src/GreenDonut/src/Core/PromiseCacheKey.cs @@ -1,62 +1,6 @@ -#if NET7_0_OR_GREATER namespace GreenDonut; /// /// The key of a cached task. /// public readonly record struct PromiseCacheKey(string Type, object Key); -#else -namespace GreenDonut; - -/// -/// The key of a cached task. -/// -public readonly struct PromiseCacheKey : IEquatable -{ - /// - /// Creates a new instance of . - /// - /// - /// The key type. - /// - /// - /// The entity key. - /// - /// - /// or is null. - /// - public PromiseCacheKey(string type, object key) - { - Type = type ?? throw new ArgumentNullException(nameof(type)); - Key = key ?? throw new ArgumentNullException(nameof(key)); - } - - /// - /// Gets the key type. - /// - public string Type { get; } - - /// - /// Gets the entity key. - /// - public object Key { get; } - - /// - public bool Equals(PromiseCacheKey other) - => Type.Equals(other.Type, StringComparison.Ordinal) && - Key.Equals(other.Key); - - /// - public override bool Equals(object? obj) - => obj is PromiseCacheKey other && Equals(other); - - /// - public override int GetHashCode() - { - unchecked - { - return (Type.GetHashCode() * 397) ^ Key.GetHashCode(); - } - } -} -#endif diff --git a/src/GreenDonut/src/Directory.Build.props b/src/GreenDonut/src/Directory.Build.props index 0d3215407d9..b56da5ac7dc 100644 --- a/src/GreenDonut/src/Directory.Build.props +++ b/src/GreenDonut/src/Directory.Build.props @@ -2,8 +2,4 @@ - - $(LibraryTargetFrameworks) - - diff --git a/src/GreenDonut/test/Directory.Build.props b/src/GreenDonut/test/Directory.Build.props index bf08b9aec9f..9e84a3a2242 100644 --- a/src/GreenDonut/test/Directory.Build.props +++ b/src/GreenDonut/test/Directory.Build.props @@ -2,7 +2,6 @@ - $(TestTargetFrameworks) false false diff --git a/src/HotChocolate/ApolloFederation/.vscode/tasks.json b/src/HotChocolate/ApolloFederation/.vscode/tasks.json deleted file mode 100644 index 31c32bd3457..00000000000 --- a/src/HotChocolate/ApolloFederation/.vscode/tasks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "shell", - "args": [ - "build", - // Ask dotnet build to generate full paths for file names. - "/property:GenerateFullPaths=true", - // Do not generate summary otherwise it leads to duplicate errors in Problems panel - "/consoleloggerparameters:NoSummary" - ], - "group": "build", - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/src/HotChocolate/ApolloFederation/Directory.Build.props b/src/HotChocolate/ApolloFederation/Directory.Build.props index 80a3d6a18cc..106b12775b2 100644 --- a/src/HotChocolate/ApolloFederation/Directory.Build.props +++ b/src/HotChocolate/ApolloFederation/Directory.Build.props @@ -1,7 +1,3 @@ - - - $(Library3TargetFrameworks) - diff --git a/src/HotChocolate/AspNetCore/.vscode/launch.json b/src/HotChocolate/AspNetCore/.vscode/launch.json deleted file mode 100644 index 3879a44c9be..00000000000 --- a/src/HotChocolate/AspNetCore/.vscode/launch.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": ".NET Core Launch (web)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - "program": "${workspaceFolder}/sample/StarWars/bin/Debug/net5.0/StarWars.dll", - "args": [], - "cwd": "${workspaceFolder}/sample/StarWars", - "stopAtEntry": false, - "env": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "sourceFileMap": { - "/Views": "${workspaceFolder}/Views" - } - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach", - "processId": "${command:pickProcess}" - } - ] -} diff --git a/src/HotChocolate/AspNetCore/.vscode/settings.json b/src/HotChocolate/AspNetCore/.vscode/settings.json deleted file mode 100644 index 600375200ac..00000000000 --- a/src/HotChocolate/AspNetCore/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "dotnet.defaultSolution": "HotChocolate.AspNetCore.sln" -} diff --git a/src/HotChocolate/AspNetCore/.vscode/tasks.json b/src/HotChocolate/AspNetCore/.vscode/tasks.json deleted file mode 100644 index 31c32bd3457..00000000000 --- a/src/HotChocolate/AspNetCore/.vscode/tasks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "shell", - "args": [ - "build", - // Ask dotnet build to generate full paths for file names. - "/property:GenerateFullPaths=true", - // Do not generate summary otherwise it leads to duplicate errors in Problems panel - "/consoleloggerparameters:NoSummary" - ], - "group": "build", - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/src/HotChocolate/AspNetCore/Directory.Build.props b/src/HotChocolate/AspNetCore/Directory.Build.props index b6c5f35c647..ea6e2bc3aaf 100644 --- a/src/HotChocolate/AspNetCore/Directory.Build.props +++ b/src/HotChocolate/AspNetCore/Directory.Build.props @@ -1,8 +1,4 @@ - - $(AspNetTargetFrameworks) - - diff --git a/src/HotChocolate/AspNetCore/src/AspNetCore.Authorization.Opa/OpaService.cs b/src/HotChocolate/AspNetCore/src/AspNetCore.Authorization.Opa/OpaService.cs index 388a7b56d60..578763b186d 100644 --- a/src/HotChocolate/AspNetCore/src/AspNetCore.Authorization.Opa/OpaService.cs +++ b/src/HotChocolate/AspNetCore/src/AspNetCore.Authorization.Opa/OpaService.cs @@ -1,8 +1,4 @@ -#if NET6_0_OR_GREATER using System.Net.Http.Json; -#else -using System.Text; -#endif using System.Text.Json; using Microsoft.Extensions.Options; @@ -10,9 +6,6 @@ namespace HotChocolate.AspNetCore.Authorization; internal sealed class OpaService : IOpaService { -#if NETSTANDARD2_0 - private static readonly Encoding _utf8 = Encoding.UTF8; -#endif private readonly HttpClient _client; private readonly OpaOptions _options; @@ -42,20 +35,11 @@ public async Task QueryAsync( throw new ArgumentNullException(nameof(request)); } -#if NET6_0_OR_GREATER using var body = JsonContent.Create(request, options: _options.JsonSerializerOptions); -#else - var json = JsonSerializer.Serialize(request, _options.JsonSerializerOptions); - using var body = new StringContent(json, _utf8, "application/json"); -#endif using var response = await _client.PostAsync(policyPath, body, ct).ConfigureAwait(false); response.EnsureSuccessStatusCode(); -#if NET6_0_OR_GREATER await using var stream = await response.Content.ReadAsStreamAsync(ct).ConfigureAwait(false); -#else - using var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false); -#endif var document = await JsonDocument.ParseAsync(stream, default, ct); return new OpaQueryResponse(document); } diff --git a/src/HotChocolate/AspNetCore/src/AspNetCore.Authorization.Opa/Request/DefaultQueryRequestFactory.cs b/src/HotChocolate/AspNetCore/src/AspNetCore.Authorization.Opa/Request/DefaultQueryRequestFactory.cs index 9466e511851..77e6b349659 100644 --- a/src/HotChocolate/AspNetCore/src/AspNetCore.Authorization.Opa/Request/DefaultQueryRequestFactory.cs +++ b/src/HotChocolate/AspNetCore/src/AspNetCore.Authorization.Opa/Request/DefaultQueryRequestFactory.cs @@ -26,7 +26,7 @@ public OpaQueryRequest CreateRequest(AuthorizationContext context, AuthorizeDire var originalRequest = new OriginalRequest( httpContext.Request.Headers, - httpContext.Request.Host.Value, + httpContext.Request.Host.Value ?? string.Empty, httpContext.Request.Method, httpContext.Request.Path.Value!, httpContext.Request.Query, diff --git a/src/HotChocolate/AspNetCore/src/AspNetCore/Extensions/EndpointRouteBuilderExtensions.cs b/src/HotChocolate/AspNetCore/src/AspNetCore/Extensions/EndpointRouteBuilderExtensions.cs index 2293321f723..c65c6330faf 100644 --- a/src/HotChocolate/AspNetCore/src/AspNetCore/Extensions/EndpointRouteBuilderExtensions.cs +++ b/src/HotChocolate/AspNetCore/src/AspNetCore/Extensions/EndpointRouteBuilderExtensions.cs @@ -444,7 +444,6 @@ public static BananaCakePopEndpointConventionBuilder MapBananaCakePop( return new BananaCakePopEndpointConventionBuilder(builder); } -#if NET8_0_OR_GREATER /// /// Adds a persisted operation endpoint to the endpoint configurations. /// @@ -500,7 +499,6 @@ public static IEndpointConventionBuilder MapGraphQLPersistedOperations( group.MapPersistedOperationMiddleware(schemaNameOrDefault, requireOperationName); return group; } -#endif /// /// Specifies the GraphQL server options. diff --git a/src/HotChocolate/AspNetCore/src/AspNetCore/Extensions/HotChocolateAspNetCoreHostingBuilderExtensions.cs b/src/HotChocolate/AspNetCore/src/AspNetCore/Extensions/HotChocolateAspNetCoreHostingBuilderExtensions.cs index c7334698d5d..6cce725e6f6 100644 --- a/src/HotChocolate/AspNetCore/src/AspNetCore/Extensions/HotChocolateAspNetCoreHostingBuilderExtensions.cs +++ b/src/HotChocolate/AspNetCore/src/AspNetCore/Extensions/HotChocolateAspNetCoreHostingBuilderExtensions.cs @@ -1,4 +1,3 @@ -#if NET8_0_OR_GREATER using HotChocolate.Execution.Configuration; using Microsoft.Extensions.DependencyInjection; using static HotChocolate.AspNetCore.ServerDefaults; @@ -33,4 +32,3 @@ public static IRequestExecutorBuilder AddGraphQL( bool disableCostAnalyzer = false) => builder.Services.AddGraphQLServer(schemaName, maxAllowedRequestSize, disableCostAnalyzer); } -#endif diff --git a/src/HotChocolate/AspNetCore/src/AspNetCore/Extensions/HotChocolateAspNetCoreServiceCollectionExtensions.cs b/src/HotChocolate/AspNetCore/src/AspNetCore/Extensions/HotChocolateAspNetCoreServiceCollectionExtensions.cs index 0bcd6c26278..110eb35b5bd 100644 --- a/src/HotChocolate/AspNetCore/src/AspNetCore/Extensions/HotChocolateAspNetCoreServiceCollectionExtensions.cs +++ b/src/HotChocolate/AspNetCore/src/AspNetCore/Extensions/HotChocolateAspNetCoreServiceCollectionExtensions.cs @@ -81,7 +81,7 @@ public static IServiceCollection AddGraphQLServerCore( return services; } -#if NET7_0_OR_GREATER + /// /// Adds a GraphQL server configuration to the DI. /// @@ -146,49 +146,7 @@ public static IRequestExecutorBuilder AddGraphQLServer( string? schemaName = default, bool disableCostAnalyzer = false) => builder.Services.AddGraphQLServer(schemaName, disableCostAnalyzer: disableCostAnalyzer); -#else -/// - /// Adds a GraphQL server configuration to the DI. - /// - /// - /// The . - /// - /// - /// The name of the schema. Use explicit schema names if you host multiple schemas. - /// - /// - /// The max allowed GraphQL request size. - /// - /// - /// Returns the so that configuration can be chained. - /// - public static IRequestExecutorBuilder AddGraphQLServer( - this IServiceCollection services, - string? schemaName = default, - int maxAllowedRequestSize = MaxAllowedRequestSize) - => services - .AddGraphQLServerCore(maxAllowedRequestSize) - .AddGraphQL(schemaName) - .AddDefaultHttpRequestInterceptor() - .AddSubscriptionServices(); - /// - /// Adds a GraphQL server configuration to the DI. - /// - /// - /// The . - /// - /// - /// The name of the schema. Use explicit schema names if you host multiple schemas. - /// - /// - /// Returns the so that configuration can be chained. - /// - public static IRequestExecutorBuilder AddGraphQLServer( - this IRequestExecutorBuilder builder, - string? schemaName = default) - => builder.Services.AddGraphQLServer(schemaName); -#endif /// /// Registers the GraphQL Upload Scalar. /// diff --git a/src/HotChocolate/AspNetCore/src/AspNetCore/PersistedOperationMiddleware.cs b/src/HotChocolate/AspNetCore/src/AspNetCore/PersistedOperationMiddleware.cs index 8fdfa6db543..e7961761835 100644 --- a/src/HotChocolate/AspNetCore/src/AspNetCore/PersistedOperationMiddleware.cs +++ b/src/HotChocolate/AspNetCore/src/AspNetCore/PersistedOperationMiddleware.cs @@ -1,4 +1,3 @@ -#if NET8_0_OR_GREATER using System.Net; using HotChocolate.AspNetCore.Instrumentation; using HotChocolate.AspNetCore.Serialization; @@ -251,4 +250,3 @@ public GraphQLServerOptions GetOptions(HttpContext context) } } } -#endif diff --git a/src/HotChocolate/AspNetCore/src/AspNetCore/Serialization/DefaultHttpResponseFormatter.cs b/src/HotChocolate/AspNetCore/src/AspNetCore/Serialization/DefaultHttpResponseFormatter.cs index 0b78420b475..3c5f9cb9fa0 100644 --- a/src/HotChocolate/AspNetCore/src/AspNetCore/Serialization/DefaultHttpResponseFormatter.cs +++ b/src/HotChocolate/AspNetCore/src/AspNetCore/Serialization/DefaultHttpResponseFormatter.cs @@ -9,9 +9,6 @@ using HotChocolate.Utilities; using Microsoft.AspNetCore.Http; using Microsoft.Net.Http.Headers; -#if !NET6_0_OR_GREATER -using Microsoft.Net.Http.Headers; -#endif using static HotChocolate.AspNetCore.AcceptMediaTypeKind; using static HotChocolate.Execution.ExecutionResultKind; using static HotChocolate.WellKnownContextData; diff --git a/src/HotChocolate/AspNetCore/src/Transport.Abstractions/HotChocolate.Transport.Abstractions.csproj b/src/HotChocolate/AspNetCore/src/Transport.Abstractions/HotChocolate.Transport.Abstractions.csproj index ff78a57d0bf..9fb80718801 100644 --- a/src/HotChocolate/AspNetCore/src/Transport.Abstractions/HotChocolate.Transport.Abstractions.csproj +++ b/src/HotChocolate/AspNetCore/src/Transport.Abstractions/HotChocolate.Transport.Abstractions.csproj @@ -1,9 +1,5 @@ - - $(LibraryTargetFrameworks) - - HotChocolate.Transport.Abstractions HotChocolate.Transport.Abstractions @@ -21,11 +17,6 @@ - - - - - ResXFileCodeGenerator diff --git a/src/HotChocolate/AspNetCore/src/Transport.Abstractions/Serialization/JsonOptionDefaults.cs b/src/HotChocolate/AspNetCore/src/Transport.Abstractions/Serialization/JsonOptionDefaults.cs index b8fa6f2dcf5..d54b79c6aba 100644 --- a/src/HotChocolate/AspNetCore/src/Transport.Abstractions/Serialization/JsonOptionDefaults.cs +++ b/src/HotChocolate/AspNetCore/src/Transport.Abstractions/Serialization/JsonOptionDefaults.cs @@ -16,17 +16,6 @@ internal static class JsonOptionDefaults /// /// Gets the default . /// -#if NET6_0_OR_GREATER public static JsonSerializerOptions SerializerOptions { get; } = new(JsonSerializerDefaults.Web); -#else - public static JsonSerializerOptions SerializerOptions { get; } = - new() - { - PropertyNameCaseInsensitive = true, PropertyNamingPolicy = JsonNamingPolicy.CamelCase, -#if NET6_0_OR_GREATER - NumberHandling = JsonNumberHandling.AllowReadingFromString -#endif - }; -#endif } diff --git a/src/HotChocolate/AspNetCore/src/Transport.Http/DefaultGraphQLHttpClient.cs b/src/HotChocolate/AspNetCore/src/Transport.Http/DefaultGraphQLHttpClient.cs index 9d4f21d4b8d..7ff5c4121b2 100644 --- a/src/HotChocolate/AspNetCore/src/Transport.Http/DefaultGraphQLHttpClient.cs +++ b/src/HotChocolate/AspNetCore/src/Transport.Http/DefaultGraphQLHttpClient.cs @@ -98,10 +98,8 @@ private async Task ExecuteInternalAsync( // DO NOT move the writer out of this method. using var arrayWriter = new ArrayWriter(); using var requestMessage = CreateRequestMessage(arrayWriter, request, requestUri); -#if NET5_0_OR_GREATER requestMessage.Version = _http.DefaultRequestVersion; requestMessage.VersionPolicy = _http.DefaultVersionPolicy; -#endif var responseMessage = await _http .SendAsync(requestMessage, ResponseHeadersRead, ct) .ConfigureAwait(false); @@ -181,11 +179,7 @@ private static HttpContent CreatePostContent( jsonWriter.Flush(); var content = new ByteArrayContent(arrayWriter.GetInternalBuffer(), 0, arrayWriter.Length); -#if NET7_0_OR_GREATER content.Headers.ContentType = new MediaTypeHeaderValue(ContentType.Json, "utf-8"); -#else - content.Headers.ContentType = new MediaTypeHeaderValue(ContentType.Json) { CharSet = "utf-8", }; -#endif return content; } @@ -208,21 +202,11 @@ private static HttpContent CreateMultipartContent( var form = new MultipartFormDataContent(); var operation = new ByteArrayContent(buffer, start, arrayWriter.Length - start); -#if NET7_0_OR_GREATER operation.Headers.ContentType = new MediaTypeHeaderValue(ContentType.Json, "utf-8"); -#else - operation.Headers.ContentType = - new MediaTypeHeaderValue(ContentType.Json) { CharSet = "utf-8", }; -#endif form.Add(operation, "operations"); var fileMap = new ByteArrayContent(buffer, 0, start); -#if NET7_0_OR_GREATER fileMap.Headers.ContentType = new MediaTypeHeaderValue(ContentType.Json, "utf-8"); -#else - fileMap.Headers.ContentType = - new MediaTypeHeaderValue(ContentType.Json) { CharSet = "utf-8", }; -#endif form.Add(fileMap, "map"); foreach (var fileInfo in fileInfos) @@ -331,11 +315,7 @@ private static string FormatDocumentAsJson(ArrayWriter arrayWriter, ObjectValueN Utf8JsonWriterHelper.WriteFieldValue(jsonWriter, obj); jsonWriter.Flush(); -#if NET6_0_OR_GREATER return Encoding.UTF8.GetString(arrayWriter.GetWrittenSpan()); -#else - return Encoding.UTF8.GetString(arrayWriter.GetInternalBuffer(), 0, arrayWriter.Length); -#endif } protected override void Dispose(bool disposing) diff --git a/src/HotChocolate/AspNetCore/src/Transport.Http/GraphQLHttpEventStreamProcessor.cs b/src/HotChocolate/AspNetCore/src/Transport.Http/GraphQLHttpEventStreamProcessor.cs index cc0f15fd231..a2a5dde5deb 100644 --- a/src/HotChocolate/AspNetCore/src/Transport.Http/GraphQLHttpEventStreamProcessor.cs +++ b/src/HotChocolate/AspNetCore/src/Transport.Http/GraphQLHttpEventStreamProcessor.cs @@ -27,46 +27,27 @@ private static async Task ReadFromTransportAsync(Stream stream, PipeWriter write { const int bufferSize = 64; var buffer = new byte[bufferSize]; -#if NET6_0_OR_GREATER var bufferMemory = new Memory(buffer); -#endif -#if NET6_0_OR_GREATER await using var tokenRegistration = ct.Register( static writer => ((PipeWriter)writer!).CancelPendingFlush(), state: writer, useSynchronizationContext: false); -#else - using var tokenRegistration = ct.Register( - static writer => ((PipeWriter)writer!).CancelPendingFlush(), - state: writer, - useSynchronizationContext: false); -#endif while (true) { try { -#if NET6_0_OR_GREATER var bytesRead = await stream.ReadAsync(bufferMemory, ct).ConfigureAwait(false); -#else - var bytesRead = await stream.ReadAsync(buffer, 0, bufferSize, ct).ConfigureAwait(false); -#endif if (bytesRead == 0) { break; } -#if NET6_0_OR_GREATER var memory = writer.GetMemory(bytesRead); buffer.AsSpan()[..bytesRead].CopyTo(memory.Span); writer.Advance(bytesRead); -#else - var memory = writer.GetMemory(bytesRead); - buffer.AsSpan().Slice(0, bytesRead).CopyTo(memory.Span); - writer.Advance(bytesRead); -#endif } catch { @@ -90,17 +71,10 @@ private static async IAsyncEnumerable ReadMessagesPipeAsync( { using var message = new ArrayWriter(); -#if NET6_0_OR_GREATER await using var tokenRegistration = ct.Register( static reader => ((PipeReader)reader!).CancelPendingRead(), state: reader, useSynchronizationContext: false); -#else - using var tokenRegistration = ct.Register( - static reader => ((PipeReader)reader!).CancelPendingRead(), - state: reader, - useSynchronizationContext: false); -#endif while (true) { diff --git a/src/HotChocolate/AspNetCore/src/Transport.Http/GraphQLHttpResponse.cs b/src/HotChocolate/AspNetCore/src/Transport.Http/GraphQLHttpResponse.cs index 2826a2f6df5..0b357cb3171 100644 --- a/src/HotChocolate/AspNetCore/src/Transport.Http/GraphQLHttpResponse.cs +++ b/src/HotChocolate/AspNetCore/src/Transport.Http/GraphQLHttpResponse.cs @@ -1,12 +1,8 @@ using System.Net; -#if NET6_0_OR_GREATER using System.Diagnostics; -#endif using System.Net.Http.Headers; using System.Runtime.CompilerServices; -#if NET6_0_OR_GREATER using System.Text; -#endif using System.Text.Json; using HotChocolate.Utilities; @@ -19,9 +15,7 @@ public sealed class GraphQLHttpResponse : IDisposable { private static readonly OperationResult _transportError = CreateTransportError(); -#if NET6_0_OR_GREATER private static readonly Encoding _utf8 = Encoding.UTF8; -#endif private readonly HttpResponseMessage _message; /// @@ -84,7 +78,6 @@ public GraphQLHttpResponse(HttpResponseMessage message) /// public HttpContentHeaders ContentHeaders => _message.Content.Headers; - #if NET6_0_OR_GREATER /// /// Gets the collection of trailing headers included in an HTTP response. /// @@ -95,7 +88,6 @@ public GraphQLHttpResponse(HttpResponseMessage message) /// The collection of trailing headers in the HTTP response. /// public HttpResponseHeaders TrailingHeaders => _message.TrailingHeaders; - #endif /// /// Reads the GraphQL response as a . @@ -115,11 +107,7 @@ public ValueTask ReadAsResultAsync(CancellationToken cancellati // to use status codes. if (contentType?.MediaType.EqualsOrdinal(ContentType.GraphQL) ?? false) { -#if NET6_0_OR_GREATER return ReadAsResultInternalAsync(contentType.CharSet, cancellationToken); -#else - return ReadAsResultInternalAsync(cancellationToken); -#endif } // The server supports the older application/json media type and the status code @@ -127,11 +115,7 @@ public ValueTask ReadAsResultAsync(CancellationToken cancellati if (contentType?.MediaType.EqualsOrdinal(ContentType.Json) ?? false) { _message.EnsureSuccessStatusCode(); -#if NET6_0_OR_GREATER return ReadAsResultInternalAsync(contentType.CharSet, cancellationToken); -#else - return ReadAsResultInternalAsync(cancellationToken); -#endif } _message.EnsureSuccessStatusCode(); @@ -139,28 +123,18 @@ public ValueTask ReadAsResultAsync(CancellationToken cancellati throw new InvalidOperationException("Received a successful response with an unexpected content type."); } -#if NET6_0_OR_GREATER private async ValueTask ReadAsResultInternalAsync(string? charSet, CancellationToken ct) -#else - private async ValueTask ReadAsResultInternalAsync(CancellationToken ct) -#endif { -#if NET6_0_OR_GREATER await using var contentStream = await _message.Content.ReadAsStreamAsync(ct) .ConfigureAwait(false); -#else - using var contentStream = await _message.Content.ReadAsStreamAsync().ConfigureAwait(false); -#endif var stream = contentStream; -#if NET6_0_OR_GREATER var sourceEncoding = GetEncoding(charSet); if (sourceEncoding is not null && !Equals(sourceEncoding.EncodingName, _utf8.EncodingName)) { stream = GetTranscodingStream(contentStream, sourceEncoding); } -#endif var document = await JsonDocument.ParseAsync(stream, cancellationToken: ct); @@ -192,22 +166,14 @@ public IAsyncEnumerable ReadAsResultStreamAsync(CancellationTok if (contentType?.MediaType.EqualsOrdinal(ContentType.EventStream) ?? false) { -#if NET6_0_OR_GREATER return ReadAsResultStreamInternalAsync(contentType.CharSet, cancellationToken); -#else - return ReadAsResultStreamInternalAsync(cancellationToken); -#endif } // The server supports the newer graphql-response+json media type and users are free // to use status codes. if (contentType?.MediaType.EqualsOrdinal(ContentType.GraphQL) ?? false) { -#if NET6_0_OR_GREATER return SingleResult(ReadAsResultInternalAsync(contentType.CharSet, cancellationToken)); -#else - return SingleResult(ReadAsResultInternalAsync(cancellationToken)); -#endif } // The server supports the older application/json media type and the status code @@ -215,41 +181,26 @@ public IAsyncEnumerable ReadAsResultStreamAsync(CancellationTok if (contentType?.MediaType.EqualsOrdinal(ContentType.Json) ?? false) { _message.EnsureSuccessStatusCode(); -#if NET6_0_OR_GREATER return SingleResult(ReadAsResultInternalAsync(contentType.CharSet, cancellationToken)); -#else - return SingleResult(ReadAsResultInternalAsync(cancellationToken)); -#endif } return SingleResult(new ValueTask(_transportError)); } -#if NET6_0_OR_GREATER private async IAsyncEnumerable ReadAsResultStreamInternalAsync( string? charSet, [EnumeratorCancellation] CancellationToken ct) -#else - private async IAsyncEnumerable ReadAsResultStreamInternalAsync( - [EnumeratorCancellation] CancellationToken ct) -#endif { -#if NET6_0_OR_GREATER await using var contentStream = await _message.Content.ReadAsStreamAsync(ct) .ConfigureAwait(false); -#else - using var contentStream = await _message.Content.ReadAsStreamAsync().ConfigureAwait(false); -#endif var stream = contentStream; -#if NET6_0_OR_GREATER var sourceEncoding = GetEncoding(charSet); if (sourceEncoding is not null && !Equals(sourceEncoding.EncodingName, _utf8.EncodingName)) { stream = GetTranscodingStream(contentStream, sourceEncoding); } -#endif await foreach (var item in GraphQLHttpEventStreamProcessor.ReadStream(stream, ct).ConfigureAwait(false)) { @@ -262,7 +213,6 @@ private static async IAsyncEnumerable SingleResult(ValueTask new OperationResult( diff --git a/src/HotChocolate/AspNetCore/src/Transport.Http/HotChocolate.Transport.Http.csproj b/src/HotChocolate/AspNetCore/src/Transport.Http/HotChocolate.Transport.Http.csproj index da9117e6afd..72f41b3e8ec 100644 --- a/src/HotChocolate/AspNetCore/src/Transport.Http/HotChocolate.Transport.Http.csproj +++ b/src/HotChocolate/AspNetCore/src/Transport.Http/HotChocolate.Transport.Http.csproj @@ -1,9 +1,5 @@ - - $(LibraryTargetFrameworks) - - HotChocolate.Transport.Http HotChocolate.Transport.Http diff --git a/src/HotChocolate/AspNetCore/src/Transport.Sockets.Client/HotChocolate.Transport.Sockets.Client.csproj b/src/HotChocolate/AspNetCore/src/Transport.Sockets.Client/HotChocolate.Transport.Sockets.Client.csproj index 37a556fcd37..c8f30a6a191 100644 --- a/src/HotChocolate/AspNetCore/src/Transport.Sockets.Client/HotChocolate.Transport.Sockets.Client.csproj +++ b/src/HotChocolate/AspNetCore/src/Transport.Sockets.Client/HotChocolate.Transport.Sockets.Client.csproj @@ -1,9 +1,5 @@ - - $(LibraryTargetFrameworks) - - HotChocolate.Transport.Sockets.Client HotChocolate.Transport.Sockets.Client @@ -18,11 +14,6 @@ - - - - - True diff --git a/src/HotChocolate/AspNetCore/src/Transport.Sockets.Client/Protocols/GraphQLOverWebSocket/MessageHelper.cs b/src/HotChocolate/AspNetCore/src/Transport.Sockets.Client/Protocols/GraphQLOverWebSocket/MessageHelper.cs index 3f72ea1de49..cb898e7102b 100644 --- a/src/HotChocolate/AspNetCore/src/Transport.Sockets.Client/Protocols/GraphQLOverWebSocket/MessageHelper.cs +++ b/src/HotChocolate/AspNetCore/src/Transport.Sockets.Client/Protocols/GraphQLOverWebSocket/MessageHelper.cs @@ -27,11 +27,7 @@ public static async ValueTask SendConnectionInitMessage( jsonWriter.WriteEndObject(); await jsonWriter.FlushAsync(ct).ConfigureAwait(false); -#if NET5_0_OR_GREATER await socket.SendAsync(arrayWriter.GetWrittenMemory(), Text, true, ct).ConfigureAwait(false); -#else - await socket.SendAsync(arrayWriter.ToArraySegment(), Text, true, ct).ConfigureAwait(false); -#endif } public static async ValueTask SendSubscribeMessageAsync( @@ -53,11 +49,7 @@ public static async ValueTask SendSubscribeMessageAsync( jsonWriter.WriteEndObject(); await jsonWriter.FlushAsync(ct).ConfigureAwait(false); -#if NET5_0_OR_GREATER await socket.SendAsync(arrayWriter.GetWrittenMemory(), Text, true, ct).ConfigureAwait(false); -#else - await socket.SendAsync(arrayWriter.ToArraySegment(), Text, true, ct).ConfigureAwait(false); -#endif } public static async ValueTask SendCompleteMessageAsync( @@ -73,11 +65,7 @@ public static async ValueTask SendCompleteMessageAsync( jsonWriter.WriteEndObject(); await jsonWriter.FlushAsync(ct).ConfigureAwait(false); -#if NET5_0_OR_GREATER await socket.SendAsync(arrayWriter.GetWrittenMemory(), Text, true, ct).ConfigureAwait(false); -#else - await socket.SendAsync(arrayWriter.ToArraySegment(), Text, true, ct).ConfigureAwait(false); -#endif } public static async ValueTask SendPongMessageAsync( @@ -91,10 +79,6 @@ public static async ValueTask SendPongMessageAsync( jsonWriter.WriteEndObject(); await jsonWriter.FlushAsync(ct).ConfigureAwait(false); -#if NET5_0_OR_GREATER await socket.SendAsync(arrayWriter.GetWrittenMemory(), Text, true, ct).ConfigureAwait(false); -#else - await socket.SendAsync(arrayWriter.ToArraySegment(), Text, true, ct).ConfigureAwait(false); -#endif } } diff --git a/src/HotChocolate/AspNetCore/src/Transport.Sockets.Client/SocketClient.cs b/src/HotChocolate/AspNetCore/src/Transport.Sockets.Client/SocketClient.cs index 6dc2c4595d5..a36aabf17b3 100644 --- a/src/HotChocolate/AspNetCore/src/Transport.Sockets.Client/SocketClient.cs +++ b/src/HotChocolate/AspNetCore/src/Transport.Sockets.Client/SocketClient.cs @@ -83,7 +83,6 @@ public ValueTask ExecuteAsync( CancellationToken cancellationToken = default) => _protocol.ExecuteAsync(_context, request, cancellationToken); -#if NET5_0_OR_GREATER async Task ISocket.ReadMessageAsync( IBufferWriter writer, CancellationToken cancellationToken) @@ -124,52 +123,6 @@ async Task ISocket.ReadMessageAsync( return false; } } -#else - async Task ISocket.ReadMessageAsync( - IBufferWriter writer, - CancellationToken cancellationToken) - { - if (_disposed || _socket.IsClosed()) - { - return false; - } - - var buffer = ArrayPool.Shared.Rent(BufferSize); - var arraySegment = new ArraySegment(buffer); - - try - { - var read = 0; - WebSocketReceiveResult socketResult; - - do - { - if (_socket.IsClosed()) - { - break; - } - - // read message segment from socket. - socketResult = await _socket.ReceiveAsync(arraySegment, cancellationToken); - - // copy message segment to writer. - var memory = writer.GetMemory(socketResult.Count); - buffer.AsSpan().Slice(0, socketResult.Count).CopyTo(memory.Span); - writer.Advance(socketResult.Count); - read += socketResult.Count; - } while (!socketResult.EndOfMessage); - - ArrayPool.Shared.Return(buffer); - - return read > 0; - } - catch - { - // swallow exception, there's nothing we can reasonably do. - return false; - } - } -#endif public ValueTask DisposeAsync() { diff --git a/src/HotChocolate/AspNetCore/src/Transport.Sockets/HotChocolate.Transport.Sockets.csproj b/src/HotChocolate/AspNetCore/src/Transport.Sockets/HotChocolate.Transport.Sockets.csproj index ac722e7f3ad..dc8a5f89094 100644 --- a/src/HotChocolate/AspNetCore/src/Transport.Sockets/HotChocolate.Transport.Sockets.csproj +++ b/src/HotChocolate/AspNetCore/src/Transport.Sockets/HotChocolate.Transport.Sockets.csproj @@ -1,9 +1,5 @@ - - $(LibraryTargetFrameworks) - - HotChocolate.Transport.Sockets HotChocolate.Transport.Sockets diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests.Utilities/ServerTestBase.cs b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests.Utilities/ServerTestBase.cs index 7312ade438d..c399a72406d 100644 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests.Utilities/ServerTestBase.cs +++ b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests.Utilities/ServerTestBase.cs @@ -52,9 +52,7 @@ protected virtual TestServer CreateStarWarsServer( .UseWritePersistedOperation() .UseDocumentParser() .UseDocumentValidation() -#if NET7_0_OR_GREATER .UseCostAnalyzer() -#endif .UseOperationCache() .UseOperationResolver() .UseOperationVariableCoercion() @@ -119,9 +117,7 @@ protected virtual TestServer CreateStarWarsServer( .UseEndpoints( endpoints => { -#if NET8_0_OR_GREATER endpoints.MapGraphQLPersistedOperations(requireOperationName: requireOperationName); -#endif var builder = endpoints.MapGraphQL(pattern) .WithOptions(new GraphQLServerOptions diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/CostTests.cs b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/CostTests.cs index 3033e6f626d..0c4801cb608 100644 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/CostTests.cs +++ b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/CostTests.cs @@ -1,4 +1,3 @@ -#if NET7_0_OR_GREATER using System.Net.Http.Json; using System.Text; using System.Text.Json; @@ -98,4 +97,3 @@ public async Task Request_Validate_Cost_Header() result?.RootElement.MatchSnapshot(); } } -#endif diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/HttpGetSchemaMiddlewareTests.cs b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/HttpGetSchemaMiddlewareTests.cs index 6c94f3ed9d7..b9f9b6efa05 100644 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/HttpGetSchemaMiddlewareTests.cs +++ b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/HttpGetSchemaMiddlewareTests.cs @@ -30,11 +30,7 @@ public async Task Download_GraphQL_SDL() Assert.Equal(HttpStatusCode.OK, response.StatusCode); var result = await response.Content.ReadAsStringAsync(); -#if NET7_0_OR_GREATER result.MatchSnapshot(); -#else - result.MatchSnapshot("NET6"); -#endif } [Theory] @@ -58,11 +54,7 @@ public async Task Download_GraphQL_Schema(string path) // assert Assert.Equal(HttpStatusCode.OK, response.StatusCode); -#if NET7_0_OR_GREATER response.MatchMarkdownSnapshot(); -#else - response.MatchMarkdownSnapshot("NET6"); -#endif } [Theory] @@ -103,11 +95,7 @@ public async Task Download_GraphQL_Types_SDL() Assert.Equal(HttpStatusCode.OK, response.StatusCode); var result = await response.Content.ReadAsStringAsync(); -#if NET7_0_OR_GREATER result.MatchSnapshot(); -#else - result.MatchSnapshot("NET6"); -#endif } [Fact] @@ -125,11 +113,7 @@ public async Task Download_GraphQL_Types_SDL_Character_and_Query() Assert.Equal(HttpStatusCode.OK, response.StatusCode); var result = await response.Content.ReadAsStringAsync(); -#if NET7_0_OR_GREATER result.MatchSnapshot(); -#else - result.MatchSnapshot("NET6"); -#endif } [Fact] @@ -198,11 +182,7 @@ public async Task Download_GraphQL_SDL_Explicit_Route() Assert.Equal(HttpStatusCode.OK, response.StatusCode); var result = await response.Content.ReadAsStringAsync(); -#if NET7_0_OR_GREATER result.MatchSnapshot(); -#else - result.MatchSnapshot("NET6"); -#endif } [Fact] @@ -219,11 +199,7 @@ public async Task Download_GraphQL_SDL_Explicit_Route_Explicit_Pattern() // assert Assert.Equal(HttpStatusCode.OK, response.StatusCode); var result = await response.Content.ReadAsStringAsync(); -#if NET7_0_OR_GREATER result.MatchSnapshot(); -#else - result.MatchSnapshot("NET6"); -#endif } [Fact] diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/IntrospectionTests.cs b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/IntrospectionTests.cs index aa2a3a76e7f..11b7430213c 100644 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/IntrospectionTests.cs +++ b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/IntrospectionTests.cs @@ -29,7 +29,6 @@ public async Task Introspection_Request_When_Development_Success() response.HttpResponseMessage.MatchMarkdownSnapshot(); } -#if NET7_0_OR_GREATER [Theory] [InlineData("Staging")] [InlineData("Production")] @@ -76,7 +75,6 @@ public async Task Introspection_Request_With_Rule_Removed_Fail(string environmen response.HttpResponseMessage.MatchMarkdownSnapshot(); } -#endif private GraphQLHttpClient GetClient(string environment, bool removeRule = false) { var server = CreateStarWarsServer( diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/PersistedOperationMiddlewareTests.cs b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/PersistedOperationMiddlewareTests.cs index 3f65c79e17e..325b12b546c 100644 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/PersistedOperationMiddlewareTests.cs +++ b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/PersistedOperationMiddlewareTests.cs @@ -1,4 +1,3 @@ -#if NET8_0_OR_GREATER using System.Net; using System.Net.Http.Json; using System.Text; @@ -226,4 +225,3 @@ public async Task ExecutePersistedOperation_HttpPost_With_Variables_Success() json!.RootElement.MatchMarkdownSnapshot(); } } -#endif diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route_Explicit_Pattern_NET6.snap b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route_Explicit_Pattern_NET6.snap deleted file mode 100644 index 82609b31301..00000000000 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route_Explicit_Pattern_NET6.snap +++ /dev/null @@ -1,131 +0,0 @@ -schema { - query: Query - mutation: Mutation - subscription: Subscription -} - -interface Character { - id: ID! - name: String! - friends("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): FriendsConnection - appearsIn: [Episode] - traits: JSON - height(unit: Unit): Float -} - -type Droid implements Character { - id: ID! - name: String! - appearsIn: [Episode] - friends("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): FriendsConnection - height(unit: Unit): Float - primaryFunction: String - traits: JSON -} - -"A connection to a list of items." -type FriendsConnection { - "Information to aid in pagination." - pageInfo: PageInfo! - "A list of edges." - edges: [FriendsEdge!] - "A flattened list of the nodes." - nodes: [Character] -} - -"An edge in a connection." -type FriendsEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Character -} - -type Human implements Character { - id: ID! - name: String! - appearsIn: [Episode] - friends("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): FriendsConnection - otherHuman: Human - height(unit: Unit): Float - homePlanet: String - traits: JSON -} - -type Mutation { - createReview(episode: Episode! review: ReviewInput!): Review! - complete(episode: Episode!): Boolean! -} - -"Information about pagination in a connection." -type PageInfo { - "Indicates whether more edges exist following the set defined by the clients arguments." - hasNextPage: Boolean! - "Indicates whether more edges exist prior the set defined by the clients arguments." - hasPreviousPage: Boolean! - "When paginating backwards, the cursor to continue." - startCursor: String - "When paginating forwards, the cursor to continue." - endCursor: String -} - -type Query { - hero(episode: Episode! = NEW_HOPE): Character - heroByTraits(traits: JSON!): Character - heroes(episodes: [Episode!]!): [Character!] - character(characterIds: [String!]!): [Character!]! - search(text: String!): [SearchResult] - human(id: String!): Human - droid(id: String!): Droid - time: Long! - evict: Boolean! - wait(m: Int!): Boolean! - someDeprecatedField(deprecatedArg: String! = "foo" @deprecated(reason: "use something else")): String! @deprecated(reason: "use something else") -} - -type Review { - commentary: String - stars: Int! -} - -type Starship { - id: ID! - name: String! - length(unit: Unit): Float! -} - -type Subscription { - onReview(episode: Episode!): Review! - onNext: String! - onException: String! - delay(delay: Int! count: Int!): String! -} - -union SearchResult = Starship | Human | Droid - -input ReviewInput { - stars: Int! - commentary: String -} - -enum Episode { - NEW_HOPE - EMPIRE - JEDI -} - -enum Unit { - FOOT - METERS -} - -"The `@defer` directive may be provided for fragment spreads and inline fragments to inform the executor to delay the execution of the current fragment to indicate deprioritization of the current fragment. A query with `@defer` directive will cause the request to potentially return multiple responses, where non-deferred data is delivered in the initial response and data deferred is delivered in a subsequent response. `@include` and `@skip` take precedence over `@defer`." -directive @defer("If this argument label has a value other than null, it will be passed on to the result of this defer directive. This label is intended to give client applications a way to identify to which fragment a deferred result belongs to." label: String "Deferred when true." if: Boolean) on FRAGMENT_SPREAD | INLINE_FRAGMENT - -"The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`." -directive @stream("If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." label: String "The initial elements that shall be send down to the consumer." initialCount: Int! = 0 "Streamed when true." if: Boolean) on FIELD - -scalar JSON - -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route_NET6.snap b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route_NET6.snap deleted file mode 100644 index 82609b31301..00000000000 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route_NET6.snap +++ /dev/null @@ -1,131 +0,0 @@ -schema { - query: Query - mutation: Mutation - subscription: Subscription -} - -interface Character { - id: ID! - name: String! - friends("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): FriendsConnection - appearsIn: [Episode] - traits: JSON - height(unit: Unit): Float -} - -type Droid implements Character { - id: ID! - name: String! - appearsIn: [Episode] - friends("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): FriendsConnection - height(unit: Unit): Float - primaryFunction: String - traits: JSON -} - -"A connection to a list of items." -type FriendsConnection { - "Information to aid in pagination." - pageInfo: PageInfo! - "A list of edges." - edges: [FriendsEdge!] - "A flattened list of the nodes." - nodes: [Character] -} - -"An edge in a connection." -type FriendsEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Character -} - -type Human implements Character { - id: ID! - name: String! - appearsIn: [Episode] - friends("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): FriendsConnection - otherHuman: Human - height(unit: Unit): Float - homePlanet: String - traits: JSON -} - -type Mutation { - createReview(episode: Episode! review: ReviewInput!): Review! - complete(episode: Episode!): Boolean! -} - -"Information about pagination in a connection." -type PageInfo { - "Indicates whether more edges exist following the set defined by the clients arguments." - hasNextPage: Boolean! - "Indicates whether more edges exist prior the set defined by the clients arguments." - hasPreviousPage: Boolean! - "When paginating backwards, the cursor to continue." - startCursor: String - "When paginating forwards, the cursor to continue." - endCursor: String -} - -type Query { - hero(episode: Episode! = NEW_HOPE): Character - heroByTraits(traits: JSON!): Character - heroes(episodes: [Episode!]!): [Character!] - character(characterIds: [String!]!): [Character!]! - search(text: String!): [SearchResult] - human(id: String!): Human - droid(id: String!): Droid - time: Long! - evict: Boolean! - wait(m: Int!): Boolean! - someDeprecatedField(deprecatedArg: String! = "foo" @deprecated(reason: "use something else")): String! @deprecated(reason: "use something else") -} - -type Review { - commentary: String - stars: Int! -} - -type Starship { - id: ID! - name: String! - length(unit: Unit): Float! -} - -type Subscription { - onReview(episode: Episode!): Review! - onNext: String! - onException: String! - delay(delay: Int! count: Int!): String! -} - -union SearchResult = Starship | Human | Droid - -input ReviewInput { - stars: Int! - commentary: String -} - -enum Episode { - NEW_HOPE - EMPIRE - JEDI -} - -enum Unit { - FOOT - METERS -} - -"The `@defer` directive may be provided for fragment spreads and inline fragments to inform the executor to delay the execution of the current fragment to indicate deprioritization of the current fragment. A query with `@defer` directive will cause the request to potentially return multiple responses, where non-deferred data is delivered in the initial response and data deferred is delivered in a subsequent response. `@include` and `@skip` take precedence over `@defer`." -directive @defer("If this argument label has a value other than null, it will be passed on to the result of this defer directive. This label is intended to give client applications a way to identify to which fragment a deferred result belongs to." label: String "Deferred when true." if: Boolean) on FRAGMENT_SPREAD | INLINE_FRAGMENT - -"The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`." -directive @stream("If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." label: String "The initial elements that shall be send down to the consumer." initialCount: Int! = 0 "Streamed when true." if: Boolean) on FIELD - -scalar JSON - -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_NET6.snap b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_NET6.snap deleted file mode 100644 index 82609b31301..00000000000 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_NET6.snap +++ /dev/null @@ -1,131 +0,0 @@ -schema { - query: Query - mutation: Mutation - subscription: Subscription -} - -interface Character { - id: ID! - name: String! - friends("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): FriendsConnection - appearsIn: [Episode] - traits: JSON - height(unit: Unit): Float -} - -type Droid implements Character { - id: ID! - name: String! - appearsIn: [Episode] - friends("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): FriendsConnection - height(unit: Unit): Float - primaryFunction: String - traits: JSON -} - -"A connection to a list of items." -type FriendsConnection { - "Information to aid in pagination." - pageInfo: PageInfo! - "A list of edges." - edges: [FriendsEdge!] - "A flattened list of the nodes." - nodes: [Character] -} - -"An edge in a connection." -type FriendsEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Character -} - -type Human implements Character { - id: ID! - name: String! - appearsIn: [Episode] - friends("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): FriendsConnection - otherHuman: Human - height(unit: Unit): Float - homePlanet: String - traits: JSON -} - -type Mutation { - createReview(episode: Episode! review: ReviewInput!): Review! - complete(episode: Episode!): Boolean! -} - -"Information about pagination in a connection." -type PageInfo { - "Indicates whether more edges exist following the set defined by the clients arguments." - hasNextPage: Boolean! - "Indicates whether more edges exist prior the set defined by the clients arguments." - hasPreviousPage: Boolean! - "When paginating backwards, the cursor to continue." - startCursor: String - "When paginating forwards, the cursor to continue." - endCursor: String -} - -type Query { - hero(episode: Episode! = NEW_HOPE): Character - heroByTraits(traits: JSON!): Character - heroes(episodes: [Episode!]!): [Character!] - character(characterIds: [String!]!): [Character!]! - search(text: String!): [SearchResult] - human(id: String!): Human - droid(id: String!): Droid - time: Long! - evict: Boolean! - wait(m: Int!): Boolean! - someDeprecatedField(deprecatedArg: String! = "foo" @deprecated(reason: "use something else")): String! @deprecated(reason: "use something else") -} - -type Review { - commentary: String - stars: Int! -} - -type Starship { - id: ID! - name: String! - length(unit: Unit): Float! -} - -type Subscription { - onReview(episode: Episode!): Review! - onNext: String! - onException: String! - delay(delay: Int! count: Int!): String! -} - -union SearchResult = Starship | Human | Droid - -input ReviewInput { - stars: Int! - commentary: String -} - -enum Episode { - NEW_HOPE - EMPIRE - JEDI -} - -enum Unit { - FOOT - METERS -} - -"The `@defer` directive may be provided for fragment spreads and inline fragments to inform the executor to delay the execution of the current fragment to indicate deprioritization of the current fragment. A query with `@defer` directive will cause the request to potentially return multiple responses, where non-deferred data is delivered in the initial response and data deferred is delivered in a subsequent response. `@include` and `@skip` take precedence over `@defer`." -directive @defer("If this argument label has a value other than null, it will be passed on to the result of this defer directive. This label is intended to give client applications a way to identify to which fragment a deferred result belongs to." label: String "Deferred when true." if: Boolean) on FRAGMENT_SPREAD | INLINE_FRAGMENT - -"The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`." -directive @stream("If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." label: String "The initial elements that shall be send down to the consumer." initialCount: Int! = 0 "Streamed when true." if: Boolean) on FIELD - -scalar JSON - -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema_NET6.md b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema_NET6.md deleted file mode 100644 index c5f61004536..00000000000 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema_NET6.md +++ /dev/null @@ -1,145 +0,0 @@ -# Download_GraphQL_Schema - -```text -Headers: -ETag: "1-kBEjhe2t+jfqbeZRxnezu0WDQFYAc0qzjLF1RlHs428=" -Cache-Control: public, must-revalidate, max-age=3600 -Content-Type: application/graphql; charset=utf-8 -Content-Disposition: attachment; filename="schema.graphql" -Last-Modified: Fri, 01 Jan 2021 00:00:00 GMT -Content-Length: 5070 ---------------------------> -Status Code: OK ---------------------------> -schema { - query: Query - mutation: Mutation - subscription: Subscription -} - -interface Character { - id: ID! - name: String! - friends("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): FriendsConnection - appearsIn: [Episode] - traits: JSON - height(unit: Unit): Float -} - -type Droid implements Character { - id: ID! - name: String! - appearsIn: [Episode] - friends("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): FriendsConnection - height(unit: Unit): Float - primaryFunction: String - traits: JSON -} - -"A connection to a list of items." -type FriendsConnection { - "Information to aid in pagination." - pageInfo: PageInfo! - "A list of edges." - edges: [FriendsEdge!] - "A flattened list of the nodes." - nodes: [Character] -} - -"An edge in a connection." -type FriendsEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Character -} - -type Human implements Character { - id: ID! - name: String! - appearsIn: [Episode] - friends("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): FriendsConnection - otherHuman: Human - height(unit: Unit): Float - homePlanet: String - traits: JSON -} - -type Mutation { - createReview(episode: Episode! review: ReviewInput!): Review! - complete(episode: Episode!): Boolean! -} - -"Information about pagination in a connection." -type PageInfo { - "Indicates whether more edges exist following the set defined by the clients arguments." - hasNextPage: Boolean! - "Indicates whether more edges exist prior the set defined by the clients arguments." - hasPreviousPage: Boolean! - "When paginating backwards, the cursor to continue." - startCursor: String - "When paginating forwards, the cursor to continue." - endCursor: String -} - -type Query { - hero(episode: Episode! = NEW_HOPE): Character - heroByTraits(traits: JSON!): Character - heroes(episodes: [Episode!]!): [Character!] - character(characterIds: [String!]!): [Character!]! - search(text: String!): [SearchResult] - human(id: String!): Human - droid(id: String!): Droid - time: Long! - evict: Boolean! - wait(m: Int!): Boolean! - someDeprecatedField(deprecatedArg: String! = "foo" @deprecated(reason: "use something else")): String! @deprecated(reason: "use something else") -} - -type Review { - commentary: String - stars: Int! -} - -type Starship { - id: ID! - name: String! - length(unit: Unit): Float! -} - -type Subscription { - onReview(episode: Episode!): Review! - onNext: String! - onException: String! - delay(delay: Int! count: Int!): String! -} - -union SearchResult = Starship | Human | Droid - -input ReviewInput { - stars: Int! - commentary: String -} - -enum Episode { - NEW_HOPE - EMPIRE - JEDI -} - -enum Unit { - FOOT - METERS -} - -"The `@defer` directive may be provided for fragment spreads and inline fragments to inform the executor to delay the execution of the current fragment to indicate deprioritization of the current fragment. A query with `@defer` directive will cause the request to potentially return multiple responses, where non-deferred data is delivered in the initial response and data deferred is delivered in a subsequent response. `@include` and `@skip` take precedence over `@defer`." -directive @defer("If this argument label has a value other than null, it will be passed on to the result of this defer directive. This label is intended to give client applications a way to identify to which fragment a deferred result belongs to." label: String "Deferred when true." if: Boolean) on FRAGMENT_SPREAD | INLINE_FRAGMENT - -"The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`." -directive @stream("If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." label: String "The initial elements that shall be send down to the consumer." initialCount: Int! = 0 "Streamed when true." if: Boolean) on FIELD - -scalar JSON - -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long -``` diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Types_SDL_Character_and_Query_NET6.snap b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Types_SDL_Character_and_Query_NET6.snap deleted file mode 100644 index 2a4d3e70ec4..00000000000 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Types_SDL_Character_and_Query_NET6.snap +++ /dev/null @@ -1,22 +0,0 @@ -interface Character { - id: ID! - name: String! - friends("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): FriendsConnection - appearsIn: [Episode] - traits: JSON - height(unit: Unit): Float -} - -type Query { - hero(episode: Episode! = NEW_HOPE): Character - heroByTraits(traits: JSON!): Character - heroes(episodes: [Episode!]!): [Character!] - character(characterIds: [String!]!): [Character!]! - search(text: String!): [SearchResult] - human(id: String!): Human - droid(id: String!): Droid - time: Long! - evict: Boolean! - wait(m: Int!): Boolean! - someDeprecatedField(deprecatedArg: String! = "foo" @deprecated(reason: "use something else")): String! @deprecated(reason: "use something else") -} diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Types_SDL_NET6.snap b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Types_SDL_NET6.snap deleted file mode 100644 index bf3d40d07d6..00000000000 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Types_SDL_NET6.snap +++ /dev/null @@ -1,13 +0,0 @@ -type Query { - hero(episode: Episode! = NEW_HOPE): Character - heroByTraits(traits: JSON!): Character - heroes(episodes: [Episode!]!): [Character!] - character(characterIds: [String!]!): [Character!]! - search(text: String!): [SearchResult] - human(id: String!): Human - droid(id: String!): Droid - time: Long! - evict: Boolean! - wait(m: Int!): Boolean! - someDeprecatedField(deprecatedArg: String! = "foo" @deprecated(reason: "use something else")): String! @deprecated(reason: "use something else") -} diff --git a/src/HotChocolate/AzureFunctions/.vscode/launch.json b/src/HotChocolate/AzureFunctions/.vscode/launch.json deleted file mode 100644 index e322ab0cb3d..00000000000 --- a/src/HotChocolate/AzureFunctions/.vscode/launch.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - // Use IntelliSense to find out which attributes exist for C# debugging - // Use hover for the description of the existing attributes - // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md - "name": ".NET Core Launch (console)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/test/HotChocolate.AzureFunctions.Tests/bin/Debug/net6.0/HotChocolate.AzureFunctions.Tests.dll", - "args": [], - "cwd": "${workspaceFolder}/test/HotChocolate.AzureFunctions.Tests", - // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console - "console": "internalConsole", - "stopAtEntry": false - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach" - } - ] -} \ No newline at end of file diff --git a/src/HotChocolate/AzureFunctions/.vscode/tasks.json b/src/HotChocolate/AzureFunctions/.vscode/tasks.json deleted file mode 100644 index 31c32bd3457..00000000000 --- a/src/HotChocolate/AzureFunctions/.vscode/tasks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "shell", - "args": [ - "build", - // Ask dotnet build to generate full paths for file names. - "/property:GenerateFullPaths=true", - // Do not generate summary otherwise it leads to duplicate errors in Problems panel - "/consoleloggerparameters:NoSummary" - ], - "group": "build", - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/src/HotChocolate/AzureFunctions/Directory.Build.props b/src/HotChocolate/AzureFunctions/Directory.Build.props index 834fc6a0a05..ea6e2bc3aaf 100644 --- a/src/HotChocolate/AzureFunctions/Directory.Build.props +++ b/src/HotChocolate/AzureFunctions/Directory.Build.props @@ -1,9 +1,4 @@ - - $(AzfTargetFrameworks) - $(AzfIsoProcTargetFrameworks) - - diff --git a/src/HotChocolate/AzureFunctions/test/Directory.Build.props b/src/HotChocolate/AzureFunctions/test/Directory.Build.props index 3143eeb3379..4f4a5078fc8 100644 --- a/src/HotChocolate/AzureFunctions/test/Directory.Build.props +++ b/src/HotChocolate/AzureFunctions/test/Directory.Build.props @@ -4,7 +4,6 @@ false false - $(TestTargetFrameworks) diff --git a/src/HotChocolate/Caching/Directory.Build.props b/src/HotChocolate/Caching/Directory.Build.props index 0548c5bae1f..106b12775b2 100644 --- a/src/HotChocolate/Caching/Directory.Build.props +++ b/src/HotChocolate/Caching/Directory.Build.props @@ -1,7 +1,3 @@ - - - $(Library2TargetFrameworks) - diff --git a/src/HotChocolate/Caching/src/Caching/CacheControlTypeInterceptor.cs b/src/HotChocolate/Caching/src/Caching/CacheControlTypeInterceptor.cs index 5b2134d208f..ffc75c23f42 100644 --- a/src/HotChocolate/Caching/src/Caching/CacheControlTypeInterceptor.cs +++ b/src/HotChocolate/Caching/src/Caching/CacheControlTypeInterceptor.cs @@ -65,11 +65,7 @@ private void TryApplyDefaults(RegisteredType type, ObjectTypeDefinition objectDe var length = objectDef.Fields.Count; var appliedDefaults = false; -#if NET6_0_OR_GREATER var fields = ((BindableList)objectDef.Fields).AsSpan(); -#else - var fields = (BindableList)objectDef.Fields; -#endif for (var i = 0; i < length; i++) { diff --git a/src/HotChocolate/Caching/test/Caching.Tests/SchemaTests.cs b/src/HotChocolate/Caching/test/Caching.Tests/SchemaTests.cs index 5921ef6f64d..c31cd4072a8 100644 --- a/src/HotChocolate/Caching/test/Caching.Tests/SchemaTests.cs +++ b/src/HotChocolate/Caching/test/Caching.Tests/SchemaTests.cs @@ -13,11 +13,7 @@ public async Task Allow_CacheControl_On_FieldDefinition() { var schema = await new ServiceCollection() -#if NET7_0_OR_GREATER .AddGraphQLServer(disableCostAnalyzer: true) -#else - .AddGraphQLServer() -#endif .AddTypeExtension(typeof(Query)) .ConfigureSchema( b => b.TryAddRootType( diff --git a/src/HotChocolate/Core/.vscode/settings.json b/src/HotChocolate/Core/.vscode/settings.json deleted file mode 100644 index d12df8a7116..00000000000 --- a/src/HotChocolate/Core/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "dotnet.defaultSolution": "HotChocolate.Core.sln" -} diff --git a/src/HotChocolate/Core/.vscode/tasks.json b/src/HotChocolate/Core/.vscode/tasks.json deleted file mode 100644 index 31c32bd3457..00000000000 --- a/src/HotChocolate/Core/.vscode/tasks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "shell", - "args": [ - "build", - // Ask dotnet build to generate full paths for file names. - "/property:GenerateFullPaths=true", - // Do not generate summary otherwise it leads to duplicate errors in Problems panel - "/consoleloggerparameters:NoSummary" - ], - "group": "build", - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/src/HotChocolate/Core/src/Abstractions/DefaultQueryableExecutable.cs b/src/HotChocolate/Core/src/Abstractions/DefaultQueryableExecutable.cs index 628356fc99d..1919e3a64e9 100644 --- a/src/HotChocolate/Core/src/Abstractions/DefaultQueryableExecutable.cs +++ b/src/HotChocolate/Core/src/Abstractions/DefaultQueryableExecutable.cs @@ -38,11 +38,7 @@ public IQueryableExecutable WithSource(IQueryable src) return await enumerator.MoveNextAsync().ConfigureAwait(false) ? enumerator.Current : default; } -#if NET6_0_OR_GREATER return await Task.Run(() => source.FirstOrDefault(), cancellationToken).WaitAsync(cancellationToken); -#else - return await Task.Run(() => source.FirstOrDefault(), cancellationToken); -#endif } public override ValueTask SingleOrDefaultAsync(CancellationToken cancellationToken = default) @@ -75,11 +71,7 @@ public IQueryableExecutable WithSource(IQueryable src) return default; } -#if NET6_0_OR_GREATER return await Task.Run(() => SingleOrDefaultSync(source), cancellationToken).WaitAsync(cancellationToken); -#else - return await Task.Run(() => SingleOrDefaultSync(source), cancellationToken); -#endif } private static T? SingleOrDefaultSync(IQueryable query) @@ -135,11 +127,7 @@ private async ValueTask> ToListFromDataSourceAsync(CancellationToken can return result; } -#if NET6_0_OR_GREATER return await Task.Run(() => source.ToList(), cancellationToken).WaitAsync(cancellationToken); -#else - return await Task.Run(() => source.ToList(), cancellationToken); -#endif } public override async IAsyncEnumerable ToAsyncEnumerable( @@ -161,11 +149,7 @@ public override async IAsyncEnumerable ToAsyncEnumerable( } else { -#if NET6_0_OR_GREATER var list = await Task.Run(() => source.ToList(), cancellationToken).WaitAsync(cancellationToken); -#else - var list = await Task.Run(() => source.ToList(), cancellationToken); -#endif foreach (var element in list) { @@ -186,11 +170,7 @@ public override ValueTask CountAsync(CancellationToken cancellationToken = private async ValueTask CountFromDataSourceAsync(CancellationToken cancellationToken = default) { -#if NET6_0_OR_GREATER return await Task.Run(source.Count, cancellationToken).WaitAsync(cancellationToken); -#else - return await Task.Run(source.Count, cancellationToken); -#endif } public override string Print() => _printer(source); diff --git a/src/HotChocolate/Core/src/Abstractions/Error.cs b/src/HotChocolate/Core/src/Abstractions/Error.cs index 7cea8b5e1da..a42e81955c4 100644 --- a/src/HotChocolate/Core/src/Abstractions/Error.cs +++ b/src/HotChocolate/Core/src/Abstractions/Error.cs @@ -1,4 +1,6 @@ +#if NET8_0 using HotChocolate.Execution; +#endif using HotChocolate.Properties; namespace HotChocolate; diff --git a/src/HotChocolate/Core/src/Abstractions/ErrorBuilder.cs b/src/HotChocolate/Core/src/Abstractions/ErrorBuilder.cs index 2fd65943021..5b7f1ec10e1 100644 --- a/src/HotChocolate/Core/src/Abstractions/ErrorBuilder.cs +++ b/src/HotChocolate/Core/src/Abstractions/ErrorBuilder.cs @@ -1,4 +1,6 @@ +#if NET8_0 using HotChocolate.Execution; +#endif using HotChocolate.Language; using HotChocolate.Properties; diff --git a/src/HotChocolate/Core/src/Abstractions/Execution/OperationRequestBuilder.cs b/src/HotChocolate/Core/src/Abstractions/Execution/OperationRequestBuilder.cs index 0fc498e3519..42be12e3557 100644 --- a/src/HotChocolate/Core/src/Abstractions/Execution/OperationRequestBuilder.cs +++ b/src/HotChocolate/Core/src/Abstractions/Execution/OperationRequestBuilder.cs @@ -1,6 +1,4 @@ -#if NET7_0_OR_GREATER using System.Diagnostics.CodeAnalysis; -#endif using HotChocolate.Language; using static HotChocolate.Properties.AbstractionResources; @@ -32,12 +30,7 @@ public sealed class OperationRequestBuilder /// /// is null or empty. /// - public OperationRequestBuilder SetDocument( -#if NET7_0_OR_GREATER - [StringSyntax("graphql")] string sourceText) -#else - string sourceText) -#endif + public OperationRequestBuilder SetDocument([StringSyntax("graphql")] string sourceText) { if (string.IsNullOrEmpty(sourceText)) { diff --git a/src/HotChocolate/Core/src/Abstractions/Execution/OperationResultHelper.cs b/src/HotChocolate/Core/src/Abstractions/Execution/OperationResultHelper.cs index 15efa817205..ff431cb0701 100644 --- a/src/HotChocolate/Core/src/Abstractions/Execution/OperationResultHelper.cs +++ b/src/HotChocolate/Core/src/Abstractions/Execution/OperationResultHelper.cs @@ -13,7 +13,7 @@ internal static class OperationResultHelper public static IReadOnlyDictionary ToDictionary(IOperationResult result) { - var formatted = new OrderedDictionary(); + var formatted = new OrderedDictionary(); if (result.Errors is { Count: > 0, }) { @@ -40,7 +40,7 @@ private static ICollection SerializeErrors( foreach (var error in errors) { - var formattedError = new OrderedDictionary { [_message] = error.Message, }; + var formattedError = new OrderedDictionary { [_message] = error.Message, }; if (error.Locations is { Count: > 0, }) { diff --git a/src/HotChocolate/Core/src/Abstractions/Execution/OrderedDictionary.cs b/src/HotChocolate/Core/src/Abstractions/Execution/OrderedDictionary.cs index 9f73cf69582..5faf5345c8d 100644 --- a/src/HotChocolate/Core/src/Abstractions/Execution/OrderedDictionary.cs +++ b/src/HotChocolate/Core/src/Abstractions/Execution/OrderedDictionary.cs @@ -1,10 +1,9 @@ +#if NET8_0 using System.Collections; using System.Diagnostics.CodeAnalysis; namespace HotChocolate.Execution; -public class OrderedDictionary : OrderedDictionary; - public class OrderedDictionary : IDictionary , IReadOnlyDictionary @@ -47,13 +46,8 @@ private OrderedDictionary(OrderedDictionary source) _map = new Dictionary(source._map); } -#if NET6_0_OR_GREATER public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value) => _map.TryGetValue(key, out value); -#else - public bool TryGetValue(TKey key, out TValue value) - => _map.TryGetValue(key, out value); -#endif public TValue this[TKey key] { @@ -161,3 +155,4 @@ IEnumerator IEnumerable.GetEnumerator() public OrderedDictionary Clone() => new(this); } +#endif diff --git a/src/HotChocolate/Core/src/Abstractions/ExtensionData.cs b/src/HotChocolate/Core/src/Abstractions/ExtensionData.cs index 96dac6b4384..aba840085dc 100644 --- a/src/HotChocolate/Core/src/Abstractions/ExtensionData.cs +++ b/src/HotChocolate/Core/src/Abstractions/ExtensionData.cs @@ -20,16 +20,7 @@ public ExtensionData(ExtensionData extensionData) public ExtensionData(IReadOnlyDictionary extensionData) { -#if NET6_0_OR_GREATER _dict = new Dictionary(extensionData); -#else - _dict = new Dictionary(); - - foreach (var item in extensionData) - { - _dict.Add(item.Key, item.Value); - } -#endif } public object? this[string key] diff --git a/src/HotChocolate/Core/src/Abstractions/FieldResult.cs b/src/HotChocolate/Core/src/Abstractions/FieldResult.cs index ab948cedc7e..63d482252c1 100644 --- a/src/HotChocolate/Core/src/Abstractions/FieldResult.cs +++ b/src/HotChocolate/Core/src/Abstractions/FieldResult.cs @@ -146,16 +146,10 @@ public FieldResult(params object[] errors) /// /// Defines if the mutation had an error and if the result represents a error result. /// -#if NET5_0_OR_GREATER [MemberNotNullWhen(true, nameof(Errors))] -#endif public bool IsError { get; } -#if NET5_0_OR_GREATER object? IFieldResult.Value => IsSuccess ? Value : Errors; -#else - object? IFieldResult.Value => IsSuccess ? Value : Errors!; -#endif /// /// Implicitly converts the success result value @@ -333,16 +327,10 @@ public FieldResult(params TError[] errors) /// /// Defines if the mutation had an error and if the result represents a error result. /// -#if NET5_0_OR_GREATER [MemberNotNullWhen(true, nameof(Errors))] -#endif public bool IsError { get; } -#if NET5_0_OR_GREATER object? IFieldResult.Value => IsSuccess ? Value : Errors; -#else - object? IFieldResult.Value => IsSuccess ? Value : Errors!; -#endif /// /// Implicitly converts the success result value @@ -732,16 +720,10 @@ public FieldResult(params object[] errors) /// /// Defines if the mutation had an error and if the result represents a error result. /// -#if NET5_0_OR_GREATER [MemberNotNullWhen(true, nameof(Errors))] -#endif public bool IsError { get; } -#if NET5_0_OR_GREATER object? IFieldResult.Value => IsSuccess ? Value : Errors; -#else - object? IFieldResult.Value => IsSuccess ? Value : Errors!; -#endif /// /// Implicitly converts the success result value @@ -1270,16 +1252,10 @@ public FieldResult(params object[] errors) /// /// Defines if the mutation had an error and if the result represents a error result. /// -#if NET5_0_OR_GREATER [MemberNotNullWhen(true, nameof(Errors))] -#endif public bool IsError { get; } -#if NET5_0_OR_GREATER object? IFieldResult.Value => IsSuccess ? Value : Errors; -#else - object? IFieldResult.Value => IsSuccess ? Value : Errors!; -#endif /// /// Implicitly converts the success result value @@ -1946,16 +1922,10 @@ public FieldResult(params object[] errors) /// /// Defines if the mutation had an error and if the result represents a error result. /// -#if NET5_0_OR_GREATER [MemberNotNullWhen(true, nameof(Errors))] -#endif public bool IsError { get; } -#if NET5_0_OR_GREATER object? IFieldResult.Value => IsSuccess ? Value : Errors; -#else - object? IFieldResult.Value => IsSuccess ? Value : Errors!; -#endif /// /// Implicitly converts the success result value @@ -2760,16 +2730,10 @@ public FieldResult(params object[] errors) /// /// Defines if the mutation had an error and if the result represents a error result. /// -#if NET5_0_OR_GREATER [MemberNotNullWhen(true, nameof(Errors))] -#endif public bool IsError { get; } -#if NET5_0_OR_GREATER object? IFieldResult.Value => IsSuccess ? Value : Errors; -#else - object? IFieldResult.Value => IsSuccess ? Value : Errors!; -#endif /// /// Implicitly converts the success result value diff --git a/src/HotChocolate/Core/src/Abstractions/GraphQLTypeAttribute.cs b/src/HotChocolate/Core/src/Abstractions/GraphQLTypeAttribute.cs index 46a12a1cc0e..bfb5a7fbed1 100644 --- a/src/HotChocolate/Core/src/Abstractions/GraphQLTypeAttribute.cs +++ b/src/HotChocolate/Core/src/Abstractions/GraphQLTypeAttribute.cs @@ -52,7 +52,6 @@ public GraphQLTypeAttribute(string typeSyntax) public ITypeNode? TypeSyntax { get; } } -#if NET6_0_OR_GREATER /// /// Specifies the GraphQL type. /// @@ -66,4 +65,3 @@ public GraphQLTypeAttribute() : base(typeof(T)) { } } -#endif diff --git a/src/HotChocolate/Core/src/Abstractions/HotChocolate.Abstractions.csproj b/src/HotChocolate/Core/src/Abstractions/HotChocolate.Abstractions.csproj index 2c548febab9..434fc1b059d 100644 --- a/src/HotChocolate/Core/src/Abstractions/HotChocolate.Abstractions.csproj +++ b/src/HotChocolate/Core/src/Abstractions/HotChocolate.Abstractions.csproj @@ -24,11 +24,6 @@ - - - - - diff --git a/src/HotChocolate/Core/src/Abstractions/IFieldResult.cs b/src/HotChocolate/Core/src/Abstractions/IFieldResult.cs index 163869bc62a..c317881f8e0 100644 --- a/src/HotChocolate/Core/src/Abstractions/IFieldResult.cs +++ b/src/HotChocolate/Core/src/Abstractions/IFieldResult.cs @@ -15,16 +15,12 @@ public interface IFieldResult /// /// Defines if the mutation was successful and if the result represents a success result. /// -#if NET5_0_OR_GREATER [MemberNotNullWhen(false, nameof(Value))] -#endif bool IsSuccess { get; } /// /// Defines if the mutation had an error and if the result represents a error result. /// -#if NET5_0_OR_GREATER [MemberNotNullWhen(true, nameof(Value))] -#endif bool IsError { get; } } diff --git a/src/HotChocolate/Core/src/Abstractions/Optional.cs b/src/HotChocolate/Core/src/Abstractions/Optional.cs index 335c78f7d4a..623d5da1533 100644 --- a/src/HotChocolate/Core/src/Abstractions/Optional.cs +++ b/src/HotChocolate/Core/src/Abstractions/Optional.cs @@ -35,9 +35,7 @@ private Optional(T? value, bool hasValue) /// /// true if the optional was explicitly set. /// - #if NET5_0_OR_GREATER [MemberNotNullWhen(true, nameof(Value))] - #endif public bool HasValue { get; } /// diff --git a/src/HotChocolate/Core/src/Abstractions/ServiceAttribute.cs b/src/HotChocolate/Core/src/Abstractions/ServiceAttribute.cs index 750858c90d5..71570400590 100644 --- a/src/HotChocolate/Core/src/Abstractions/ServiceAttribute.cs +++ b/src/HotChocolate/Core/src/Abstractions/ServiceAttribute.cs @@ -13,7 +13,6 @@ public ServiceAttribute() { } -#if NET8_0_OR_GREATER /// /// Marks a resolver parameter as a service that shall be injected by the execution engine. /// @@ -29,5 +28,4 @@ public ServiceAttribute(string key) /// Gets the key that shall be used to resolve the service. /// public string? Key { get; } -#endif } diff --git a/src/HotChocolate/Core/src/Authorization/AuthorizationTypeInterceptor.ObjectTypeInfo.cs b/src/HotChocolate/Core/src/Authorization/AuthorizationTypeInterceptor.ObjectTypeInfo.cs index efa5cae2008..f1ff07cb0f9 100644 --- a/src/HotChocolate/Core/src/Authorization/AuthorizationTypeInterceptor.ObjectTypeInfo.cs +++ b/src/HotChocolate/Core/src/Authorization/AuthorizationTypeInterceptor.ObjectTypeInfo.cs @@ -1,5 +1,3 @@ -#if NET6_0_OR_GREATER -#endif using HotChocolate.Configuration; using HotChocolate.Types.Descriptors; using HotChocolate.Types.Descriptors.Definitions; diff --git a/src/HotChocolate/Core/src/Authorization/AuthorizationTypeInterceptor.State.cs b/src/HotChocolate/Core/src/Authorization/AuthorizationTypeInterceptor.State.cs index 610e1d92351..48052e94204 100644 --- a/src/HotChocolate/Core/src/Authorization/AuthorizationTypeInterceptor.State.cs +++ b/src/HotChocolate/Core/src/Authorization/AuthorizationTypeInterceptor.State.cs @@ -1,5 +1,3 @@ -#if NET6_0_OR_GREATER -#endif using HotChocolate.Types.Descriptors; namespace HotChocolate.Authorization; diff --git a/src/HotChocolate/Core/src/Authorization/AuthorizationTypeInterceptor.TypeInfo.cs b/src/HotChocolate/Core/src/Authorization/AuthorizationTypeInterceptor.TypeInfo.cs index d4b687d8d07..e0a6fedfb1d 100644 --- a/src/HotChocolate/Core/src/Authorization/AuthorizationTypeInterceptor.TypeInfo.cs +++ b/src/HotChocolate/Core/src/Authorization/AuthorizationTypeInterceptor.TypeInfo.cs @@ -1,5 +1,3 @@ -#if NET6_0_OR_GREATER -#endif using HotChocolate.Configuration; using HotChocolate.Types.Descriptors.Definitions; diff --git a/src/HotChocolate/Core/src/Authorization/AuthorizationTypeInterceptor.UnionTypeInfo.cs b/src/HotChocolate/Core/src/Authorization/AuthorizationTypeInterceptor.UnionTypeInfo.cs index b9b06e64908..aa5b27ace2e 100644 --- a/src/HotChocolate/Core/src/Authorization/AuthorizationTypeInterceptor.UnionTypeInfo.cs +++ b/src/HotChocolate/Core/src/Authorization/AuthorizationTypeInterceptor.UnionTypeInfo.cs @@ -1,5 +1,3 @@ -#if NET6_0_OR_GREATER -#endif using HotChocolate.Configuration; using HotChocolate.Types.Descriptors.Definitions; diff --git a/src/HotChocolate/Core/src/Authorization/AuthorizationTypeInterceptor.cs b/src/HotChocolate/Core/src/Authorization/AuthorizationTypeInterceptor.cs index be25e8e0065..a4e2710916c 100644 --- a/src/HotChocolate/Core/src/Authorization/AuthorizationTypeInterceptor.cs +++ b/src/HotChocolate/Core/src/Authorization/AuthorizationTypeInterceptor.cs @@ -1,7 +1,5 @@ using System.Runtime.CompilerServices; -#if NET6_0_OR_GREATER using System.Runtime.InteropServices; -#endif using HotChocolate.Configuration; using HotChocolate.Language; using HotChocolate.Types; @@ -592,17 +590,11 @@ private static bool IsAuthorizedType(T definition) var directives = (List)definition.Directives; var length = directives.Count; -#if NET6_0_OR_GREATER ref var start = ref MemoryMarshal.GetReference(CollectionsMarshal.AsSpan(directives)); -#endif for (var i = 0; i < length; i++) { -#if NET6_0_OR_GREATER var directiveDef = Unsafe.Add(ref start, i); -#else - var directiveDef = directives[i]; -#endif if (directiveDef.Type is NameDirectiveReference { Name: Authorize, } || (directiveDef.Type is ExtendedTypeDirectiveReference { Type.Type: { } type, } && diff --git a/src/HotChocolate/Core/src/Authorization/HotChocolate.Authorization.csproj b/src/HotChocolate/Core/src/Authorization/HotChocolate.Authorization.csproj index 57f5161ff23..c375fcc060c 100644 --- a/src/HotChocolate/Core/src/Authorization/HotChocolate.Authorization.csproj +++ b/src/HotChocolate/Core/src/Authorization/HotChocolate.Authorization.csproj @@ -1,9 +1,5 @@ - - $(LibraryTargetFrameworks) - - HotChocolate.Authorization HotChocolate.Authorization diff --git a/src/HotChocolate/Core/src/Core/HotChocolate.Core.csproj b/src/HotChocolate/Core/src/Core/HotChocolate.Core.csproj index edec303098e..8ba8bd482d2 100644 --- a/src/HotChocolate/Core/src/Core/HotChocolate.Core.csproj +++ b/src/HotChocolate/Core/src/Core/HotChocolate.Core.csproj @@ -9,6 +9,8 @@ + + @@ -20,14 +22,4 @@ - - - - - - - - - - diff --git a/src/HotChocolate/Core/src/Directory.Build.props b/src/HotChocolate/Core/src/Directory.Build.props index 0262fef8ece..a9c57944138 100644 --- a/src/HotChocolate/Core/src/Directory.Build.props +++ b/src/HotChocolate/Core/src/Directory.Build.props @@ -3,7 +3,6 @@ - $(LibraryTargetFrameworks) $(NoWarn);CA1812 diff --git a/src/HotChocolate/Core/src/Execution/DependencyInjection/RequestExecutorServiceCollectionExtensions.cs b/src/HotChocolate/Core/src/Execution/DependencyInjection/RequestExecutorServiceCollectionExtensions.cs index 6ef1a1e6f2b..563d9ed9936 100644 --- a/src/HotChocolate/Core/src/Execution/DependencyInjection/RequestExecutorServiceCollectionExtensions.cs +++ b/src/HotChocolate/Core/src/Execution/DependencyInjection/RequestExecutorServiceCollectionExtensions.cs @@ -6,9 +6,7 @@ using HotChocolate.Execution.Configuration; using HotChocolate.Execution.Options; using HotChocolate.Execution.Processing; -#if NET6_0_OR_GREATER using HotChocolate.Execution.Projections; -#endif using HotChocolate.Fetching; using HotChocolate.Internal; using HotChocolate.Language; @@ -176,9 +174,7 @@ private static IRequestExecutorBuilder CreateBuilder( builder.TryAddNoOpTransactionScopeHandler(); builder.TryAddTypeInterceptor(); -#if NET6_0_OR_GREATER builder.TryAddTypeInterceptor(); -#endif return builder; } diff --git a/src/HotChocolate/Core/src/Execution/Extensions/ExecutionRequestExecutorExtensions.cs b/src/HotChocolate/Core/src/Execution/Extensions/ExecutionRequestExecutorExtensions.cs index a0ebf6cb3cc..b6ba67aeb7b 100644 --- a/src/HotChocolate/Core/src/Execution/Extensions/ExecutionRequestExecutorExtensions.cs +++ b/src/HotChocolate/Core/src/Execution/Extensions/ExecutionRequestExecutorExtensions.cs @@ -1,6 +1,4 @@ -#if NET7_0_OR_GREATER using System.Diagnostics.CodeAnalysis; -#endif using static HotChocolate.Execution.Properties.Resources; // ReSharper disable once CheckNamespace @@ -29,11 +27,7 @@ public static Task ExecuteAsync( public static Task ExecuteAsync( this IRequestExecutor executor, -#if NET7_0_OR_GREATER [StringSyntax("graphql")] string query) -#else - string query) -#endif { if (executor is null) { @@ -54,11 +48,7 @@ public static Task ExecuteAsync( public static Task ExecuteAsync( this IRequestExecutor executor, -#if NET7_0_OR_GREATER [StringSyntax("graphql")] string query, -#else - string query, -#endif CancellationToken cancellationToken) { if (executor is null) @@ -80,11 +70,7 @@ public static Task ExecuteAsync( public static Task ExecuteAsync( this IRequestExecutor executor, -#if NET7_0_OR_GREATER [StringSyntax("graphql")] string query, -#else - string query, -#endif Dictionary variableValues) { if (executor is null) @@ -114,11 +100,7 @@ public static Task ExecuteAsync( public static Task ExecuteAsync( this IRequestExecutor executor, -#if NET7_0_OR_GREATER [StringSyntax("graphql")] string query, -#else - string query, -#endif IReadOnlyDictionary variableValues, CancellationToken cancellationToken) { @@ -170,11 +152,7 @@ public static IExecutionResult Execute( public static IExecutionResult Execute( this IRequestExecutor executor, -#if NET7_0_OR_GREATER [StringSyntax("graphql")] string query) -#else - string query) -#endif { if (executor is null) { @@ -196,11 +174,7 @@ public static IExecutionResult Execute( public static IExecutionResult Execute( this IRequestExecutor executor, -#if NET7_0_OR_GREATER [StringSyntax("graphql")] string query, -#else - string query, -#endif IReadOnlyDictionary variableValues) { if (executor is null) diff --git a/src/HotChocolate/Core/src/Execution/HotChocolate.Execution.csproj b/src/HotChocolate/Core/src/Execution/HotChocolate.Execution.csproj index a29ce96f31f..dc584f54106 100644 --- a/src/HotChocolate/Core/src/Execution/HotChocolate.Execution.csproj +++ b/src/HotChocolate/Core/src/Execution/HotChocolate.Execution.csproj @@ -26,6 +26,7 @@ + @@ -39,22 +40,6 @@ - - - - - - - - - - - - - - - - True diff --git a/src/HotChocolate/Core/src/Execution/Processing/MiddlewareContext.Arguments.cs b/src/HotChocolate/Core/src/Execution/Processing/MiddlewareContext.Arguments.cs index 36a9d276d8d..1aa68dc1126 100644 --- a/src/HotChocolate/Core/src/Execution/Processing/MiddlewareContext.Arguments.cs +++ b/src/HotChocolate/Core/src/Execution/Processing/MiddlewareContext.Arguments.cs @@ -182,11 +182,7 @@ public ArgumentValue ReplaceArgument(string argumentName, ArgumentValue newArgum // copy the argument state. else { -#if NETSTANDARD2_0 - mutableArguments = Arguments.ToDictionary(t => t.Key, t => t.Value); -#else mutableArguments = new Dictionary(Arguments); -#endif Arguments = mutableArguments; } diff --git a/src/HotChocolate/Core/src/Execution/Processing/MiddlewareContext.Global.cs b/src/HotChocolate/Core/src/Execution/Processing/MiddlewareContext.Global.cs index 3c6fb1368b1..d8396d8a61d 100644 --- a/src/HotChocolate/Core/src/Execution/Processing/MiddlewareContext.Global.cs +++ b/src/HotChocolate/Core/src/Execution/Processing/MiddlewareContext.Global.cs @@ -170,9 +170,7 @@ public T Resolver() public T Service() where T : notnull => Services.GetRequiredService(); -#if NET8_0_OR_GREATER public T? Service(object key) where T : notnull => Services.GetKeyedService(key); -#endif public object Service(Type service) { diff --git a/src/HotChocolate/Core/src/Execution/Processing/MiddlewareContext.Pure.cs b/src/HotChocolate/Core/src/Execution/Processing/MiddlewareContext.Pure.cs index 42e63156954..221f55833d5 100644 --- a/src/HotChocolate/Core/src/Execution/Processing/MiddlewareContext.Pure.cs +++ b/src/HotChocolate/Core/src/Execution/Processing/MiddlewareContext.Pure.cs @@ -212,9 +212,7 @@ public object Service(Type service) public T Service() where T : notnull => parentContext.Service(); -#if NET8_0_OR_GREATER public T? Service(object key) where T : notnull => parentContext.Service(key); -#endif public T Resolver() => parentContext.Resolver(); diff --git a/src/HotChocolate/Core/src/Execution/Processing/OperationCompiler.cs b/src/HotChocolate/Core/src/Execution/Processing/OperationCompiler.cs index ed700e101d1..c723897d350 100644 --- a/src/HotChocolate/Core/src/Execution/Processing/OperationCompiler.cs +++ b/src/HotChocolate/Core/src/Execution/Processing/OperationCompiler.cs @@ -4,9 +4,7 @@ using HotChocolate.Resolvers; using HotChocolate.Types; using HotChocolate.Utilities; -#if NET6_0_OR_GREATER using static System.Runtime.InteropServices.CollectionsMarshal; -#endif using static System.Runtime.InteropServices.MemoryMarshal; using static System.StringComparer; using static HotChocolate.Execution.Properties.Resources; @@ -198,7 +196,6 @@ private Operation CreateOperation(OperationCompilerRequest request) variantsStart = ref Unsafe.Add(ref variantsStart, 1)!; } -#if NET5_0_OR_GREATER var optSpan = _operationOptimizers.AsSpan(); ref var optStart = ref GetReference(optSpan); ref var optEnd = ref Unsafe.Add(ref optStart, optSpan.Length); @@ -208,12 +205,6 @@ private Operation CreateOperation(OperationCompilerRequest request) optStart.OptimizeOperation(context); optStart = ref Unsafe.Add(ref optStart, 1)!; } -#else - for (var i = 0; i < _operationOptimizers.Length; i++) - { - _operationOptimizers[i].OptimizeOperation(context); - } -#endif CompleteResolvers(request.Schema); @@ -234,7 +225,6 @@ private Operation CreateOperation(OperationCompilerRequest request) private void CompleteResolvers(ISchema schema) { -#if NET6_0_OR_GREATER ref var searchSpace = ref GetReference(AsSpan(_selections)); for (var i = 0; i < _selections.Count; i++) @@ -255,25 +245,6 @@ private void CompleteResolvers(ISchema schema) selection.SetResolvers(resolver, pureResolver); } } - -#else - foreach (var selection in _selections) - { - if (selection.ResolverPipeline is null && selection.PureResolver is null) - { - var field = selection.Field; - var syntaxNode = selection.SyntaxNode; - var resolver = CreateFieldPipeline( - schema, - field, - syntaxNode, - _directiveNames, - _pipelineComponents); - var pureResolver = TryCreatePureField(schema, field, syntaxNode); - selection.SetResolvers(resolver, pureResolver); - } - } -#endif } private void CompileSelectionSet(CompilerContext context) diff --git a/src/HotChocolate/Core/src/Execution/Processing/Tasks/ResolverTask.Execute.cs b/src/HotChocolate/Core/src/Execution/Processing/Tasks/ResolverTask.Execute.cs index dcfa164fe38..23e4818bc9a 100644 --- a/src/HotChocolate/Core/src/Execution/Processing/Tasks/ResolverTask.Execute.cs +++ b/src/HotChocolate/Core/src/Execution/Processing/Tasks/ResolverTask.Execute.cs @@ -1,6 +1,4 @@ -#if NET6_0_OR_GREATER using System.Runtime.InteropServices; -#endif using HotChocolate.Execution.Internal; using HotChocolate.Types; using Microsoft.Extensions.DependencyInjection; @@ -32,12 +30,8 @@ private async Task ExecuteAsync(CancellationToken cancellationToken) break; default: -#if NET6_0_OR_GREATER _operationContext.Scheduler.Register( CollectionsMarshal.AsSpan(_taskBuffer)); -#else - _operationContext.Scheduler.Register(_taskBuffer); -#endif break; } } diff --git a/src/HotChocolate/Core/src/Execution/Processing/Tasks/ResolverTaskFactory.cs b/src/HotChocolate/Core/src/Execution/Processing/Tasks/ResolverTaskFactory.cs index ca3b3b4e7a5..5a0a459b88b 100644 --- a/src/HotChocolate/Core/src/Execution/Processing/Tasks/ResolverTaskFactory.cs +++ b/src/HotChocolate/Core/src/Execution/Processing/Tasks/ResolverTaskFactory.cs @@ -66,11 +66,7 @@ public static ObjectResult EnqueueResolverTasks( } else { - #if NET6_0_OR_GREATER scheduler.Register(CollectionsMarshal.AsSpan(bufferedTasks)); - #else - scheduler.Register(bufferedTasks); - #endif } if (selectionSet.Fragments.Count > 0) @@ -130,11 +126,7 @@ public static ResolverTask EnqueueElementTasks( // if we have child tasks we need to register them. if (bufferedTasks.Count > 0) { - #if NET6_0_OR_GREATER operationContext.Scheduler.Register(CollectionsMarshal.AsSpan(bufferedTasks)); - #else - operationContext.Scheduler.Register(bufferedTasks); - #endif } } finally diff --git a/src/HotChocolate/Core/src/Execution/Processing/WorkQueue.cs b/src/HotChocolate/Core/src/Execution/Processing/WorkQueue.cs index de0f381e919..97df830aeb2 100644 --- a/src/HotChocolate/Core/src/Execution/Processing/WorkQueue.cs +++ b/src/HotChocolate/Core/src/Execution/Processing/WorkQueue.cs @@ -25,22 +25,12 @@ public bool Complete() public bool TryTake([MaybeNullWhen(false)] out IExecutionTask executionTask) { -#if NETSTANDARD2_0 - if (_stack.Count > 0) - { - executionTask = _stack.Pop(); - Interlocked.Increment(ref _running); - return true; - } - - executionTask = default; -#else if (_stack.TryPop(out executionTask)) { Interlocked.Increment(ref _running); return true; } -#endif + return false; } diff --git a/src/HotChocolate/Core/src/Execution/Processing/WorkScheduler.Pause.cs b/src/HotChocolate/Core/src/Execution/Processing/WorkScheduler.Pause.cs index f6a0bea2f5e..4f6be9b50c9 100644 --- a/src/HotChocolate/Core/src/Execution/Processing/WorkScheduler.Pause.cs +++ b/src/HotChocolate/Core/src/Execution/Processing/WorkScheduler.Pause.cs @@ -57,11 +57,7 @@ public void TryContinue() if (continuation is not null) { -#if NET6_0_OR_GREATER ThreadPool.QueueUserWorkItem(c => c(), continuation, true); -#else - ThreadPool.QueueUserWorkItem(_ => continuation()); -#endif } } diff --git a/src/HotChocolate/Core/src/Execution/Processing/WorkScheduler.cs b/src/HotChocolate/Core/src/Execution/Processing/WorkScheduler.cs index 50aa8d785d7..5b19aa36356 100644 --- a/src/HotChocolate/Core/src/Execution/Processing/WorkScheduler.cs +++ b/src/HotChocolate/Core/src/Execution/Processing/WorkScheduler.cs @@ -37,7 +37,6 @@ public void Register(IExecutionTask task) _pause.TryContinue(); } -#if NET6_0_OR_GREATER /// /// Registers work with the task backlog. /// @@ -65,35 +64,6 @@ public void Register(ReadOnlySpan tasks) _pause.TryContinue(); } -#else - /// - /// Registers work with the task backlog. - /// - public void Register(IReadOnlyList tasks) - { - AssertNotPooled(); - - lock (_sync) - { - for (var i = 0; i < tasks.Count; i++) - { - var task = tasks[i]; - task.IsRegistered = true; - - if (task.IsSerial) - { - _serial.Push(task); - } - else - { - _work.Push(task); - } - } - } - - _pause.TryContinue(); - } -#endif /// /// Complete a task diff --git a/src/HotChocolate/Core/src/Execution/Projections/FieldRequirementsMetadata.cs b/src/HotChocolate/Core/src/Execution/Projections/FieldRequirementsMetadata.cs index 1d657bcc887..184293c2ba1 100644 --- a/src/HotChocolate/Core/src/Execution/Projections/FieldRequirementsMetadata.cs +++ b/src/HotChocolate/Core/src/Execution/Projections/FieldRequirementsMetadata.cs @@ -1,4 +1,3 @@ -#if NET6_0_OR_GREATER using System.Collections.Immutable; using HotChocolate.Types; @@ -25,4 +24,3 @@ public void TryAddRequirements(SchemaCoordinate fieldCoordinate, ImmutableArray< public void Seal() => _sealed = true; } -#endif diff --git a/src/HotChocolate/Core/src/Execution/Projections/HotChocolateExecutionDataLoaderExtensions.cs b/src/HotChocolate/Core/src/Execution/Projections/HotChocolateExecutionDataLoaderExtensions.cs index c07ef5ee662..c5f1de97a63 100644 --- a/src/HotChocolate/Core/src/Execution/Projections/HotChocolateExecutionDataLoaderExtensions.cs +++ b/src/HotChocolate/Core/src/Execution/Projections/HotChocolateExecutionDataLoaderExtensions.cs @@ -1,6 +1,3 @@ -#if NET6_0_OR_GREATER -#nullable enable - using System.Buffers; using System.Buffers.Text; using System.Diagnostics.CodeAnalysis; @@ -21,9 +18,7 @@ namespace GreenDonut.Projections; /// /// Provides extension methods for projection on DataLoader. /// -#if NET8_0_OR_GREATER [Experimental(Experiments.Projections)] -#endif public static class HotChocolateExecutionDataLoaderExtensions { private static readonly SelectionExpressionBuilder _builder = new(); @@ -214,4 +209,3 @@ private static int EstimateIntLength(int value) return length; } } -#endif diff --git a/src/HotChocolate/Core/src/Execution/Projections/PropertyNode.cs b/src/HotChocolate/Core/src/Execution/Projections/PropertyNode.cs index 56cd7e092ef..39c793de8ae 100644 --- a/src/HotChocolate/Core/src/Execution/Projections/PropertyNode.cs +++ b/src/HotChocolate/Core/src/Execution/Projections/PropertyNode.cs @@ -1,4 +1,3 @@ -#if NET6_0_OR_GREATER using System.Reflection; namespace HotChocolate.Execution.Projections; @@ -167,4 +166,3 @@ internal interface IPropertyNodeProvider void AddNode(PropertyNode newNode); } -#endif diff --git a/src/HotChocolate/Core/src/Execution/Projections/PropertyTreeBuilder.cs b/src/HotChocolate/Core/src/Execution/Projections/PropertyTreeBuilder.cs index 9448fd7e38d..0412cff21e6 100644 --- a/src/HotChocolate/Core/src/Execution/Projections/PropertyTreeBuilder.cs +++ b/src/HotChocolate/Core/src/Execution/Projections/PropertyTreeBuilder.cs @@ -1,4 +1,3 @@ -#if NET6_0_OR_GREATER using System.Collections.Immutable; using HotChocolate.Language; @@ -92,4 +91,3 @@ field.SelectionSet is not null return nodes; } } -#endif diff --git a/src/HotChocolate/Core/src/Execution/Projections/RequirementsTypeInterceptor.cs b/src/HotChocolate/Core/src/Execution/Projections/RequirementsTypeInterceptor.cs index ec5b92ad144..aeef40d934e 100644 --- a/src/HotChocolate/Core/src/Execution/Projections/RequirementsTypeInterceptor.cs +++ b/src/HotChocolate/Core/src/Execution/Projections/RequirementsTypeInterceptor.cs @@ -1,4 +1,3 @@ -#if NET6_0_OR_GREATER using System.Collections.Immutable; using HotChocolate.Configuration; using HotChocolate.Types.Descriptors; @@ -66,4 +65,3 @@ internal override void OnAfterCreateSchemaInternal( ISchema schema) => _metadata.Seal(); } -#endif diff --git a/src/HotChocolate/Core/src/Execution/Projections/SelectionExpressionBuilder.cs b/src/HotChocolate/Core/src/Execution/Projections/SelectionExpressionBuilder.cs index 69e6d7b3c65..172f03731a1 100644 --- a/src/HotChocolate/Core/src/Execution/Projections/SelectionExpressionBuilder.cs +++ b/src/HotChocolate/Core/src/Execution/Projections/SelectionExpressionBuilder.cs @@ -1,4 +1,3 @@ -#if NET6_0_OR_GREATER using System.Collections.Immutable; using System.Linq.Expressions; using System.Reflection; @@ -215,4 +214,3 @@ public ISelectionSet GetSelectionSet(ISelection selection) => Operation.GetSelectionSet(selection, (ObjectType)selection.Type.NamedType()); } } -#endif diff --git a/src/HotChocolate/Core/src/Execution/RequestExecutor.cs b/src/HotChocolate/Core/src/Execution/RequestExecutor.cs index 621b4ee822d..67d97841da1 100644 --- a/src/HotChocolate/Core/src/Execution/RequestExecutor.cs +++ b/src/HotChocolate/Core/src/Execution/RequestExecutor.cs @@ -302,13 +302,8 @@ private void EnrichContext(IRequestContext context) return; } -#if NET6_0_OR_GREATER ref var start = ref MemoryMarshal.GetArrayDataReference(_enricher); ref var end = ref Unsafe.Add(ref start, _enricher.Length); -#else - ref var start = ref MemoryMarshal.GetReference(_enricher.AsSpan()); - ref var end = ref Unsafe.Add(ref start, _enricher.Length); -#endif while (Unsafe.IsAddressLessThan(ref start, ref end)) { diff --git a/src/HotChocolate/Core/src/Execution/RequestExecutorResolver.cs b/src/HotChocolate/Core/src/Execution/RequestExecutorResolver.cs index 3c7a134a35b..64f46953f59 100644 --- a/src/HotChocolate/Core/src/Execution/RequestExecutorResolver.cs +++ b/src/HotChocolate/Core/src/Execution/RequestExecutorResolver.cs @@ -1,13 +1,8 @@ using System.Collections.Concurrent; using System.Collections.Immutable; - -#if NET6_0_OR_GREATER using System.Reflection.Metadata; -#endif using HotChocolate.Configuration; -#if NET6_0_OR_GREATER using HotChocolate.Execution; -#endif using HotChocolate.Execution.Configuration; using HotChocolate.Execution.Errors; using HotChocolate.Execution.Instrumentation; @@ -23,9 +18,7 @@ using Microsoft.Extensions.ObjectPool; using static HotChocolate.Execution.ThrowHelper; -#if NET6_0_OR_GREATER [assembly: MetadataUpdateHandler(typeof(RequestExecutorResolver.ApplicationUpdateHandler))] -#endif namespace HotChocolate.Execution; @@ -55,11 +48,9 @@ public RequestExecutorResolver( throw new ArgumentNullException(nameof(serviceProvider)); _optionsMonitor.OnChange(EvictRequestExecutor); -#if NET6_0_OR_GREATER // we register the schema eviction for application updates when hot reload is used. // Whenever a hot reload update is triggered we will evict all executors. ApplicationUpdateHandler.RegisterForApplicationUpdate(() => EvictAllRequestExecutors()); -#endif } public IObservable Events => _events; @@ -162,7 +153,6 @@ public void EvictRequestExecutor(string? schemaName = default) } } -#if NET6_0_OR_GREATER private void EvictAllRequestExecutors() { foreach (var key in _executors.Keys) @@ -189,7 +179,6 @@ private void EvictAllRequestExecutors() } } } -#endif private static void BeginRunEvictionEvents(RegisteredExecutor registeredExecutor) => Task.Factory.StartNew( @@ -724,7 +713,6 @@ private sealed class SchemaSetupInfo( public IList Pipeline { get; } = pipeline; } -#if NET6_0_OR_GREATER /// /// A helper calls that receives hot reload update events from the runtime and triggers /// reload of registered components. @@ -752,5 +740,4 @@ public static void UpdateApplication(Type[]? updatedTypes) } } } -#endif } diff --git a/src/HotChocolate/Core/src/Execution/Serialization/JsonResultFormatter.cs b/src/HotChocolate/Core/src/Execution/Serialization/JsonResultFormatter.cs index 87ef1068529..bbfb4b05af7 100644 --- a/src/HotChocolate/Core/src/Execution/Serialization/JsonResultFormatter.cs +++ b/src/HotChocolate/Core/src/Execution/Serialization/JsonResultFormatter.cs @@ -229,15 +229,9 @@ private async ValueTask FormatInternalAsync( using var buffer = new ArrayWriter(); FormatInternal(result, buffer); -#if NETSTANDARD2_0 - await outputStream - .WriteAsync(buffer.GetInternalBuffer(), 0, buffer.Length, cancellationToken) - .ConfigureAwait(false); -#else await outputStream .WriteAsync(buffer.GetWrittenMemory(), cancellationToken) .ConfigureAwait(false); -#endif await outputStream.FlushAsync(cancellationToken).ConfigureAwait(false); } @@ -277,15 +271,9 @@ private async ValueTask FormatInternalAsync( } } -#if NETSTANDARD2_0 - await outputStream - .WriteAsync(buffer.GetInternalBuffer(), 0, buffer.Length, cancellationToken) - .ConfigureAwait(false); -#else await outputStream .WriteAsync(buffer.GetWrittenMemory(), cancellationToken) .ConfigureAwait(false); -#endif await outputStream.FlushAsync(cancellationToken).ConfigureAwait(false); } @@ -311,15 +299,9 @@ private async ValueTask FormatInternalAsync( } } -#if NETSTANDARD2_0 - await outputStream - .WriteAsync(buffer.GetInternalBuffer(), 0, buffer.Length, cancellationToken) - .ConfigureAwait(false); -#else await outputStream .WriteAsync(buffer.GetWrittenMemory(), cancellationToken) .ConfigureAwait(false); -#endif await outputStream.FlushAsync(cancellationToken).ConfigureAwait(false); } @@ -660,7 +642,6 @@ private void WriteList( writer.WriteEndArray(); } -#if NET5_0_OR_GREATER private void WriteJsonElement( Utf8JsonWriter writer, JsonElement element) @@ -739,7 +720,6 @@ private void WriteJsonArray( writer.WriteEndArray(); } -#endif private void WriteFieldValue( Utf8JsonWriter writer, object? value) @@ -760,7 +740,6 @@ private void WriteFieldValue( WriteListResult(writer, resultMapList); break; -#if NET6_0_OR_GREATER case JsonDocument doc: WriteJsonElement(writer, doc.RootElement); break; @@ -772,7 +751,7 @@ private void WriteFieldValue( case RawJsonValue rawJsonValue: writer.WriteRawValue(rawJsonValue.Value.Span, true); break; -#endif + case NeedsFormatting unformatted: unformatted.FormatValue(writer, _serializerOptions); break; diff --git a/src/HotChocolate/Core/src/Features/ReadOnlyFeatureCollection.cs b/src/HotChocolate/Core/src/Features/ReadOnlyFeatureCollection.cs index 97859df245a..e2e0cd6de5d 100644 --- a/src/HotChocolate/Core/src/Features/ReadOnlyFeatureCollection.cs +++ b/src/HotChocolate/Core/src/Features/ReadOnlyFeatureCollection.cs @@ -1,7 +1,5 @@ using System.Collections; -#if NET8_0_OR_GREATER using System.Collections.Frozen; -#endif namespace HotChocolate.Features; @@ -10,11 +8,7 @@ namespace HotChocolate.Features; /// public sealed class ReadOnlyFeatureCollection : IFeatureCollection { -#if NET8_0_OR_GREATER private readonly FrozenDictionary _features; -#else - private readonly Dictionary _features; -#endif private volatile int _containerRevision; /// @@ -25,11 +19,7 @@ public sealed class ReadOnlyFeatureCollection : IFeatureCollection /// public ReadOnlyFeatureCollection(IFeatureCollection features) { -#if NET8_0_OR_GREATER _features = features.ToFrozenDictionary(); -#else - _features = features.ToDictionary(t => t.Key, t => t.Value); -#endif foreach (var feature in _features.Values) { diff --git a/src/HotChocolate/Core/src/Fetching/DataLoaderScopeHolder.cs b/src/HotChocolate/Core/src/Fetching/DataLoaderScopeHolder.cs index 3821f19a64b..d7d7351c8e8 100644 --- a/src/HotChocolate/Core/src/Fetching/DataLoaderScopeHolder.cs +++ b/src/HotChocolate/Core/src/Fetching/DataLoaderScopeHolder.cs @@ -1,6 +1,4 @@ -#if NET8_0_OR_GREATER using System.Collections.Frozen; -#endif using GreenDonut; using GreenDonut.DependencyInjection; using Microsoft.Extensions.DependencyInjection; @@ -13,19 +11,11 @@ namespace HotChocolate.Fetching; public sealed class DataLoaderScopeHolder { private static readonly AsyncLocal _currentScope = new(); -#if NET8_0_OR_GREATER private readonly FrozenDictionary _registrations; -#else - private readonly Dictionary _registrations; -#endif public DataLoaderScopeHolder(IEnumerable registrations) { -#if NET8_0_OR_GREATER _registrations = CreateRegistrations().ToFrozenDictionary(t => t.Item1, t => t.Item2); -#else - _registrations = CreateRegistrations().ToDictionary(t => t.Item1, t => t.Item2); -#endif IEnumerable<(Type, DataLoaderRegistration)> CreateRegistrations() { diff --git a/src/HotChocolate/Core/src/Fetching/ExecutionDataLoaderScope.cs b/src/HotChocolate/Core/src/Fetching/ExecutionDataLoaderScope.cs index 506bf8dab60..3151bc47b12 100644 --- a/src/HotChocolate/Core/src/Fetching/ExecutionDataLoaderScope.cs +++ b/src/HotChocolate/Core/src/Fetching/ExecutionDataLoaderScope.cs @@ -1,7 +1,5 @@ using System.Collections.Concurrent; -#if NET8_0_OR_GREATER using System.Collections.Frozen; -#endif using GreenDonut; using GreenDonut.DependencyInjection; using HotChocolate.Fetching.Properties; @@ -12,11 +10,7 @@ namespace HotChocolate.Fetching; internal sealed class ExecutionDataLoaderScope( IServiceProvider serviceProvider, IBatchScheduler batchScheduler, -#if NET8_0_OR_GREATER FrozenDictionary registrations) -#else - Dictionary registrations) -#endif : IDataLoaderScope { private readonly ConcurrentDictionary _dataLoaders = new(); diff --git a/src/HotChocolate/Core/src/Subscriptions.InMemory/HotChocolate.Subscriptions.InMemory.csproj b/src/HotChocolate/Core/src/Subscriptions.InMemory/HotChocolate.Subscriptions.InMemory.csproj index f10e5983b82..09b9c1ffe51 100644 --- a/src/HotChocolate/Core/src/Subscriptions.InMemory/HotChocolate.Subscriptions.InMemory.csproj +++ b/src/HotChocolate/Core/src/Subscriptions.InMemory/HotChocolate.Subscriptions.InMemory.csproj @@ -7,10 +7,6 @@ Contains an in-memory implementation for a Hot Chocolate GraphQL subscription provider. - - $(Library2TargetFrameworks) - - diff --git a/src/HotChocolate/Core/src/Subscriptions.Nats/HotChocolate.Subscriptions.Nats.csproj b/src/HotChocolate/Core/src/Subscriptions.Nats/HotChocolate.Subscriptions.Nats.csproj index 6f15f4f4fc8..381fd66ec28 100644 --- a/src/HotChocolate/Core/src/Subscriptions.Nats/HotChocolate.Subscriptions.Nats.csproj +++ b/src/HotChocolate/Core/src/Subscriptions.Nats/HotChocolate.Subscriptions.Nats.csproj @@ -7,10 +7,6 @@ Contains a Hot Chocolate GraphQL subscription provider for NATS. - - $(Library2TargetFrameworks) - - diff --git a/src/HotChocolate/Core/src/Subscriptions.Nats/readme.md b/src/HotChocolate/Core/src/Subscriptions.Nats/readme.md index 36849935fe1..8b7b8deeb26 100644 --- a/src/HotChocolate/Core/src/Subscriptions.Nats/readme.md +++ b/src/HotChocolate/Core/src/Subscriptions.Nats/readme.md @@ -49,9 +49,6 @@ app.UseEndpoints(ep => await app.RunAsync(); ``` -> **NOTE**: -> _You need to target net6.0 or higher to use this provider, as the NATS client dependency is not available for net5.0 or lower._ - ## Multiple Environment Support If you wish to share a NATS instance/cluster with multiple, distinct GraphQL servers, you must provide a unique subject prefix for this instance, e.g. an environment string like "dev01". This prefix is passed in the initial setup, like so: `AddNatsSubscription(prefix: "dev01")`. All servers with the same prefix will be part of the same publish/subscribe group, and will receive all messages. The prefix will be prepended to all NATS subjects with the "." subject token separator, and as such can be monitored with the NATS CLI using the > operator: diff --git a/src/HotChocolate/Core/src/Subscriptions.Postgres/ContinuousTask.cs b/src/HotChocolate/Core/src/Subscriptions.Postgres/ContinuousTask.cs index 960a3ee1927..8e723e5fda1 100644 --- a/src/HotChocolate/Core/src/Subscriptions.Postgres/ContinuousTask.cs +++ b/src/HotChocolate/Core/src/Subscriptions.Postgres/ContinuousTask.cs @@ -40,11 +40,7 @@ private async Task RunContinuously() { if (!_completion.IsCancellationRequested) { -#if NET8_0_OR_GREATER await Task.Delay(_waitOnFailure, _timeProvider, _completion.Token); -#else - await _timeProvider.Delay(_waitOnFailure, _completion.Token); -#endif } } } @@ -60,11 +56,7 @@ public async ValueTask DisposeAsync() if(!_completion.IsCancellationRequested) { -#if NET8_0_OR_GREATER await _completion.CancelAsync(); -#else - _completion.Cancel(); -#endif } _completion.Dispose(); diff --git a/src/HotChocolate/Core/src/Subscriptions.Postgres/HotChocolate.Subscriptions.Postgres.csproj b/src/HotChocolate/Core/src/Subscriptions.Postgres/HotChocolate.Subscriptions.Postgres.csproj index 0672339edb8..87d61d30d5e 100644 --- a/src/HotChocolate/Core/src/Subscriptions.Postgres/HotChocolate.Subscriptions.Postgres.csproj +++ b/src/HotChocolate/Core/src/Subscriptions.Postgres/HotChocolate.Subscriptions.Postgres.csproj @@ -7,10 +7,6 @@ Contains a Hot Chocolate GraphQL subscription provider for Postgres. - - $(Library3TargetFrameworks) - - @@ -39,8 +35,4 @@ - - - - diff --git a/src/HotChocolate/Core/src/Subscriptions.RabbitMQ/HotChocolate.Subscriptions.RabbitMQ.csproj b/src/HotChocolate/Core/src/Subscriptions.RabbitMQ/HotChocolate.Subscriptions.RabbitMQ.csproj index 257f9d1e117..b604871bfb5 100644 --- a/src/HotChocolate/Core/src/Subscriptions.RabbitMQ/HotChocolate.Subscriptions.RabbitMQ.csproj +++ b/src/HotChocolate/Core/src/Subscriptions.RabbitMQ/HotChocolate.Subscriptions.RabbitMQ.csproj @@ -7,10 +7,6 @@ Contains a Hot Chocolate GraphQL subscription provider for RabbitMQ. - - $(Library2TargetFrameworks) - - diff --git a/src/HotChocolate/Core/src/Subscriptions.Redis/HotChocolate.Subscriptions.Redis.csproj b/src/HotChocolate/Core/src/Subscriptions.Redis/HotChocolate.Subscriptions.Redis.csproj index cdffdcd838e..d6b65d59280 100644 --- a/src/HotChocolate/Core/src/Subscriptions.Redis/HotChocolate.Subscriptions.Redis.csproj +++ b/src/HotChocolate/Core/src/Subscriptions.Redis/HotChocolate.Subscriptions.Redis.csproj @@ -7,10 +7,6 @@ Contains a Redis implementation for a Hot Chocolate GraphQL subscription provider. - - $(Library2TargetFrameworks) - - diff --git a/src/HotChocolate/Core/src/Subscriptions.Serializers.Newtonsoft/HotChocolate.Subscriptions.Serializers.Newtonsoft.csproj b/src/HotChocolate/Core/src/Subscriptions.Serializers.Newtonsoft/HotChocolate.Subscriptions.Serializers.Newtonsoft.csproj index a2a5a4f9a13..af9ecc29f38 100644 --- a/src/HotChocolate/Core/src/Subscriptions.Serializers.Newtonsoft/HotChocolate.Subscriptions.Serializers.Newtonsoft.csproj +++ b/src/HotChocolate/Core/src/Subscriptions.Serializers.Newtonsoft/HotChocolate.Subscriptions.Serializers.Newtonsoft.csproj @@ -7,10 +7,6 @@ Contains an alternative message serializer for a Hot Chocolate GraphQL subscription provider that uses Newtonsoft JSON. - - $(Library2TargetFrameworks) - - diff --git a/src/HotChocolate/Core/src/Subscriptions/HotChocolate.Subscriptions.csproj b/src/HotChocolate/Core/src/Subscriptions/HotChocolate.Subscriptions.csproj index f52f4e42b59..1360ad084bd 100644 --- a/src/HotChocolate/Core/src/Subscriptions/HotChocolate.Subscriptions.csproj +++ b/src/HotChocolate/Core/src/Subscriptions/HotChocolate.Subscriptions.csproj @@ -7,10 +7,6 @@ Contains Hot Chocolate GraphQL subscriptions abstractions. - - $(Library2TargetFrameworks) - - diff --git a/src/HotChocolate/Core/src/Types.Analyzers/Errors.cs b/src/HotChocolate/Core/src/Types.Analyzers/Errors.cs index 696169cfb62..05d43557cd5 100644 --- a/src/HotChocolate/Core/src/Types.Analyzers/Errors.cs +++ b/src/HotChocolate/Core/src/Types.Analyzers/Errors.cs @@ -8,7 +8,7 @@ public static class Errors public static readonly DiagnosticDescriptor KeyParameterMissing = new( id: "HC0074", - title: "Parameter Missing.", + title: "Parameter Missing", messageFormat: SourceGenResources.DataLoader_KeyParameterMissing, category: "DataLoader", DiagnosticSeverity.Error, @@ -17,7 +17,7 @@ public static class Errors public static readonly DiagnosticDescriptor MethodAccessModifierInvalid = new( id: "HC0075", - title: "Access Modifier Invalid.", + title: "Access Modifier Invalid", messageFormat: SourceGenResources.DataLoader_InvalidAccessModifier, category: "DataLoader", DiagnosticSeverity.Error, @@ -26,8 +26,8 @@ public static class Errors public static readonly DiagnosticDescriptor ObjectTypePartialKeywordMissing = new( id: "HC0080", - title: "Partial Keyword Missing.", - messageFormat: "A split object type class needs to be a partial class.", + title: "Partial Keyword Missing", + messageFormat: "A split object type class needs to be a partial class", category: "TypeSystem", DiagnosticSeverity.Error, isEnabledByDefault: true); @@ -35,8 +35,8 @@ public static class Errors public static readonly DiagnosticDescriptor ObjectTypeStaticKeywordMissing = new( id: "HC0081", - title: "Static Keyword Missing.", - messageFormat: "A split object type class needs to be a static class.", + title: "Static Keyword Missing", + messageFormat: "A split object type class needs to be a static class", category: "TypeSystem", DiagnosticSeverity.Error, isEnabledByDefault: true); @@ -44,8 +44,8 @@ public static class Errors public static readonly DiagnosticDescriptor InterfaceTypePartialKeywordMissing = new( id: "HC0080", - title: "Partial Keyword Missing.", - messageFormat: "A split object type class needs to be a partial class.", + title: "Partial Keyword Missing", + messageFormat: "A split object type class needs to be a partial class", category: "TypeSystem", DiagnosticSeverity.Error, isEnabledByDefault: true); @@ -53,8 +53,8 @@ public static class Errors public static readonly DiagnosticDescriptor InterfaceTypeStaticKeywordMissing = new( id: "HC0081", - title: "Static Keyword Missing.", - messageFormat: "A split object type class needs to be a static class.", + title: "Static Keyword Missing", + messageFormat: "A split object type class needs to be a static class", category: "TypeSystem", DiagnosticSeverity.Error, isEnabledByDefault: true); @@ -62,8 +62,8 @@ public static class Errors public static readonly DiagnosticDescriptor TooManyNodeResolverArguments = new( id: "HC0083", - title: "Too Many Arguments.", - messageFormat: "A node resolver can only have a single field argument called `id`.", + title: "Too Many Arguments", + messageFormat: "A node resolver can only have a single field argument called `id`", category: "TypeSystem", DiagnosticSeverity.Error, isEnabledByDefault: true); @@ -71,8 +71,8 @@ public static class Errors public static readonly DiagnosticDescriptor InvalidNodeResolverArgumentName = new( id: "HC0084", - title: "Invalid Argument Name.", - messageFormat: "A node resolver can only have a single field argument called `id`.", + title: "Invalid Argument Name", + messageFormat: "A node resolver can only have a single field argument called `id`", category: "TypeSystem", DiagnosticSeverity.Error, isEnabledByDefault: true); @@ -80,8 +80,8 @@ public static class Errors public static readonly DiagnosticDescriptor DataLoaderCannotBeGeneric = new( id: "HC0085", - title: "DataLoader Cannot Be Generic.", - messageFormat: "The DataLoader source generator cannot generate generic DataLoaders.", + title: "DataLoader Cannot Be Generic", + messageFormat: "The DataLoader source generator cannot generate generic DataLoaders", category: "DataLoader", DiagnosticSeverity.Error, isEnabledByDefault: true); diff --git a/src/HotChocolate/Core/src/Types.Analyzers/HotChocolate.Types.Analyzers.csproj b/src/HotChocolate/Core/src/Types.Analyzers/HotChocolate.Types.Analyzers.csproj index 2af6186f7e6..d23de3905e6 100644 --- a/src/HotChocolate/Core/src/Types.Analyzers/HotChocolate.Types.Analyzers.csproj +++ b/src/HotChocolate/Core/src/Types.Analyzers/HotChocolate.Types.Analyzers.csproj @@ -1,11 +1,11 @@ - netstandard2.0 - netstandard2.0 + $(SourceGenTargetFrameworks) false false true + $(NoWarn);RS2008 diff --git a/src/HotChocolate/Core/src/Types.Analyzers/Properties/SourceGenResources.Designer.cs b/src/HotChocolate/Core/src/Types.Analyzers/Properties/SourceGenResources.Designer.cs index d227ef48a04..4dcfcccd2bf 100644 --- a/src/HotChocolate/Core/src/Types.Analyzers/Properties/SourceGenResources.Designer.cs +++ b/src/HotChocolate/Core/src/Types.Analyzers/Properties/SourceGenResources.Designer.cs @@ -9,34 +9,48 @@ namespace HotChocolate.Types.Analyzers.Properties { using System; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class SourceGenResources { - - private static System.Resources.ResourceManager resourceMan; - - private static System.Globalization.CultureInfo resourceCulture; - - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal SourceGenResources() { } - - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - internal static System.Resources.ResourceManager ResourceManager { + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { get { - if (object.Equals(null, resourceMan)) { - System.Resources.ResourceManager temp = new System.Resources.ResourceManager("HotChocolate.Types.Analyzers.Properties.SourceGenResources", typeof(SourceGenResources).Assembly); + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HotChocolate.Types.Analyzers.Properties.SourceGenResources", typeof(SourceGenResources).Assembly); resourceMan = temp; } return resourceMan; } } - - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - internal static System.Globalization.CultureInfo Culture { + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } @@ -44,19 +58,34 @@ internal static System.Globalization.CultureInfo Culture { resourceCulture = value; } } - - internal static string DataLoader_KeyParameterMissing { + + /// + /// Looks up a localized string similar to The DataLoader access modifier must be public or internal. + /// + internal static string DataLoader_InvalidAccessModifier { get { - return ResourceManager.GetString("DataLoader_KeyParameterMissing", resourceCulture); + return ResourceManager.GetString("DataLoader_InvalidAccessModifier", resourceCulture); } } - - internal static string DataLoader_InvalidAccessModifier { + + /// + /// Looks up a localized string similar to A DataLoader must at least provides a key or keys parameter. + /// + internal static string DataLoader_KeyParameterMissing { get { - return ResourceManager.GetString("DataLoader_InvalidAccessModifier", resourceCulture); + return ResourceManager.GetString("DataLoader_KeyParameterMissing", resourceCulture); } } - + + /// + /// Looks up a localized string similar to #pragma warning disable CS9113 // Parameter is unread. + ///namespace System.Runtime.CompilerServices + ///{ + /// [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] + /// file sealed class InterceptsLocationAttribute(string filePath, int line, int column) : Attribute; + ///} + ///#pragma warning restore CS9113 // Parameter is unread.. + /// internal static string InterceptsAttribute { get { return ResourceManager.GetString("InterceptsAttribute", resourceCulture); diff --git a/src/HotChocolate/Core/src/Types.Analyzers/Properties/SourceGenResources.resx b/src/HotChocolate/Core/src/Types.Analyzers/Properties/SourceGenResources.resx index 43a4cff6b21..04ee5074021 100644 --- a/src/HotChocolate/Core/src/Types.Analyzers/Properties/SourceGenResources.resx +++ b/src/HotChocolate/Core/src/Types.Analyzers/Properties/SourceGenResources.resx @@ -19,10 +19,10 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - A DataLoader must at least provides a key or keys parameter. + A DataLoader must at least provides a key or keys parameter - The DataLoader access modifier must be public or internal. + The DataLoader access modifier must be public or internal #pragma warning disable CS9113 // Parameter is unread. diff --git a/src/HotChocolate/Core/src/Types.CursorPagination/CursorPagingArguments.cs b/src/HotChocolate/Core/src/Types.CursorPagination/CursorPagingArguments.cs index 8d3183d21dd..b1ad327db0a 100644 --- a/src/HotChocolate/Core/src/Types.CursorPagination/CursorPagingArguments.cs +++ b/src/HotChocolate/Core/src/Types.CursorPagination/CursorPagingArguments.cs @@ -4,11 +4,7 @@ namespace HotChocolate.Types.Pagination; /// The cursor paging arguments are used to specify the /// paging behavior of the cursor based paging handler. /// -#if NET6_0_OR_GREATER public readonly record struct CursorPagingArguments -#else -public readonly struct CursorPagingArguments -#endif { /// /// Initializes a new instance of . diff --git a/src/HotChocolate/Core/src/Types.CursorPagination/CursorPagingHandler.cs b/src/HotChocolate/Core/src/Types.CursorPagination/CursorPagingHandler.cs index e5710e33486..d3a3c19a859 100644 --- a/src/HotChocolate/Core/src/Types.CursorPagination/CursorPagingHandler.cs +++ b/src/HotChocolate/Core/src/Types.CursorPagination/CursorPagingHandler.cs @@ -186,17 +186,7 @@ protected async ValueTask> SliceAsync( if (moreItemsReturnedThanRequested) { -#if NET7_OR_GREATER edges = edges.Slice(0, length); -#else - var builder = ImmutableArray.CreateBuilder>(length); - for (var i = 0; i < length; i++) - { - builder.Add(edges[i]); - } - - edges = builder.MoveToImmutable(); -#endif } var pageInfo = CreatePageInfo(isSequenceFromStart, moreItemsReturnedThanRequested, edges); diff --git a/src/HotChocolate/Core/src/Types.Errors/ErrorAttribute.cs b/src/HotChocolate/Core/src/Types.Errors/ErrorAttribute.cs index 72e07674344..ff87b91e56e 100644 --- a/src/HotChocolate/Core/src/Types.Errors/ErrorAttribute.cs +++ b/src/HotChocolate/Core/src/Types.Errors/ErrorAttribute.cs @@ -32,7 +32,6 @@ protected override void OnConfigure( => descriptor.Error(ErrorType); } -#if NET6_0_OR_GREATER /// /// The registers a middleware that will catch all exceptions of /// type on mutations and queries. @@ -46,4 +45,3 @@ public ErrorAttribute() : base(typeof(TError)) { } } -#endif diff --git a/src/HotChocolate/Core/src/Types.Queries/QueryConventionTypeInterceptor.cs b/src/HotChocolate/Core/src/Types.Queries/QueryConventionTypeInterceptor.cs index 9ba892175f4..299aacc58b6 100644 --- a/src/HotChocolate/Core/src/Types.Queries/QueryConventionTypeInterceptor.cs +++ b/src/HotChocolate/Core/src/Types.Queries/QueryConventionTypeInterceptor.cs @@ -256,11 +256,7 @@ private string CreateResultTypeName(string fieldName) if (fieldName.Length > 1) { -#if NET6_0_OR_GREATER _sb.Append(fieldName.AsSpan()[1..]); -#else - _sb.Append(fieldName.Substring(1)); -#endif } _sb.Append("Result"); diff --git a/src/HotChocolate/Core/src/Types.Scalars.Upload/StreamFile.cs b/src/HotChocolate/Core/src/Types.Scalars.Upload/StreamFile.cs index 8a0c24ceb2f..b2745221714 100644 --- a/src/HotChocolate/Core/src/Types.Scalars.Upload/StreamFile.cs +++ b/src/HotChocolate/Core/src/Types.Scalars.Upload/StreamFile.cs @@ -65,17 +65,9 @@ public virtual async Task CopyToAsync( Stream target, CancellationToken cancellationToken = default) { -#if NETSTANDARD2_0 || NETSTANDARD2_1 - using var stream = OpenReadStream(); -#else await using var stream = OpenReadStream(); -#endif -#if NETSTANDARD2_0 - await stream.CopyToAsync(target, 1024, cancellationToken).ConfigureAwait(false); -#else await stream.CopyToAsync(target, cancellationToken).ConfigureAwait(false); -#endif } /// diff --git a/src/HotChocolate/Core/src/Types.Scalars/EmailAddressType.cs b/src/HotChocolate/Core/src/Types.Scalars/EmailAddressType.cs index bcab291bec8..0a283ef66ed 100644 --- a/src/HotChocolate/Core/src/Types.Scalars/EmailAddressType.cs +++ b/src/HotChocolate/Core/src/Types.Scalars/EmailAddressType.cs @@ -10,26 +10,14 @@ namespace HotChocolate.Types; /// HTML Spec /// /// -#if NET7_0_OR_GREATER public partial class EmailAddressType : RegexType -#else -public class EmailAddressType : RegexType -#endif { private const string _validationPattern = "^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?" + "(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$"; -#if NET7_0_OR_GREATER [GeneratedRegex(_validationPattern, RegexOptions.IgnoreCase, DefaultRegexTimeoutInMs)] private static partial Regex CreateRegex(); -#else - private static Regex CreateRegex() - => new Regex( - _validationPattern, - RegexOptions.Compiled | RegexOptions.IgnoreCase, - TimeSpan.FromMilliseconds(DefaultRegexTimeoutInMs)); -#endif /// /// Initializes a new instance of the class. diff --git a/src/HotChocolate/Core/src/Types.Scalars/HexColorType.cs b/src/HotChocolate/Core/src/Types.Scalars/HexColorType.cs index 965a50a6397..162f0be88fd 100644 --- a/src/HotChocolate/Core/src/Types.Scalars/HexColorType.cs +++ b/src/HotChocolate/Core/src/Types.Scalars/HexColorType.cs @@ -7,25 +7,13 @@ namespace HotChocolate.Types; /// The `HexColor` scalar type represents a valid HEX color code as defined in /// W3 HEX notation /// -#if NET7_0_OR_GREATER public partial class HexColorType : RegexType -#else -public class HexColorType : RegexType -#endif { private const string _validationPattern = "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"; -#if NET7_0_OR_GREATER [GeneratedRegex(_validationPattern, RegexOptions.IgnoreCase, DefaultRegexTimeoutInMs)] private static partial Regex CreateRegex(); -#else - private static Regex CreateRegex() - => new Regex( - _validationPattern, - RegexOptions.Compiled | RegexOptions.IgnoreCase, - TimeSpan.FromMilliseconds(DefaultRegexTimeoutInMs)); -#endif /// /// Initializes a new instance of the class. diff --git a/src/HotChocolate/Core/src/Types.Scalars/HslType.cs b/src/HotChocolate/Core/src/Types.Scalars/HslType.cs index 55dc4bc9035..16b0756c82c 100644 --- a/src/HotChocolate/Core/src/Types.Scalars/HslType.cs +++ b/src/HotChocolate/Core/src/Types.Scalars/HslType.cs @@ -7,25 +7,13 @@ namespace HotChocolate.Types; /// The `HSL` scalar type represents a valid a CSS HSL color as defined in /// W3 HSL Colors /// -#if NET7_0_OR_GREATER public partial class HslType : RegexType -#else -public class HslType : RegexType -#endif { private const string _validationPattern = "^(?:hsla?)\\((?:\\d+%?(?:deg|rad|grad|turn)?(?:,|\\s)+){2,3}[\\s\\/]*[\\d\\.]+%?\\)"; -#if NET7_0_OR_GREATER [GeneratedRegex(_validationPattern, RegexOptions.IgnoreCase, DefaultRegexTimeoutInMs)] private static partial Regex CreateRegex(); -#else - private static Regex CreateRegex() - => new Regex( - _validationPattern, - RegexOptions.Compiled | RegexOptions.IgnoreCase, - TimeSpan.FromMilliseconds(DefaultRegexTimeoutInMs)); -#endif /// /// Initializes a new instance of the class. diff --git a/src/HotChocolate/Core/src/Types.Scalars/HslaType.cs b/src/HotChocolate/Core/src/Types.Scalars/HslaType.cs index cd894ad121f..c28f792fd54 100644 --- a/src/HotChocolate/Core/src/Types.Scalars/HslaType.cs +++ b/src/HotChocolate/Core/src/Types.Scalars/HslaType.cs @@ -7,25 +7,13 @@ namespace HotChocolate.Types; /// The `HSLA` scalar type represents a valid a CSS HSLA color as defined /// in W3 HSLA Color /// -#if NET7_0_OR_GREATER public partial class HslaType : RegexType -#else -public class HslaType : RegexType -#endif { private const string _validationPattern = "^(?:hsla?)\\((?:\\d+%?(?:deg|rad|grad|turn)?(?:,|\\s)+){2,3}[\\s\\/]*[\\d\\.]+%?\\)"; -#if NET7_0_OR_GREATER [GeneratedRegex(_validationPattern, RegexOptions.IgnoreCase, DefaultRegexTimeoutInMs)] private static partial Regex CreateRegex(); -#else - private static Regex CreateRegex() - => new Regex( - _validationPattern, - RegexOptions.Compiled | RegexOptions.IgnoreCase, - TimeSpan.FromMilliseconds(DefaultRegexTimeoutInMs)); -#endif /// /// Initializes a new instance of the class. diff --git a/src/HotChocolate/Core/src/Types.Scalars/IPv4Type.cs b/src/HotChocolate/Core/src/Types.Scalars/IPv4Type.cs index d9442f470c9..3574e0578ee 100644 --- a/src/HotChocolate/Core/src/Types.Scalars/IPv4Type.cs +++ b/src/HotChocolate/Core/src/Types.Scalars/IPv4Type.cs @@ -7,27 +7,15 @@ namespace HotChocolate.Types; /// The `IPv4` scalar type represents a valid a IPv4 address as defined in /// RFC791 /// -#if NET7_0_OR_GREATER public partial class IPv4Type : RegexType -#else -public class IPv4Type : RegexType -#endif { private const string _validationPattern = "(^(?:(?:(?:0?0?[0-9]|0?[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}(?:0?0?" + "[0-9]|0?[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\/(?:[0-9]|[1-2][0-9]|3[0" + "-2]))?)$)"; -#if NET7_0_OR_GREATER [GeneratedRegex(_validationPattern, RegexOptions.IgnoreCase, DefaultRegexTimeoutInMs)] private static partial Regex CreateRegex(); -#else - private static Regex CreateRegex() - => new Regex( - _validationPattern, - RegexOptions.Compiled | RegexOptions.IgnoreCase, - TimeSpan.FromMilliseconds(DefaultRegexTimeoutInMs)); -#endif /// /// Initializes a new instance of the class. diff --git a/src/HotChocolate/Core/src/Types.Scalars/IPv6Type.cs b/src/HotChocolate/Core/src/Types.Scalars/IPv6Type.cs index d1b5b0dcc2c..05148979319 100644 --- a/src/HotChocolate/Core/src/Types.Scalars/IPv6Type.cs +++ b/src/HotChocolate/Core/src/Types.Scalars/IPv6Type.cs @@ -7,11 +7,7 @@ namespace HotChocolate.Types; /// The `IPv6` scalar type represents a valid a IPv6 address as defined in /// RFC8064 /// -#if NET7_0_OR_GREATER public partial class IPv6Type : RegexType -#else -public class IPv6Type : RegexType -#endif { private const string _validationPattern = "(^(?:(?:(?:[0-9A-Fa-f]{1,4}:){6}(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|(?:(?:0?0?" + @@ -37,16 +33,8 @@ public class IPv6Type : RegexType "]{1,4}|(?:(?:[0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})?::)(?:\\/(?:0?0?[0-9]|0?[" + "1-9][0-9]|1[01][0-9]|12[0-8]))?)$)"; -#if NET7_0_OR_GREATER [GeneratedRegex(_validationPattern, RegexOptions.IgnoreCase, DefaultRegexTimeoutInMs)] private static partial Regex CreateRegex(); -#else - private static Regex CreateRegex() - => new Regex( - _validationPattern, - RegexOptions.Compiled | RegexOptions.IgnoreCase, - TimeSpan.FromMilliseconds(DefaultRegexTimeoutInMs)); -#endif /// /// Initializes a new instance of the class. diff --git a/src/HotChocolate/Core/src/Types.Scalars/IsbnType.cs b/src/HotChocolate/Core/src/Types.Scalars/IsbnType.cs index 85be2c73dbd..b77da7cd543 100644 --- a/src/HotChocolate/Core/src/Types.Scalars/IsbnType.cs +++ b/src/HotChocolate/Core/src/Types.Scalars/IsbnType.cs @@ -7,11 +7,7 @@ namespace HotChocolate.Types; /// The `ISBN` scalar type is a ISBN-10 or ISBN-13 number: /// https://en.wikipedia.org/wiki/International_Standard_Book_Number. /// -#if NET7_0_OR_GREATER public partial class IsbnType : RegexType -#else -public class IsbnType : RegexType -#endif { private const string _validationPattern = "^(?:ISBN(-1(?:(0)|3))?:?\\ )?(?(1)(?(2)(?=[0-9X]{10}$|(?=(?:[0-9]+[- ]){3})[- 0" + @@ -21,16 +17,8 @@ public class IsbnType : RegexType "- ]){4})[- 0-9]{17}$)(?:97[89][- ]?)?[0-9]{1,5}[- ]?[0-9]+[- ]?[0-9]+[- ]?[0-9X" + "])$"; -#if NET7_0_OR_GREATER [GeneratedRegex(_validationPattern, RegexOptions.IgnoreCase, DefaultRegexTimeoutInMs)] private static partial Regex CreateRegex(); -#else - private static Regex CreateRegex() - => new Regex( - _validationPattern, - RegexOptions.Compiled | RegexOptions.IgnoreCase, - TimeSpan.FromMilliseconds(DefaultRegexTimeoutInMs)); -#endif /// /// Initializes a new instance of the class. diff --git a/src/HotChocolate/Core/src/Types.Scalars/PhoneNumberType.cs b/src/HotChocolate/Core/src/Types.Scalars/PhoneNumberType.cs index f3c7c293517..b330f1e2976 100644 --- a/src/HotChocolate/Core/src/Types.Scalars/PhoneNumberType.cs +++ b/src/HotChocolate/Core/src/Types.Scalars/PhoneNumberType.cs @@ -7,27 +7,15 @@ namespace HotChocolate.Types; /// The `PhoneNumber` scalar type scalar type represents a value that conforms to the standard /// E.164 format. See More. /// -#if NET7_0_OR_GREATER public partial class PhoneNumberType : RegexType -#else -public class PhoneNumberType : RegexType -#endif { /// /// Regex that validates the standard E.164 format /// private const string _validationPattern = "^\\+[1-9]\\d{1,14}$"; -#if NET7_0_OR_GREATER [GeneratedRegex(_validationPattern, RegexOptions.IgnoreCase, DefaultRegexTimeoutInMs)] private static partial Regex CreateRegex(); -#else - private static Regex CreateRegex() - => new Regex( - _validationPattern, - RegexOptions.Compiled | RegexOptions.IgnoreCase, - TimeSpan.FromMilliseconds(DefaultRegexTimeoutInMs)); -#endif /// /// Initializes a new instance of the diff --git a/src/HotChocolate/Core/src/Types.Scalars/RgbType.cs b/src/HotChocolate/Core/src/Types.Scalars/RgbType.cs index b2d76203a12..35128decbe4 100644 --- a/src/HotChocolate/Core/src/Types.Scalars/RgbType.cs +++ b/src/HotChocolate/Core/src/Types.Scalars/RgbType.cs @@ -9,25 +9,13 @@ namespace HotChocolate.Types; /// MDN CSS Color /// /// -#if NET7_0_OR_GREATER public partial class RgbType : RegexType -#else -public class RgbType : RegexType -#endif { private const string _validationPattern = "((?:rgba?)\\((?:\\d+%?(?:,|\\s)+){2,3}[\\s\\/]*[\\d\\.]+%?\\))"; -#if NET7_0_OR_GREATER [GeneratedRegex(_validationPattern, RegexOptions.IgnoreCase, DefaultRegexTimeoutInMs)] private static partial Regex CreateRegex(); -#else - private static Regex CreateRegex() - => new Regex( - _validationPattern, - RegexOptions.Compiled | RegexOptions.IgnoreCase, - TimeSpan.FromMilliseconds(DefaultRegexTimeoutInMs)); -#endif /// /// Initializes a new instance of the class. diff --git a/src/HotChocolate/Core/src/Types.Scalars/RgbaType.cs b/src/HotChocolate/Core/src/Types.Scalars/RgbaType.cs index 116695fd372..3c1c5ba62f5 100644 --- a/src/HotChocolate/Core/src/Types.Scalars/RgbaType.cs +++ b/src/HotChocolate/Core/src/Types.Scalars/RgbaType.cs @@ -7,25 +7,13 @@ namespace HotChocolate.Types; /// The `Rgba` scalar type represents a valid CSS RGBA color /// /// -#if NET7_0_OR_GREATER public partial class RgbaType : RegexType -#else -public class RgbaType : RegexType -#endif { private const string _validationPattern = "((?:rgba?)\\((?:\\d+%?(?:,|\\s)+){2,3}[\\s\\/]*[\\d\\.]+%?\\))"; -#if NET7_0_OR_GREATER [GeneratedRegex(_validationPattern, RegexOptions.IgnoreCase, DefaultRegexTimeoutInMs)] private static partial Regex CreateRegex(); -#else - private static Regex CreateRegex() - => new Regex( - _validationPattern, - RegexOptions.Compiled | RegexOptions.IgnoreCase, - TimeSpan.FromMilliseconds(DefaultRegexTimeoutInMs)); -#endif /// /// Initializes a new instance of the class. diff --git a/src/HotChocolate/Core/src/Types.Shared/HotChocolate.Types.Shared.csproj b/src/HotChocolate/Core/src/Types.Shared/HotChocolate.Types.Shared.csproj index 01621bf27e6..57ff1c6cd87 100644 --- a/src/HotChocolate/Core/src/Types.Shared/HotChocolate.Types.Shared.csproj +++ b/src/HotChocolate/Core/src/Types.Shared/HotChocolate.Types.Shared.csproj @@ -7,9 +7,9 @@ Contains shared helper methods. - - true - true + + true + true diff --git a/src/HotChocolate/Core/src/Types/Configuration/AggregateTypeInterceptor.cs b/src/HotChocolate/Core/src/Types/Configuration/AggregateTypeInterceptor.cs index e87a50d12a7..ccb4dc5a639 100644 --- a/src/HotChocolate/Core/src/Types/Configuration/AggregateTypeInterceptor.cs +++ b/src/HotChocolate/Core/src/Types/Configuration/AggregateTypeInterceptor.cs @@ -467,10 +467,6 @@ public override void OnCreateSchemaError(IDescriptorContext context, Exception e private ref TypeInterceptor GetReference() { -#if NET6_0_OR_GREATER return ref MemoryMarshal.GetArrayDataReference(_typeInterceptors); -#else - return ref MemoryMarshal.GetReference(_typeInterceptors.AsSpan()); -#endif } } diff --git a/src/HotChocolate/Core/src/Types/Extensions/SchemaBuilderExtensions.Document.cs b/src/HotChocolate/Core/src/Types/Extensions/SchemaBuilderExtensions.Document.cs index 6a8b70cbd31..4da74d68011 100644 --- a/src/HotChocolate/Core/src/Types/Extensions/SchemaBuilderExtensions.Document.cs +++ b/src/HotChocolate/Core/src/Types/Extensions/SchemaBuilderExtensions.Document.cs @@ -8,11 +8,7 @@ public static partial class SchemaBuilderExtensions { public static ISchemaBuilder AddDocumentFromString( this ISchemaBuilder builder, -#if NET7_0_OR_GREATER [StringSyntax("graphql")] string schema) -#else - string schema) -#endif { if (builder is null) { diff --git a/src/HotChocolate/Core/src/Types/HotChocolate.Types.csproj b/src/HotChocolate/Core/src/Types/HotChocolate.Types.csproj index 891ab9a7e22..618c8cb90d0 100644 --- a/src/HotChocolate/Core/src/Types/HotChocolate.Types.csproj +++ b/src/HotChocolate/Core/src/Types/HotChocolate.Types.csproj @@ -55,11 +55,6 @@ - - - - - diff --git a/src/HotChocolate/Core/src/Types/Internal/IExtendedType.cs b/src/HotChocolate/Core/src/Types/Internal/IExtendedType.cs index 7914761620f..aa3d8ff4630 100644 --- a/src/HotChocolate/Core/src/Types/Internal/IExtendedType.cs +++ b/src/HotChocolate/Core/src/Types/Internal/IExtendedType.cs @@ -50,9 +50,7 @@ public interface IExtendedType : IEquatable /// Defines if this is a collection type meaning it is either or /// . /// -#if NET6_0_OR_GREATER [MemberNotNullWhen(true, nameof(ElementType))] -#endif bool IsArrayOrList { get; } /// diff --git a/src/HotChocolate/Core/src/Types/Internal/TypeComponent.cs b/src/HotChocolate/Core/src/Types/Internal/TypeComponent.cs index eb05fbe3a7e..5dca80f1683 100644 --- a/src/HotChocolate/Core/src/Types/Internal/TypeComponent.cs +++ b/src/HotChocolate/Core/src/Types/Internal/TypeComponent.cs @@ -1,6 +1,5 @@ namespace HotChocolate.Internal; -#if NET6_0_OR_GREATER public readonly record struct TypeComponent(TypeComponentKind Kind, IExtendedType Type) { public override string ToString() => Kind.ToString(); @@ -9,32 +8,3 @@ public static implicit operator TypeComponent( (TypeComponentKind, IExtendedType) component) => new(component.Item1, component.Item2); } -#else -public readonly struct TypeComponent(TypeComponentKind kind, IExtendedType type) -{ - public TypeComponentKind Kind { get; } = kind; - - public IExtendedType Type { get; } = type; - - public override bool Equals(object obj) - { - return obj is TypeComponent component && - Kind == component.Kind && - Type == component.Type; - } - - public override int GetHashCode() - { - unchecked - { - return Kind.GetHashCode() * 397 ^ Type.GetHashCode() * 397; - } - } - - public override string ToString() => Kind.ToString(); - - public static implicit operator TypeComponent( - (TypeComponentKind, IExtendedType) component) => - new TypeComponent(component.Item1, component.Item2); -} -#endif diff --git a/src/HotChocolate/Core/src/Types/Internal/TypeDiscoveryInfo.cs b/src/HotChocolate/Core/src/Types/Internal/TypeDiscoveryInfo.cs index 839ef334e11..b8d4296595d 100644 --- a/src/HotChocolate/Core/src/Types/Internal/TypeDiscoveryInfo.cs +++ b/src/HotChocolate/Core/src/Types/Internal/TypeDiscoveryInfo.cs @@ -138,7 +138,6 @@ private static bool IsComplexTypeInternal( unresolvedType.Type.IsClass && unresolvedType.Type != typeof(string); -#if NET6_0_OR_GREATER var isComplexValueType = isPublic && unresolvedType.Type is @@ -156,15 +155,6 @@ unresolvedType.Type is } return isComplexClass || isComplexValueType; -#else - if (!isComplexClass && unresolvedType.IsGeneric) - { - var typeDefinition = unresolvedType.Definition; - return typeDefinition == typeof(KeyValuePair<,>); - } - - return isComplexClass; -#endif } [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/HotChocolate/Core/src/Types/Resolvers/DefaultResolverCompiler.cs b/src/HotChocolate/Core/src/Types/Resolvers/DefaultResolverCompiler.cs index 4b6e47300dd..13613dda36c 100644 --- a/src/HotChocolate/Core/src/Types/Resolvers/DefaultResolverCompiler.cs +++ b/src/HotChocolate/Core/src/Types/Resolvers/DefaultResolverCompiler.cs @@ -538,11 +538,7 @@ private IParameterExpressionBuilder GetParameterExpressionBuilder( { if (!builder.IsDefaultHandler && builder.CanHandle(parameter)) { -#if NETSTANDARD - _cache[parameter] = builder; -#else _cache.TryAdd(parameter, builder); -#endif return builder; } } @@ -552,11 +548,7 @@ private IParameterExpressionBuilder GetParameterExpressionBuilder( { if (builder.CanHandle(parameter)) { -#if NETSTANDARD - _cache[parameter] = builder; -#else _cache.TryAdd(parameter, builder); -#endif return builder; } } @@ -567,11 +559,7 @@ private IParameterExpressionBuilder GetParameterExpressionBuilder( { if (builder.IsDefaultHandler && builder.CanHandle(parameter)) { -#if NETSTANDARD - _cache[parameter] = builder; -#else _cache.TryAdd(parameter, builder); -#endif return builder; } } @@ -583,21 +571,13 @@ private IParameterExpressionBuilder GetParameterExpressionBuilder( { if (builder.CanHandle(parameter)) { -#if NETSTANDARD - _cache[parameter] = builder; -#else _cache.TryAdd(parameter, builder); -#endif return builder; } } } -#if NETSTANDARD - _cache[parameter] = _defaultExprBuilder; -#else _cache.TryAdd(parameter, _defaultExprBuilder); -#endif return _defaultExprBuilder; } diff --git a/src/HotChocolate/Core/src/Types/Resolvers/Expressions/Parameters/ServiceExpressionHelper.cs b/src/HotChocolate/Core/src/Types/Resolvers/Expressions/Parameters/ServiceExpressionHelper.cs index f91eeb02fa6..e98771bbbc5 100644 --- a/src/HotChocolate/Core/src/Types/Resolvers/Expressions/Parameters/ServiceExpressionHelper.cs +++ b/src/HotChocolate/Core/src/Types/Resolvers/Expressions/Parameters/ServiceExpressionHelper.cs @@ -18,13 +18,11 @@ internal static class ServiceExpressionHelper method.IsGenericMethod && method.GetParameters().Length == 0); -#if NET8_0_OR_GREATER private static readonly MethodInfo _getKeyedServiceMethod = ParameterExpressionBuilderHelpers.ContextType.GetMethods().First( method => method.Name.Equals(_service, StringComparison.Ordinal) && method.IsGenericMethod && method.GetParameters().Length == 1); -#endif /// /// Builds the service expression. @@ -34,7 +32,6 @@ public static Expression Build( Expression context) => BuildDefaultService(parameter, context); -#if NET8_0_OR_GREATER /// /// Builds the service expression. /// @@ -43,7 +40,6 @@ public static Expression Build( Expression context, string key) => BuildDefaultService(parameter, context, key); -#endif private static Expression BuildDefaultService(ParameterInfo parameter, Expression context) { @@ -52,7 +48,6 @@ private static Expression BuildDefaultService(ParameterInfo parameter, Expressio return Expression.Call(context, argumentMethod); } -#if NET8_0_OR_GREATER private static Expression BuildDefaultService(ParameterInfo parameter, Expression context, string key) { var parameterType = parameter.ParameterType; @@ -60,5 +55,4 @@ private static Expression BuildDefaultService(ParameterInfo parameter, Expressio var keyExpression = Expression.Constant(key, typeof(object)); return Expression.Call(context, argumentMethod, keyExpression); } -#endif } diff --git a/src/HotChocolate/Core/src/Types/Resolvers/Expressions/Parameters/ServiceParameterExpressionBuilder.cs b/src/HotChocolate/Core/src/Types/Resolvers/Expressions/Parameters/ServiceParameterExpressionBuilder.cs index 22e75855cd7..14cce737f7b 100644 --- a/src/HotChocolate/Core/src/Types/Resolvers/Expressions/Parameters/ServiceParameterExpressionBuilder.cs +++ b/src/HotChocolate/Core/src/Types/Resolvers/Expressions/Parameters/ServiceParameterExpressionBuilder.cs @@ -26,7 +26,6 @@ public bool CanHandle(ParameterInfo parameter) public Expression Build(ParameterExpressionBuilderContext context) { -#if NET8_0_OR_GREATER var attribute = context.Parameter.GetCustomAttribute()!; if (!string.IsNullOrEmpty(attribute.Key)) @@ -34,20 +33,14 @@ public Expression Build(ParameterExpressionBuilderContext context) return ServiceExpressionHelper.Build(context.Parameter, context.ResolverContext, attribute.Key); } -#endif return ServiceExpressionHelper.Build(context.Parameter, context.ResolverContext); } public IParameterBinding Create(ParameterBindingContext context) -#if NET8_0_OR_GREATER => new ServiceParameterBinding(context.Parameter); -#else - => new ServiceParameterBinding(); -#endif private sealed class ServiceParameterBinding : IParameterBinding { -#if NET8_0_OR_GREATER public ServiceParameterBinding(ParameterInfo parameter) { var attribute = parameter.GetCustomAttribute(); @@ -55,7 +48,6 @@ public ServiceParameterBinding(ParameterInfo parameter) } public string? Key { get; } -#endif public ArgumentKind Kind => ArgumentKind.Service; @@ -63,13 +55,11 @@ public ServiceParameterBinding(ParameterInfo parameter) public T Execute(IResolverContext context) where T : notnull { -#if NET8_0_OR_GREATER if (Key is not null) { return context.Service(Key)!; } -#endif return context.Service(); } } diff --git a/src/HotChocolate/Core/src/Types/Resolvers/IResolverContext.cs b/src/HotChocolate/Core/src/Types/Resolvers/IResolverContext.cs index 7748fd9c329..93bbaded916 100644 --- a/src/HotChocolate/Core/src/Types/Resolvers/IResolverContext.cs +++ b/src/HotChocolate/Core/src/Types/Resolvers/IResolverContext.cs @@ -120,7 +120,6 @@ public interface IResolverContext : IHasContextData /// T Service() where T : notnull; -#if NET8_0_OR_GREATER /// /// Gets as required service from the dependency injection container. /// @@ -131,7 +130,6 @@ public interface IResolverContext : IHasContextData /// Returns the specified service. /// T? Service(object key) where T : notnull; -#endif /// /// Gets a resolver object containing one or more resolvers. diff --git a/src/HotChocolate/Core/src/Types/Schema.Initialization.cs b/src/HotChocolate/Core/src/Types/Schema.Initialization.cs index 39805e83bd4..7cc863535df 100644 --- a/src/HotChocolate/Core/src/Types/Schema.Initialization.cs +++ b/src/HotChocolate/Core/src/Types/Schema.Initialization.cs @@ -1,6 +1,4 @@ -#if NET8_0_OR_GREATER using System.Collections.Frozen; -#endif using HotChocolate.Configuration; using HotChocolate.Features; using HotChocolate.Types; @@ -104,11 +102,7 @@ internal void CompleteSchema(SchemaTypesDefinition schemaTypesDefinition) DirectiveTypes = schemaTypesDefinition.DirectiveTypes; _types = new SchemaTypes(schemaTypesDefinition); -#if NET8_0_OR_GREATER _directiveTypes = DirectiveTypes.ToFrozenDictionary(t => t.Name, StringComparer.Ordinal); -#else - _directiveTypes = DirectiveTypes.ToDictionary(t => t.Name, StringComparer.Ordinal); -#endif _sealed = true; } } diff --git a/src/HotChocolate/Core/src/Types/Schema.cs b/src/HotChocolate/Core/src/Types/Schema.cs index 2a06f18778f..9d38ce2d729 100644 --- a/src/HotChocolate/Core/src/Types/Schema.cs +++ b/src/HotChocolate/Core/src/Types/Schema.cs @@ -1,6 +1,4 @@ -#if NET8_0_OR_GREATER using System.Collections.Frozen; -#endif using System.Diagnostics.CodeAnalysis; using HotChocolate.Features; using HotChocolate.Language; @@ -25,11 +23,7 @@ public partial class Schema { private readonly DateTimeOffset _createdAt = DateTimeOffset.UtcNow; private SchemaTypes _types = default!; -#if NET8_0_OR_GREATER private FrozenDictionary _directiveTypes = default!; -#else - private Dictionary _directiveTypes = default!; -#endif private AggregateSchemaDocumentFormatter? _formatter; /// diff --git a/src/HotChocolate/Core/src/Types/SchemaTools.cs b/src/HotChocolate/Core/src/Types/SchemaTools.cs index 64196f89462..6593580406c 100644 --- a/src/HotChocolate/Core/src/Types/SchemaTools.cs +++ b/src/HotChocolate/Core/src/Types/SchemaTools.cs @@ -1,6 +1,3 @@ -#if NET8_0_OR_GREATER -using System.Collections.Frozen; -#endif using HotChocolate.Types; using HotChocolate.Types.Descriptors; diff --git a/src/HotChocolate/Core/src/Types/SchemaTypes.cs b/src/HotChocolate/Core/src/Types/SchemaTypes.cs index 1c2dd8ab38b..08aa0f21c23 100644 --- a/src/HotChocolate/Core/src/Types/SchemaTypes.cs +++ b/src/HotChocolate/Core/src/Types/SchemaTypes.cs @@ -1,8 +1,6 @@ #nullable enable -#if NET8_0_OR_GREATER using System.Collections.Frozen; -#endif using System.Diagnostics.CodeAnalysis; using HotChocolate.Types; using static HotChocolate.Properties.TypeResources; @@ -11,13 +9,8 @@ namespace HotChocolate; internal sealed class SchemaTypes { -#if NET8_0_OR_GREATER private readonly FrozenDictionary _types; private readonly FrozenDictionary> _possibleTypes; -#else - private readonly Dictionary _types; - private readonly Dictionary> _possibleTypes; -#endif public SchemaTypes(SchemaTypesDefinition definition) { @@ -33,13 +26,8 @@ public SchemaTypes(SchemaTypesDefinition definition) nameof(definition)); } -#if NET8_0_OR_GREATER _types = definition.Types.ToFrozenDictionary(t => t.Name, StringComparer.Ordinal); _possibleTypes = CreatePossibleTypeLookup(definition.Types).ToFrozenDictionary(StringComparer.Ordinal); -#else - _types = definition.Types.ToDictionary(t => t.Name, StringComparer.Ordinal); - _possibleTypes = CreatePossibleTypeLookup(definition.Types); -#endif QueryType = definition.QueryType!; MutationType = definition.MutationType; SubscriptionType = definition.SubscriptionType; diff --git a/src/HotChocolate/Core/src/Types/Types/Attributes/ExtendObjectTypeAttribute.cs b/src/HotChocolate/Core/src/Types/Types/Attributes/ExtendObjectTypeAttribute.cs index ae234ddab29..0fd101d665e 100644 --- a/src/HotChocolate/Core/src/Types/Types/Attributes/ExtendObjectTypeAttribute.cs +++ b/src/HotChocolate/Core/src/Types/Types/Attributes/ExtendObjectTypeAttribute.cs @@ -137,7 +137,6 @@ protected override void OnConfigure( } } -#if NET6_0_OR_GREATER /// /// Annotate classes which represent extensions to other object types. /// @@ -236,4 +235,3 @@ protected override void OnConfigure( } } } -#endif diff --git a/src/HotChocolate/Core/src/Types/Types/Descriptors/Conventions/DefaultTypeInspector.cs b/src/HotChocolate/Core/src/Types/Types/Descriptors/Conventions/DefaultTypeInspector.cs index 53b8981b2d0..847fd10c0b1 100644 --- a/src/HotChocolate/Core/src/Types/Types/Descriptors/Conventions/DefaultTypeInspector.cs +++ b/src/HotChocolate/Core/src/Types/Types/Descriptors/Conventions/DefaultTypeInspector.cs @@ -796,12 +796,8 @@ private static bool CanHandleReturnType( return HasConfiguration(member); } -#if NETSTANDARD2_0 - if (returnType.IsByRef) -#else if (returnType.IsByRefLike || returnType.IsByRef) -#endif { return false; } @@ -865,9 +861,7 @@ private static bool CanHandleParameter(ParameterInfo parameter, bool allowObject // by ref and out will never be allowed if (parameterType.IsByRef || -#if !NETSTANDARD2_0 parameter.ParameterType.IsByRefLike || -#endif parameter.IsOut) { return false; diff --git a/src/HotChocolate/Core/src/Types/Types/Descriptors/Definitions/BindableList.cs b/src/HotChocolate/Core/src/Types/Types/Descriptors/Definitions/BindableList.cs index 097f9393b8e..d0ddfbbe99c 100644 --- a/src/HotChocolate/Core/src/Types/Types/Descriptors/Definitions/BindableList.cs +++ b/src/HotChocolate/Core/src/Types/Types/Descriptors/Definitions/BindableList.cs @@ -7,9 +7,7 @@ namespace HotChocolate.Types.Descriptors.Definitions; public sealed class BindableList : IBindableList { -#if NET6_0_OR_GREATER private static readonly T[] _empty = []; -#endif private List? _list; @@ -95,7 +93,6 @@ public T this[int index] } } -#if NET6_0_OR_GREATER internal ReadOnlySpan AsSpan() { if (_list is null) @@ -105,7 +102,6 @@ internal ReadOnlySpan AsSpan() return CollectionsMarshal.AsSpan(_list); } -#endif public IEnumerator GetEnumerator() { diff --git a/src/HotChocolate/Core/src/Types/Types/DirectiveCollection.cs b/src/HotChocolate/Core/src/Types/Types/DirectiveCollection.cs index 38945ab6119..e17feaae4f8 100644 --- a/src/HotChocolate/Core/src/Types/Types/DirectiveCollection.cs +++ b/src/HotChocolate/Core/src/Types/Types/DirectiveCollection.cs @@ -241,11 +241,7 @@ internal ReadOnlySpan AsSpan() => _directives; internal ref Directive GetReference() -#if NET6_0_OR_GREATER => ref MemoryMarshal.GetArrayDataReference(_directives); -#else - => ref MemoryMarshal.GetReference(_directives.AsSpan()); -#endif /// public IEnumerator GetEnumerator() diff --git a/src/HotChocolate/Core/src/Types/Types/EnumType.Initialization.cs b/src/HotChocolate/Core/src/Types/Types/EnumType.Initialization.cs index ca1f2c3b483..e694bf34ab1 100644 --- a/src/HotChocolate/Core/src/Types/Types/EnumType.Initialization.cs +++ b/src/HotChocolate/Core/src/Types/Types/EnumType.Initialization.cs @@ -1,6 +1,4 @@ -#if NET8_0_OR_GREATER using System.Collections.Frozen; -#endif using System.Collections.Immutable; using System.Diagnostics.CodeAnalysis; using HotChocolate.Configuration; @@ -15,13 +13,8 @@ namespace HotChocolate.Types; public partial class EnumType { -#if NET8_0_OR_GREATER private FrozenDictionary _nameLookup = default!; private FrozenDictionary _valueLookup = default!; -#else - private Dictionary _nameLookup = default!; - private Dictionary _valueLookup = default!; -#endif private ImmutableArray _values; private INamingConventions _naming = default!; private Action? _configure; @@ -105,13 +98,8 @@ protected override void OnCompleteType( base.OnCompleteType(context, definition); var builder = ImmutableArray.CreateBuilder(definition.Values.Count); -#if NET8_0_OR_GREATER var nameLookupBuilder = new Dictionary(definition.NameComparer); var valueLookupBuilder = new Dictionary(definition.ValueComparer); -#else - _nameLookup = new Dictionary(definition.NameComparer); - _valueLookup = new Dictionary(definition.ValueComparer); -#endif _naming = context.DescriptorContext.Naming; foreach (var enumValueDefinition in definition.Values) @@ -123,13 +111,8 @@ protected override void OnCompleteType( if (TryCreateEnumValue(context, enumValueDefinition, out var enumValue)) { -#if NET8_0_OR_GREATER nameLookupBuilder[enumValue.Name] = enumValue; valueLookupBuilder[enumValue.Value] = enumValue; -#else - _nameLookup[enumValue.Name] = enumValue; - _valueLookup[enumValue.Value] = enumValue; -#endif builder.Add(enumValue); } } @@ -145,10 +128,8 @@ protected override void OnCompleteType( } _values = builder.ToImmutable(); -#if NET8_0_OR_GREATER _nameLookup = nameLookupBuilder.ToFrozenDictionary(definition.NameComparer); _valueLookup = valueLookupBuilder.ToFrozenDictionary(definition.ValueComparer); -#endif } protected virtual bool TryCreateEnumValue( diff --git a/src/HotChocolate/Core/src/Types/Types/Extensions/ArgumentDescriptorExtensions.cs b/src/HotChocolate/Core/src/Types/Types/Extensions/ArgumentDescriptorExtensions.cs index f1428d2d3e5..c2d7a940760 100644 --- a/src/HotChocolate/Core/src/Types/Types/Extensions/ArgumentDescriptorExtensions.cs +++ b/src/HotChocolate/Core/src/Types/Types/Extensions/ArgumentDescriptorExtensions.cs @@ -29,10 +29,7 @@ public static class ArgumentDescriptorExtensions /// public static IArgumentDescriptor DefaultValueSyntax( this IArgumentDescriptor descriptor, -#if NET7_0_OR_GREATER - [StringSyntax("graphql")] -#endif - string syntax) + [StringSyntax("graphql")] string syntax) { if (descriptor is null) { diff --git a/src/HotChocolate/Core/src/Types/Types/Extensions/DirectiveArgumentDescriptorExtensions.cs b/src/HotChocolate/Core/src/Types/Types/Extensions/DirectiveArgumentDescriptorExtensions.cs index bea12ff15ab..2004e901fe4 100644 --- a/src/HotChocolate/Core/src/Types/Types/Extensions/DirectiveArgumentDescriptorExtensions.cs +++ b/src/HotChocolate/Core/src/Types/Types/Extensions/DirectiveArgumentDescriptorExtensions.cs @@ -29,10 +29,7 @@ public static class DirectiveArgumentDescriptorExtensions /// public static IDirectiveArgumentDescriptor DefaultValueSyntax( this IDirectiveArgumentDescriptor descriptor, -#if NET7_0_OR_GREATER - [StringSyntax("graphql")] -#endif - string syntax) + [StringSyntax("graphql")] string syntax) { if (descriptor is null) { diff --git a/src/HotChocolate/Core/src/Types/Types/Extensions/InputObjectTypeDescriptorExtensions.cs b/src/HotChocolate/Core/src/Types/Types/Extensions/InputObjectTypeDescriptorExtensions.cs index 8e00229e40e..591cdf56e7e 100644 --- a/src/HotChocolate/Core/src/Types/Types/Extensions/InputObjectTypeDescriptorExtensions.cs +++ b/src/HotChocolate/Core/src/Types/Types/Extensions/InputObjectTypeDescriptorExtensions.cs @@ -153,10 +153,7 @@ public static IInputFieldDescriptor Type( /// public static IInputFieldDescriptor DefaultValueSyntax( this IInputFieldDescriptor descriptor, -#if NET7_0_OR_GREATER - [StringSyntax("graphql")] -#endif - string syntax) + [StringSyntax("graphql")] string syntax) { if (descriptor is null) { diff --git a/src/HotChocolate/Core/src/Types/Types/FieldCollection.cs b/src/HotChocolate/Core/src/Types/Types/FieldCollection.cs index dedb0fc6024..087823ba4f7 100644 --- a/src/HotChocolate/Core/src/Types/Types/FieldCollection.cs +++ b/src/HotChocolate/Core/src/Types/Types/FieldCollection.cs @@ -1,7 +1,5 @@ using System.Collections; -#if NET8_0_OR_GREATER using System.Collections.Frozen; -#endif using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; @@ -11,35 +9,18 @@ namespace HotChocolate.Types; public sealed class FieldCollection : IFieldCollection where T : class, IField { -#if NET8_0_OR_GREATER private readonly FrozenDictionary _fieldsLookup; -#else - private readonly Dictionary _fieldsLookup; -#endif private readonly T[] _fields; internal FieldCollection(T[] fields) { _fields = fields ?? throw new ArgumentNullException(nameof(fields)); -#if NET8_0_OR_GREATER _fieldsLookup = _fields.ToFrozenDictionary(t => t.Name, StringComparer.Ordinal); -#else - _fieldsLookup = new Dictionary(_fields.Length, StringComparer.Ordinal); - - foreach (var field in _fields) - { - _fieldsLookup.Add(field.Name, field); - } -#endif } private FieldCollection(Dictionary fieldsLookup, T[] fields) { -#if NET8_0_OR_GREATER _fieldsLookup = fieldsLookup.ToFrozenDictionary(StringComparer.Ordinal); -#else - _fieldsLookup = fieldsLookup; -#endif _fields = fields; } @@ -79,11 +60,7 @@ public bool TryGetField(string fieldName, [NotNullWhen(true)] out T? field) internal ReadOnlySpan AsSpan() => _fields; internal ref T GetReference() -#if NET6_0_OR_GREATER => ref MemoryMarshal.GetArrayDataReference(_fields); -#else - => ref MemoryMarshal.GetReference(_fields.AsSpan()); -#endif public IEnumerator GetEnumerator() => _fields.Length == 0 @@ -102,20 +79,10 @@ internal static FieldCollection TryCreate(T[] fields, out IReadOnlyCollection foreach (var field in internalFields) { -#if NET6_0_OR_GREATER if (!internalLookup.TryAdd(field.Name, field)) { (duplicates ??= []).Add(field.Name); } -#else - if (internalLookup.ContainsKey(field.Name)) - { - (duplicates ??= []).Add(field.Name); - continue; - } - - internalLookup.Add(field.Name, field); -#endif } if (duplicates?.Count > 0) diff --git a/src/HotChocolate/Core/src/Types/Types/Interceptors/ResolverTypeInterceptor.cs b/src/HotChocolate/Core/src/Types/Types/Interceptors/ResolverTypeInterceptor.cs index c1bbf3a3bb4..38d63ec2d25 100644 --- a/src/HotChocolate/Core/src/Types/Types/Interceptors/ResolverTypeInterceptor.cs +++ b/src/HotChocolate/Core/src/Types/Types/Interceptors/ResolverTypeInterceptor.cs @@ -417,14 +417,7 @@ private void TryBindArgumentRuntimeType( var unwrapped = Unwrap(parameter.ParameterType, type); if (unwrapped is not null) { -#if NET5_0_OR_GREATER _runtimeTypes.TryAdd(type.NamedType().Name, unwrapped); -#else - if (!_runtimeTypes.ContainsKey(type.NamedType().Name)) - { - _runtimeTypes.Add(type.NamedType().Name, unwrapped); - } -#endif } } } diff --git a/src/HotChocolate/Core/src/Types/Types/Relay/Extensions/RelayIdFieldHelpers.cs b/src/HotChocolate/Core/src/Types/Types/Relay/Extensions/RelayIdFieldHelpers.cs index 081a108ba16..9e96a048ebd 100644 --- a/src/HotChocolate/Core/src/Types/Types/Relay/Extensions/RelayIdFieldHelpers.cs +++ b/src/HotChocolate/Core/src/Types/Types/Relay/Extensions/RelayIdFieldHelpers.cs @@ -291,13 +291,6 @@ internal static void SetSerializerInfos(IDescriptorContext context, string typeN } var mappings = (Dictionary)obj!; -#if NET6_0_OR_GREATER mappings.TryAdd(typeName, runtimeTypeInfo.NamedType); -#else - if (!mappings.ContainsKey(typeName)) - { - mappings.Add(typeName, runtimeTypeInfo.NamedType); - } -#endif } } diff --git a/src/HotChocolate/Core/src/Types/Types/Relay/NodeResolverInfo.cs b/src/HotChocolate/Core/src/Types/Types/Relay/NodeResolverInfo.cs index beedb08878c..40004245e67 100644 --- a/src/HotChocolate/Core/src/Types/Types/Relay/NodeResolverInfo.cs +++ b/src/HotChocolate/Core/src/Types/Types/Relay/NodeResolverInfo.cs @@ -39,8 +39,6 @@ public NodeResolverInfo(ObjectField? resolverField, FieldDelegate pipeline) /// Defines if the node resolver was inferred from a query field. /// /// -#if NET5_0_OR_GREATER [MemberNotNullWhen(true, nameof(QueryField), nameof(Id))] -#endif public bool IsQueryFieldResolver { get; } } diff --git a/src/HotChocolate/Core/src/Types/Types/Relay/NodeResolverTypeInterceptor.cs b/src/HotChocolate/Core/src/Types/Types/Relay/NodeResolverTypeInterceptor.cs index d91e6144ac1..b2235c22c69 100644 --- a/src/HotChocolate/Core/src/Types/Types/Relay/NodeResolverTypeInterceptor.cs +++ b/src/HotChocolate/Core/src/Types/Types/Relay/NodeResolverTypeInterceptor.cs @@ -1,8 +1,6 @@ #nullable enable -#if NET5_0_OR_GREATER using System.Diagnostics.CodeAnalysis; -#endif using System.Reflection; using HotChocolate.Configuration; using HotChocolate.Language; @@ -30,9 +28,7 @@ internal sealed class NodeResolverTypeInterceptor : TypeInterceptor private ObjectTypeDefinition? TypeDef { get; set; } -#if NET5_0_OR_GREATER [MemberNotNullWhen(true, nameof(QueryType), nameof(TypeDef), nameof(CompletionContext))] -#endif private bool IsInitialized => QueryType is not null && TypeDef is not null && diff --git a/src/HotChocolate/Core/src/Types/Types/Relay/Serialization/CompositeNodeIdValueSerializer.cs b/src/HotChocolate/Core/src/Types/Types/Relay/Serialization/CompositeNodeIdValueSerializer.cs index 1da0a515c27..692fe6f1c52 100644 --- a/src/HotChocolate/Core/src/Types/Types/Relay/Serialization/CompositeNodeIdValueSerializer.cs +++ b/src/HotChocolate/Core/src/Types/Types/Relay/Serialization/CompositeNodeIdValueSerializer.cs @@ -391,11 +391,7 @@ protected static bool TryParseIdPart( return false; } -#if NETSTANDARD2_0 - value = new Guid(valueSpan.ToArray()); -#else value = new Guid(valueSpan); -#endif consumed = index + 1; return true; } diff --git a/src/HotChocolate/Core/src/Types/Types/Relay/Serialization/DefaultNodeIdSerializer.cs b/src/HotChocolate/Core/src/Types/Types/Relay/Serialization/DefaultNodeIdSerializer.cs index 6a6615c388a..62338f19280 100644 --- a/src/HotChocolate/Core/src/Types/Types/Relay/Serialization/DefaultNodeIdSerializer.cs +++ b/src/HotChocolate/Core/src/Types/Types/Relay/Serialization/DefaultNodeIdSerializer.cs @@ -275,19 +275,13 @@ public NodeId Parse(string formattedId, Type runtimeType) } private static readonly byte[] _delimiters = [_delimiter, _legacyDelimiter]; -#if NET8_0_OR_GREATER private static readonly SearchValues _delimiterSearchValues = SearchValues.Create(_delimiters); -#endif [MethodImpl(MethodImplOptions.AggressiveInlining)] private static int FindDelimiterIndex(ReadOnlySpan span) { -#if NET8_0_OR_GREATER return span.IndexOfAny(_delimiterSearchValues); -#else - return span.IndexOfAny(_delimiters); -#endif } private static void Clear(byte[]? rentedBuffer = null) diff --git a/src/HotChocolate/Core/src/Types/Types/Relay/Serialization/GuidNodeIdValueSerializer.cs b/src/HotChocolate/Core/src/Types/Types/Relay/Serialization/GuidNodeIdValueSerializer.cs index 7d0dd97caa6..e29a9a92d3c 100644 --- a/src/HotChocolate/Core/src/Types/Types/Relay/Serialization/GuidNodeIdValueSerializer.cs +++ b/src/HotChocolate/Core/src/Types/Types/Relay/Serialization/GuidNodeIdValueSerializer.cs @@ -43,11 +43,7 @@ public bool TryParse(ReadOnlySpan buffer, [NotNullWhen(true)] out object? { if(compress && buffer.Length == 16) { -#if NETSTANDARD2_0 - value = new Guid(buffer.ToArray()); -#else value = new Guid(buffer); -#endif return true; } diff --git a/src/HotChocolate/Core/src/Types/Types/Relay/Serialization/OptimizedNodeIdSerializer.cs b/src/HotChocolate/Core/src/Types/Types/Relay/Serialization/OptimizedNodeIdSerializer.cs index f15b77b9c7d..2b5869e29e8 100644 --- a/src/HotChocolate/Core/src/Types/Types/Relay/Serialization/OptimizedNodeIdSerializer.cs +++ b/src/HotChocolate/Core/src/Types/Types/Relay/Serialization/OptimizedNodeIdSerializer.cs @@ -1,9 +1,7 @@ #nullable enable using System.Buffers; using System.Buffers.Text; -#if NET8_0_OR_GREATER using System.Collections.Frozen; -#endif using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -19,11 +17,7 @@ internal sealed class OptimizedNodeIdSerializer : INodeIdSerializer private const int _stackallocThreshold = 256; private static readonly Encoding _utf8 = Encoding.UTF8; -#if NET8_0_OR_GREATER private readonly FrozenDictionary _stringSerializerMap; -#else - private readonly Dictionary _stringSerializerMap; -#endif private readonly SpanSerializerMap _spanSerializerMap; private readonly INodeIdValueSerializer[] _serializers; private readonly int _maxIdLength; @@ -35,13 +29,8 @@ internal OptimizedNodeIdSerializer( int maxIdLength = 1024, bool outputNewIdFormat = true) { -#if NET8_0_OR_GREATER _stringSerializerMap = boundSerializers.ToFrozenDictionary(t => t.TypeName, t => new Serializer(t.TypeName, t.Serializer, outputNewIdFormat)); -#else - _stringSerializerMap = - boundSerializers.ToDictionary(t => t.TypeName, t => new Serializer(t.TypeName, t.Serializer, outputNewIdFormat)); -#endif _serializers = allSerializers; _spanSerializerMap = new SpanSerializerMap(); foreach (var serializer in _stringSerializerMap.Values) @@ -237,19 +226,13 @@ private static NodeId ParseValue( } private static readonly byte[] _delimiters = [_delimiter, _legacyDelimiter]; -#if NET8_0_OR_GREATER private static readonly SearchValues _delimiterSearchValues = SearchValues.Create(_delimiters); -#endif [MethodImpl(MethodImplOptions.AggressiveInlining)] private static int FindDelimiterIndex(ReadOnlySpan span) { -#if NET8_0_OR_GREATER return span.IndexOfAny(_delimiterSearchValues); -#else - return span.IndexOfAny(_delimiters); -#endif } [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/Scalars.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/Scalars.cs index 06220becb03..7dea9963827 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/Scalars.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/Scalars.cs @@ -31,10 +31,8 @@ public static class Scalars { typeof(byte[]), typeof(ByteArrayType) }, { typeof(TimeSpan), typeof(TimeSpanType) }, -#if NET6_0_OR_GREATER { typeof(DateOnly), typeof(DateType) }, { typeof(TimeOnly), typeof(TimeSpanType) }, -#endif { typeof(JsonElement), typeof(JsonType) }, }; diff --git a/src/HotChocolate/Core/src/Types/Utilities/DefaultTypeConverter.Setup.cs b/src/HotChocolate/Core/src/Types/Utilities/DefaultTypeConverter.Setup.cs index 5d7d3f8fc50..6b149d403a8 100644 --- a/src/HotChocolate/Core/src/Types/Utilities/DefaultTypeConverter.Setup.cs +++ b/src/HotChocolate/Core/src/Types/Utilities/DefaultTypeConverter.Setup.cs @@ -77,7 +77,6 @@ private static void RegisterDateTimeConversions( : _localFormat, InvariantCulture); }); -#if NET6_0_OR_GREATER registry.Register(from => from.ToDateTime(default)); registry.Register(from => DateOnly.FromDateTime(from.Date)); registry.Register(from => from.ToDateTime(default)); @@ -93,7 +92,6 @@ private static void RegisterDateTimeConversions( registry.Register(from => TimeOnly.FromTimeSpan(from)); registry.Register(from => from.ToShortTimeString()); registry.Register(from => TimeOnly.Parse(from, InvariantCulture)); -#endif } private static void RegisterGuidConversions( diff --git a/src/HotChocolate/Core/src/Types/Utilities/ListTypeConverter.cs b/src/HotChocolate/Core/src/Types/Utilities/ListTypeConverter.cs index 05833bee77e..6e63bf30cfa 100644 --- a/src/HotChocolate/Core/src/Types/Utilities/ListTypeConverter.cs +++ b/src/HotChocolate/Core/src/Types/Utilities/ListTypeConverter.cs @@ -198,11 +198,7 @@ private static void ChangeListType( private static bool IsGenericCollection(Type type) { var interfaces = type.GetInterfaces(); -#if NET6_0_OR_GREATER ref var start = ref MemoryMarshal.GetArrayDataReference(interfaces); -#else - ref var start = ref MemoryMarshal.GetReference(interfaces.AsSpan()); -#endif for (var i = 0; i < interfaces.Length; i++) { diff --git a/src/HotChocolate/Core/src/Types/Utilities/ReferenceEqualityComparer.cs b/src/HotChocolate/Core/src/Types/Utilities/ReferenceEqualityComparer.cs deleted file mode 100644 index 4256f78abc4..00000000000 --- a/src/HotChocolate/Core/src/Types/Utilities/ReferenceEqualityComparer.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -#if NETSTANDARD2_0 -using System.Collections; -using System.Collections.Generic; -using System.Runtime.CompilerServices; - -namespace HotChocolate.Utilities; - -/// -/// An that uses reference equality () -/// instead of value equality () when comparing two object instances. -/// -/// -/// The type cannot be instantiated. Instead, use the property -/// to access the singleton instance of this type. -/// -internal sealed class ReferenceEqualityComparer : IEqualityComparer, IEqualityComparer -{ - private ReferenceEqualityComparer() { } - - /// - /// Gets the singleton instance. - /// - public static ReferenceEqualityComparer Instance { get; } = new ReferenceEqualityComparer(); - - /// - /// Determines whether two object references refer to the same object instance. - /// - /// The first object to compare. - /// The second object to compare. - /// - /// if both and refer to the same object instance - /// or if both are ; otherwise, . - /// - /// - /// This API is a wrapper around . - /// It is not necessarily equivalent to calling . - /// - public new bool Equals(object? x, object? y) => ReferenceEquals(x, y); - - /// - /// Returns a hash code for the specified object. The returned hash code is based on the object - /// identity, not on the contents of the object. - /// - /// The object for which to retrieve the hash code. - /// A hash code for the identity of . - /// - /// This API is a wrapper around . - /// It is not necessarily equivalent to calling . - /// - public int GetHashCode(object? obj) - { - // Depending on target framework, RuntimeHelpers.GetHashCode might not be annotated - // with the proper nullability attribute. We'll suppress any warning that might - // result. - return RuntimeHelpers.GetHashCode(obj!); - } -} -#endif diff --git a/src/HotChocolate/Core/src/Types/Utilities/Serialization/InputObjectConstructorResolver.cs b/src/HotChocolate/Core/src/Types/Utilities/Serialization/InputObjectConstructorResolver.cs index 96ea8674c45..2d245ef4607 100644 --- a/src/HotChocolate/Core/src/Types/Utilities/Serialization/InputObjectConstructorResolver.cs +++ b/src/HotChocolate/Core/src/Types/Utilities/Serialization/InputObjectConstructorResolver.cs @@ -157,10 +157,6 @@ public static bool TryGetParameter( private static string GetAlternativeParameterName(string name) => name.Length > 1 -#if NET6_0_OR_GREATER ? string.Concat(name[..1].ToUpperInvariant(), name.AsSpan(1)) -#else - ? string.Concat(name.Substring(0, 1).ToUpperInvariant(), name.Substring(1)) -#endif : name.ToUpperInvariant(); } diff --git a/src/HotChocolate/Core/src/Validation/DocumentValidator.cs b/src/HotChocolate/Core/src/Validation/DocumentValidator.cs index 4ce27a4755f..32362f8da70 100644 --- a/src/HotChocolate/Core/src/Validation/DocumentValidator.cs +++ b/src/HotChocolate/Core/src/Validation/DocumentValidator.cs @@ -97,11 +97,7 @@ public ValueTask ValidateAsync( PrepareContext(schema, document, documentId, context, contextData); var length = rules.Length; -#if NET6_0_OR_GREATER ref var start = ref MemoryMarshal.GetArrayDataReference(rules); -#else - ref var start = ref MemoryMarshal.GetReference(rules.AsSpan()); -#endif for (var i = 0; i < length; i++) { diff --git a/src/HotChocolate/Core/src/Validation/Rules/FieldVisitor.cs b/src/HotChocolate/Core/src/Validation/Rules/FieldVisitor.cs index 0489b425c93..f62a8572742 100644 --- a/src/HotChocolate/Core/src/Validation/Rules/FieldVisitor.cs +++ b/src/HotChocolate/Core/src/Validation/Rules/FieldVisitor.cs @@ -1,7 +1,5 @@ using System.Runtime.CompilerServices; -#if NET6_0_OR_GREATER using System.Runtime.InteropServices; -#endif using HotChocolate.Language; using HotChocolate.Language.Visitors; using HotChocolate.Types; @@ -300,9 +298,7 @@ private static void TryMergeFieldsInSet( && context.FieldSets.TryGetValue(b, out var bl)) { var mergedSet = Unsafe.As>(context.RentFieldInfoList()); -#if NET6_0_OR_GREATER mergedSet.EnsureCapacity(al.Count + bl.Count); -#endif CopyFieldInfos(Unsafe.As>(al), mergedSet); CopyFieldInfos(Unsafe.As>(bl), mergedSet); TryMergeFieldsInSet(context, mergedSet); @@ -311,12 +307,6 @@ private static void TryMergeFieldsInSet( private static void CopyFieldInfos(List from, List to) { -#if NETSTANDARD2_0 - foreach (var field in from) - { - to.Add(field); - } -#else ref var field = ref MemoryMarshal.GetReference(CollectionsMarshal.AsSpan(from)); ref var end = ref Unsafe.Add(ref field, from.Count); @@ -325,7 +315,6 @@ private static void CopyFieldInfos(List from, List to) to.Add(field); field = ref Unsafe.Add(ref field, 1); } -#endif } private static bool IsParentTypeAligned(FieldInfo fieldA, FieldInfo fieldB) @@ -436,14 +425,6 @@ private static void FillCurrentFieldPairs(IDocumentValidatorContext context) var next = context.NextFieldPairs; var current = context.CurrentFieldPairs; -#if NETSTANDARD2_0 - foreach (var pair in next) - { - current.Add(pair); - } - - next.Clear(); -#else ref var pair = ref MemoryMarshal.GetReference(CollectionsMarshal.AsSpan(next)); ref var end = ref Unsafe.Add(ref pair, next.Count); @@ -456,21 +437,12 @@ private static void FillCurrentFieldPairs(IDocumentValidatorContext context) } next.Clear(); -#endif } private static void ProcessCurrentFieldPairs(IDocumentValidatorContext context) { var current = context.CurrentFieldPairs; -#if NETSTANDARD2_0 - foreach (var pair in current) - { - TryMergeFieldsInSet(context, pair.FieldA, pair.FieldB); - } - - current.Clear(); -#else ref var pair = ref MemoryMarshal.GetReference(CollectionsMarshal.AsSpan(current)); ref var end = ref Unsafe.Add(ref pair, current.Count); @@ -481,6 +453,5 @@ private static void ProcessCurrentFieldPairs(IDocumentValidatorContext context) } current.Clear(); -#endif } } diff --git a/src/HotChocolate/Core/test/Abstractions.Tests/ErrorBuilderTests.cs b/src/HotChocolate/Core/test/Abstractions.Tests/ErrorBuilderTests.cs index 58778ff96a2..e02f3414c1b 100644 --- a/src/HotChocolate/Core/test/Abstractions.Tests/ErrorBuilderTests.cs +++ b/src/HotChocolate/Core/test/Abstractions.Tests/ErrorBuilderTests.cs @@ -1,5 +1,7 @@ using System.Collections.Immutable; +#if NET8_0 using HotChocolate.Execution; +#endif using HotChocolate.Language; namespace HotChocolate; diff --git a/src/HotChocolate/Core/test/Directory.Build.props b/src/HotChocolate/Core/test/Directory.Build.props index 17fcb6c07b9..1c5c1350a18 100644 --- a/src/HotChocolate/Core/test/Directory.Build.props +++ b/src/HotChocolate/Core/test/Directory.Build.props @@ -2,7 +2,6 @@ - $(TestTargetFrameworks) false false diff --git a/src/HotChocolate/Core/test/Execution.Tests/DependencyInjectionTests.cs b/src/HotChocolate/Core/test/Execution.Tests/DependencyInjectionTests.cs index 168d5d91c35..cdfb01fa53f 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/DependencyInjectionTests.cs +++ b/src/HotChocolate/Core/test/Execution.Tests/DependencyInjectionTests.cs @@ -141,7 +141,6 @@ public async Task Type_With_Scoped_Constructor_Injection() result.MatchSnapshot(); } -#if NET8_0_OR_GREATER [Fact] public async Task Keyed_Services_Do_Not_Throw() { @@ -169,7 +168,6 @@ await executor .ToJsonAsync() .MatchSnapshotAsync(); } -#endif public class SomeService { diff --git a/src/HotChocolate/Core/test/Execution.Tests/HotChocolate.Execution.Tests.csproj b/src/HotChocolate/Core/test/Execution.Tests/HotChocolate.Execution.Tests.csproj index 05d637d19b8..dcdde56cd1d 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/HotChocolate.Execution.Tests.csproj +++ b/src/HotChocolate/Core/test/Execution.Tests/HotChocolate.Execution.Tests.csproj @@ -4,7 +4,7 @@ HotChocolate.Execution.Tests HotChocolate.Execution enable - GD0001 + $(NoWarn);GD0001 diff --git a/src/HotChocolate/Core/test/Execution.Tests/Projections/ProjectableDataLoaderTests.cs b/src/HotChocolate/Core/test/Execution.Tests/Projections/ProjectableDataLoaderTests.cs index 517f66350a0..a8164f5f3a1 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/Projections/ProjectableDataLoaderTests.cs +++ b/src/HotChocolate/Core/test/Execution.Tests/Projections/ProjectableDataLoaderTests.cs @@ -1,4 +1,3 @@ -#if NET7_0_OR_GREATER using CookieCrumble; using GreenDonut; using GreenDonut.Projections; @@ -44,11 +43,7 @@ public async Task Brand_With_Name() } """); -#if NET8_0_OR_GREATER Snapshot.Create() -#else - Snapshot.Create(postFix: "NET7_0") -#endif .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -79,11 +74,7 @@ public async Task Manual_Include_Of_Brand() } """); -#if NET8_0_OR_GREATER Snapshot.Create() -#else - Snapshot.Create(postFix: "NET7_0") -#endif .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -118,11 +109,7 @@ public async Task Manual_Include_And_Observe_Brand() } """); -#if NET8_0_OR_GREATER Snapshot.Create() -#else - Snapshot.Create(postFix: "NET7_0") -#endif .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -153,11 +140,7 @@ public async Task Do_Not_Project() } """); -#if NET8_0_OR_GREATER Snapshot.Create() -#else - Snapshot.Create(postFix: "NET7_0") -#endif .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -191,11 +174,7 @@ public async Task Project_And_Do_Not_Project() } """); -#if NET8_0_OR_GREATER Snapshot.Create() -#else - Snapshot.Create(postFix: "NET7_0") -#endif .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -229,11 +208,7 @@ public async Task Product_With_Name_And_Brand_With_Name() } """); -#if NET8_0_OR_GREATER Snapshot.Create() -#else - Snapshot.Create(postFix: "NET7_0") -#endif .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -273,11 +248,7 @@ public async Task Force_A_Branch() } """); -#if NET8_0_OR_GREATER Snapshot.Create() -#else - Snapshot.Create(postFix: "NET7_0") -#endif .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -317,11 +288,7 @@ public async Task Branches_Are_Merged() } """); -#if NET8_0_OR_GREATER Snapshot.Create() -#else - Snapshot.Create(postFix: "NET7_0") -#endif .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -357,11 +324,7 @@ public async Task Brand_Details_Country_Name() } """); -#if NET8_0_OR_GREATER Snapshot.Create() -#else - Snapshot.Create(postFix: "NET7_0") -#endif .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -398,11 +361,7 @@ public async Task Brand_Details_Country_Name_With_Details_As_Custom_Resolver() } """); -#if NET8_0_OR_GREATER Snapshot.Create() -#else - Snapshot.Create(postFix: "NET7_0") -#endif .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -434,11 +393,7 @@ public async Task Brand_Details_Requires_Brand_Name() } """); -#if NET8_0_OR_GREATER Snapshot.Create() -#else - Snapshot.Create(postFix: "NET7_0") -#endif .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -473,11 +428,7 @@ public async Task Brand_Products_TypeName() // at the moment we do not support projections on lists // so products will be empty and we will just select the brand.Id -#if NET8_0_OR_GREATER Snapshot.Create() -#else - Snapshot.Create(postFix: "NET7_0") -#endif .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -509,11 +460,7 @@ public async Task Brand_Only_TypeName() } """); -#if NET8_0_OR_GREATER Snapshot.Create() -#else - Snapshot.Create(postFix: "NET7_0") -#endif .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -681,4 +628,3 @@ public static Snapshot AddResult(this Snapshot snapshot, IExecutionResult result return snapshot; } } -#endif diff --git a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Branches_Are_Merged_NET7_0.md b/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Branches_Are_Merged_NET7_0.md deleted file mode 100644 index 185b19dd69f..00000000000 --- a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Branches_Are_Merged_NET7_0.md +++ /dev/null @@ -1,32 +0,0 @@ -# Branches_Are_Merged - -## SQL - -```text -SELECT p."Name", b."Name", p."Id" -FROM "Products" AS p -INNER JOIN "Brands" AS b ON p."BrandId" = b."Id" -WHERE p."Id" IN (1, 2) -``` - -## Result - -```json -{ - "data": { - "a": { - "name": "Product 0-0", - "brand": { - "name": "Brand0" - } - }, - "b": { - "name": "Product 0-1", - "brand": { - "name": "Brand0" - } - } - } -} -``` - diff --git a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_NET7_0.md b/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_NET7_0.md deleted file mode 100644 index a5a7f99d878..00000000000 --- a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_NET7_0.md +++ /dev/null @@ -1,27 +0,0 @@ -# Brand_Details_Country_Name - -## SQL - -```text -SELECT b."Name", b."Details_Country_Name" AS "Name", b."Id" -FROM "Brands" AS b -WHERE b."Id" = 1 -``` - -## Result - -```json -{ - "data": { - "brandById": { - "name": "Brand0", - "details": { - "country": { - "name": "Country0" - } - } - } - } -} -``` - diff --git a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_With_Details_As_Custom_Resolver_NET7_0.md b/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_With_Details_As_Custom_Resolver_NET7_0.md deleted file mode 100644 index bd92975e965..00000000000 --- a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_With_Details_As_Custom_Resolver_NET7_0.md +++ /dev/null @@ -1,27 +0,0 @@ -# Brand_Details_Country_Name_With_Details_As_Custom_Resolver - -## SQL - -```text -SELECT b."Name", b."Id" -FROM "Brands" AS b -WHERE b."Id" = 1 -``` - -## Result - -```json -{ - "data": { - "brandById": { - "name": "Brand0", - "details": { - "country": { - "name": "Germany" - } - } - } - } -} -``` - diff --git a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_NET7_0.md b/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_NET7_0.md deleted file mode 100644 index ba64a61032e..00000000000 --- a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_NET7_0.md +++ /dev/null @@ -1,22 +0,0 @@ -# Brand_Details_Requires_Brand_Name - -## SQL - -```text -SELECT b."Name", b."Id" -FROM "Brands" AS b -WHERE b."Id" = 1 -``` - -## Result - -```json -{ - "data": { - "brandById": { - "details": "Brand Name:Brand0" - } - } -} -``` - diff --git a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_Only_TypeName_NET7_0.md b/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_Only_TypeName_NET7_0.md deleted file mode 100644 index e2cf36cd390..00000000000 --- a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_Only_TypeName_NET7_0.md +++ /dev/null @@ -1,22 +0,0 @@ -# Brand_Only_TypeName - -## SQL - -```text -SELECT b."Id" -FROM "Brands" AS b -WHERE b."Id" = 1 -``` - -## Result - -```json -{ - "data": { - "brandById": { - "__typename": "Brand" - } - } -} -``` - diff --git a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_Products_TypeName_NET7_0.md b/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_Products_TypeName_NET7_0.md deleted file mode 100644 index 5a9f23485ed..00000000000 --- a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_Products_TypeName_NET7_0.md +++ /dev/null @@ -1,22 +0,0 @@ -# Brand_Products_TypeName - -## SQL - -```text -SELECT b."Id" -FROM "Brands" AS b -WHERE b."Id" = 1 -``` - -## Result - -```json -{ - "data": { - "brandById": { - "products": [] - } - } -} -``` - diff --git a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_NET7_0.md b/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_NET7_0.md deleted file mode 100644 index d9a75f58b57..00000000000 --- a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_NET7_0.md +++ /dev/null @@ -1,22 +0,0 @@ -# Brand_With_Name - -## SQL - -```text -SELECT b."Name", b."Id" -FROM "Brands" AS b -WHERE b."Id" = 1 -``` - -## Result - -```json -{ - "data": { - "brandById": { - "name": "Brand0" - } - } -} -``` - diff --git a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Do_Not_Project_NET7_0.md b/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Do_Not_Project_NET7_0.md deleted file mode 100644 index dc5a17e0569..00000000000 --- a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Do_Not_Project_NET7_0.md +++ /dev/null @@ -1,22 +0,0 @@ -# Do_Not_Project - -## SQL - -```text -SELECT b."Id", b."DisplayName", b."Name", b."Details_Country_Name" -FROM "Brands" AS b -WHERE b."Id" = 1 -``` - -## Result - -```json -{ - "data": { - "brandByIdNoProjection": { - "name": "Brand0" - } - } -} -``` - diff --git a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Force_A_Branch_NET7_0.md b/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Force_A_Branch_NET7_0.md deleted file mode 100644 index 293c0b0bf66..00000000000 --- a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Force_A_Branch_NET7_0.md +++ /dev/null @@ -1,36 +0,0 @@ -# Force_A_Branch - -## SQL - -```text -SELECT p."Name", b."Name", p."Id" -FROM "Products" AS p -INNER JOIN "Brands" AS b ON p."BrandId" = b."Id" -WHERE p."Id" = 1 -SELECT p."Id", b."Id" -FROM "Products" AS p -INNER JOIN "Brands" AS b ON p."BrandId" = b."Id" -WHERE p."Id" = 1 -``` - -## Result - -```json -{ - "data": { - "a": { - "name": "Product 0-0", - "brand": { - "name": "Brand0" - } - }, - "b": { - "id": 1, - "brand": { - "id": 1 - } - } - } -} -``` - diff --git a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Manual_Include_Of_Brand_NET7_0.md b/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Manual_Include_Of_Brand_NET7_0.md deleted file mode 100644 index 48f7489e105..00000000000 --- a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Manual_Include_Of_Brand_NET7_0.md +++ /dev/null @@ -1,23 +0,0 @@ -# Manual_Include_Of_Brand - -## SQL - -```text -SELECT p."Name", b."Id", b."DisplayName", b."Name", b."Details_Country_Name", p."Id" -FROM "Products" AS p -INNER JOIN "Brands" AS b ON p."BrandId" = b."Id" -WHERE p."Id" = 1 -``` - -## Result - -```json -{ - "data": { - "productByIdWithBrand": { - "name": "Product 0-0" - } - } -} -``` - diff --git a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Product_With_Name_And_Brand_With_Name_NET7_0.md b/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Product_With_Name_And_Brand_With_Name_NET7_0.md deleted file mode 100644 index b4823d43c47..00000000000 --- a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Product_With_Name_And_Brand_With_Name_NET7_0.md +++ /dev/null @@ -1,26 +0,0 @@ -# Product_With_Name_And_Brand_With_Name - -## SQL - -```text -SELECT p."Name", b."Name", p."Id" -FROM "Products" AS p -INNER JOIN "Brands" AS b ON p."BrandId" = b."Id" -WHERE p."Id" = 1 -``` - -## Result - -```json -{ - "data": { - "productById": { - "name": "Product 0-0", - "brand": { - "name": "Brand0" - } - } - } -} -``` - diff --git a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Project_And_Do_Not_Project_NET7_0.md b/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Project_And_Do_Not_Project_NET7_0.md deleted file mode 100644 index 19c433f7831..00000000000 --- a/src/HotChocolate/Core/test/Execution.Tests/Projections/__snapshots__/ProjectableDataLoaderTests.Project_And_Do_Not_Project_NET7_0.md +++ /dev/null @@ -1,28 +0,0 @@ -# Project_And_Do_Not_Project - -## SQL - -```text -SELECT b."Id", b."DisplayName", b."Name", b."Details_Country_Name" -FROM "Brands" AS b -WHERE b."Id" = 1 -SELECT b."Name", b."Id" -FROM "Brands" AS b -WHERE b."Id" = 1 -``` - -## Result - -```json -{ - "data": { - "brandByIdNoProjection": { - "name": "Brand0" - }, - "brandById": { - "name": "Brand0" - } - } -} -``` - diff --git a/src/HotChocolate/Core/test/Subscriptions.Postgres.Tests/HotChocolate.Subscriptions.Postgres.Tests.csproj b/src/HotChocolate/Core/test/Subscriptions.Postgres.Tests/HotChocolate.Subscriptions.Postgres.Tests.csproj index e395cdefd19..b158594620c 100644 --- a/src/HotChocolate/Core/test/Subscriptions.Postgres.Tests/HotChocolate.Subscriptions.Postgres.Tests.csproj +++ b/src/HotChocolate/Core/test/Subscriptions.Postgres.Tests/HotChocolate.Subscriptions.Postgres.Tests.csproj @@ -3,7 +3,6 @@ HotChocolate.Subscriptions.Postgres.Tests HotChocolate.Subscriptions.Postgres - net7.0;net8.0 diff --git a/src/HotChocolate/Core/test/Types.Analyzers.Tests/HotChocolate.Types.Analyzers.Tests.csproj b/src/HotChocolate/Core/test/Types.Analyzers.Tests/HotChocolate.Types.Analyzers.Tests.csproj index c9706526bc5..39e9dfeaeda 100644 --- a/src/HotChocolate/Core/test/Types.Analyzers.Tests/HotChocolate.Types.Analyzers.Tests.csproj +++ b/src/HotChocolate/Core/test/Types.Analyzers.Tests/HotChocolate.Types.Analyzers.Tests.csproj @@ -1,8 +1,6 @@ - net8.0 - false $(InterceptorsPreviewNamespaces);HotChocolate.Execution.Generated @@ -13,7 +11,7 @@ HotChocolate.Types.Analyzers.Tests HotChocolate.Types - GD0001 + $(NoWarn);GD0001 @@ -23,7 +21,8 @@ - + + diff --git a/src/HotChocolate/Core/test/Types.Analyzers.Tests/TestHelper.cs b/src/HotChocolate/Core/test/Types.Analyzers.Tests/TestHelper.cs index fa2d79153ec..be1ba96d25e 100644 --- a/src/HotChocolate/Core/test/Types.Analyzers.Tests/TestHelper.cs +++ b/src/HotChocolate/Core/test/Types.Analyzers.Tests/TestHelper.cs @@ -25,6 +25,12 @@ public static Snapshot GetGeneratedSourceSnapshot([StringSyntax("csharp")] strin IEnumerable references = [ +#if NET8_0 + .. Net80.References.All, +#elif NET9_0 + .. Net90.References.All, +#endif + // HotChocolate.Types MetadataReference.CreateFromFile(typeof(ObjectTypeAttribute).Assembly.Location), @@ -42,7 +48,7 @@ public static Snapshot GetGeneratedSourceSnapshot([StringSyntax("csharp")] strin var compilation = CSharpCompilation.Create( assemblyName: "Tests", syntaxTrees: [syntaxTree], - ReferenceAssemblies.Net80.Concat(references)); + references); // Create an instance of our GraphQLServerGenerator incremental source generator. var generator = new GraphQLServerGenerator(); diff --git a/src/HotChocolate/Core/test/Types.Analyzers.Tests/__snapshots__/DataLoaderTests.GenerateSource_GenericBatchDataLoader_MatchesSnapshot.md b/src/HotChocolate/Core/test/Types.Analyzers.Tests/__snapshots__/DataLoaderTests.GenerateSource_GenericBatchDataLoader_MatchesSnapshot.md index d15e2b0ed88..c4e26e51868 100644 --- a/src/HotChocolate/Core/test/Types.Analyzers.Tests/__snapshots__/DataLoaderTests.GenerateSource_GenericBatchDataLoader_MatchesSnapshot.md +++ b/src/HotChocolate/Core/test/Types.Analyzers.Tests/__snapshots__/DataLoaderTests.GenerateSource_GenericBatchDataLoader_MatchesSnapshot.md @@ -4,12 +4,12 @@ [ { "Id": "HC0085", - "Title": "DataLoader Cannot Be Generic.", + "Title": "DataLoader Cannot Be Generic", "Severity": "Error", "WarningLevel": 0, "Location": ": (11,4)-(11,17)", - "MessageFormat": "The DataLoader source generator cannot generate generic DataLoaders.", - "Message": "The DataLoader source generator cannot generate generic DataLoaders.", + "MessageFormat": "The DataLoader source generator cannot generate generic DataLoaders", + "Message": "The DataLoader source generator cannot generate generic DataLoaders", "Category": "DataLoader", "CustomTags": [] } diff --git a/src/HotChocolate/Core/test/Types.Records.Tests/HotChocolate.Types.Records.Tests.csproj b/src/HotChocolate/Core/test/Types.Records.Tests/HotChocolate.Types.Records.Tests.csproj index 05f2ce5aa2f..ba64b5ab786 100644 --- a/src/HotChocolate/Core/test/Types.Records.Tests/HotChocolate.Types.Records.Tests.csproj +++ b/src/HotChocolate/Core/test/Types.Records.Tests/HotChocolate.Types.Records.Tests.csproj @@ -1,9 +1,5 @@ - - $(Library2TargetFrameworks) - - diff --git a/src/HotChocolate/Core/test/Types.Tests/Resolvers/ResolverServiceTests.cs b/src/HotChocolate/Core/test/Types.Tests/Resolvers/ResolverServiceTests.cs index 1ee0985b347..bc74bbf03da 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Resolvers/ResolverServiceTests.cs +++ b/src/HotChocolate/Core/test/Types.Tests/Resolvers/ResolverServiceTests.cs @@ -298,7 +298,6 @@ public async Task Mutation_Resolver_Service_Inferred_Scope_Overridden_On_Resolve result.MatchMarkdownSnapshot(); } -#if NET8_0_OR_GREATER [Fact] public async Task Resolver_KeyedService() { @@ -315,7 +314,6 @@ public async Task Resolver_KeyedService() result.MatchMarkdownSnapshot(); } -#endif public sealed class SayHelloService { @@ -368,7 +366,6 @@ public override void Return(SayHelloService obj) } } -#if NET8_0_OR_GREATER public class Query { public string Foo([AbcService] KeyedService service) @@ -381,5 +378,4 @@ public class KeyedService(string key) } public class AbcService() : ServiceAttribute("abc"); -#endif } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/ObjectTypeExtensionTests.cs b/src/HotChocolate/Core/test/Types.Tests/Types/ObjectTypeExtensionTests.cs index 8627cbe2728..de5018111eb 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/ObjectTypeExtensionTests.cs +++ b/src/HotChocolate/Core/test/Types.Tests/Types/ObjectTypeExtensionTests.cs @@ -432,7 +432,6 @@ public async Task BindByType() .MatchSnapshotAsync(); } -#if NET6_0_OR_GREATER [Fact] public async Task BindByType_With_Generic_Attribute() { @@ -446,7 +445,6 @@ public async Task BindByType_With_Generic_Attribute() .BuildSchemaAsync() .MatchSnapshotAsync(); } -#endif [Fact] public async Task BindResolver_With_Property() @@ -596,7 +594,6 @@ public async Task Ensure_Member_And_ResolverMember_Are_Correctly_Set_When_Extend Assert.Equal("GetFoo1", field.ResolverMember?.Name); } -#if NET6_0_OR_GREATER [Fact] public async Task Ensure_Member_And_ResolverMember_Are_Correctly_Set_When_Extending_Generic() { @@ -611,7 +608,6 @@ public async Task Ensure_Member_And_ResolverMember_Are_Correctly_Set_When_Extend Assert.Equal("GetFoo", field.Member?.Name); Assert.Equal("GetFoo1", field.ResolverMember?.Name); } -#endif [Fact] public async Task Ensure_Member_And_ResolverMember_Are_The_Same_When_Not_Extending() @@ -921,7 +917,6 @@ public class Extensions } } -#if NET6_0_OR_GREATER [ExtendObjectType] public class Extensions2 { @@ -954,7 +949,6 @@ public class Extensions2 return new(); } } -#endif public interface IMarker { @@ -1098,14 +1092,12 @@ public class ObjectField_Test_Query_Extension public string GetFoo1() => null!; } -#if NET6_0_OR_GREATER [ExtendObjectType] public class ObjectField_Test_Query_Extension_Generic { [BindMember(nameof(ObjectField_Test_Query.GetFoo))] public string GetFoo1() => null!; } -#endif public class FooQueryType : ObjectType { diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/ObjectTypeTests.cs b/src/HotChocolate/Core/test/Types.Tests/Types/ObjectTypeTests.cs index 1cf580e0bf9..f9340ea4421 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/ObjectTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.Tests/Types/ObjectTypeTests.cs @@ -1305,7 +1305,6 @@ public void Support_Argument_Attributes() schema.ToString().MatchSnapshot(); } -#if NET6_0_OR_GREATER [Fact] public void Support_Argument_Generic_Attributes() { @@ -1318,7 +1317,6 @@ public void Support_Argument_Generic_Attributes() // assert schema.ToString().MatchSnapshot(); } -#endif [Fact] public void Argument_Type_IsInferred_From_Parameter() @@ -2189,7 +2187,6 @@ public string Qux( public string Quux([GraphQLType(typeof(ListType))] string arg) => arg; } -#if NET6_0_OR_GREATER public class Baz2 { public string Qux( @@ -2198,7 +2195,6 @@ public string Qux( public string Quux([GraphQLType>] string arg) => arg; } -#endif public class FooType : ObjectType diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/DateTypeTests.cs b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/DateTypeTests.cs index 9f3afddc3cf..43781212fdd 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/DateTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/DateTypeTests.cs @@ -343,7 +343,6 @@ public void DateType_Binds_Only_Explicitly() Assert.IsType(dateTimeType); } -#if NET6_0_OR_GREATER [Fact] public async Task DateOnly_And_TimeOnly_As_Argument_Schema() { @@ -405,7 +404,6 @@ public async Task DateOnly_And_TimeOnly_As_ReturnValue() }") .MatchSnapshotAsync(); } -#endif public class Query { @@ -415,7 +413,6 @@ public class Query public DateTime? DateTimeField => DateTime.UtcNow; } -#if NET6_0_OR_GREATER public class QueryDateTime1 { public Foo Foo => new(); @@ -440,5 +437,4 @@ public class Bar public DateOnly GetDate() => DateOnly.MaxValue; } -#endif } diff --git a/src/HotChocolate/CostAnalysis/Directory.Build.props b/src/HotChocolate/CostAnalysis/Directory.Build.props index e2f24e898bb..ea6e2bc3aaf 100644 --- a/src/HotChocolate/CostAnalysis/Directory.Build.props +++ b/src/HotChocolate/CostAnalysis/Directory.Build.props @@ -1,8 +1,4 @@ - - $(Library3TargetFrameworks) - - diff --git a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/StaticQueryAnalysisTests.Execute_ConnectionQuery_ReturnsExpectedResult_NET7_0.md b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/StaticQueryAnalysisTests.Execute_ConnectionQuery_ReturnsExpectedResult_NET7_0.md deleted file mode 100644 index 3f703422d52..00000000000 --- a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/StaticQueryAnalysisTests.Execute_ConnectionQuery_ReturnsExpectedResult_NET7_0.md +++ /dev/null @@ -1,117 +0,0 @@ -# Execute_ConnectionQuery_ReturnsExpectedResult - -## Schema - -```text -type Query { - examples1(first: Int, after: String, last: Int, before: String): Examples1Connection - @listSize(slicingArguments: ["first", "last"], sizedFields: ["edges", "nodes"]) -} - -type Example1 { - field1: Boolean! - field2(first: Int, after: String, last: Int, before: String): Examples2Connection - @listSize(slicingArguments: ["first", "last"], sizedFields: ["edges"]) -} - -type Example2 { - field1: Boolean! - field2: Int! -} - -type Examples1Connection { - pageInfo: PageInfo! - edges: [Examples1Edge!] - nodes: [Example1!] -} - -type Examples2Connection { - pageInfo: PageInfo! - edges: [Examples2Edge!] - nodes: [Example2!] -} - -type Examples1Edge { - cursor: String! - node: Example1! -} - -type Examples2Edge { - cursor: String! - node: Example2! -} - -type PageInfo { - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String - endCursor: String -} -``` - -## Query - -```text -query { - examples1(first: 10) { # Examples1Connection x1 - pageInfo { # PageInfo x1 - hasNextPage # Boolean x1 - } - edges { # Examples1Edge x10 - node { # Example1 x10 - field1 # Boolean x10 - field2(first: 10) { # Examples2Connection x10 - pageInfo { # PageInfo x10 - hasNextPage # Boolean x10 - } - edges { # Examples2Edge x(10x10) - node { # Example2 x(10x10) - field1 # Boolean x(10x10) - field2 # Int x(10x10) - } - } - } - } - } - nodes { # Example1 x10 - field1 # Boolean x10 - } -} - - __cost { - requestCosts { - fieldCounts { name, value } - typeCounts { name, value } - inputTypeCounts { name, value } - inputFieldCounts { name, value } - argumentCounts { name, value } - directiveCounts { name, value } - } - } -} -``` - -## Result Result: - -```text -{ - "errors": [ - { - "message": "The field `__cost` does not exist on the type `Query`.", - "locations": [ - { - "line": 27, - "column": 5 - } - ], - "extensions": { - "type": "Query", - "field": "__cost", - "responseName": "__cost", - "specifiedBy": "https://spec.graphql.org/October2021/#sec-Field-Selections-on-Objects-Interfaces-and-Unions-Types" - } - } - ] -} -``` - diff --git a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/StaticQueryAnalysisTests.Execute_ConnectionQuery_ReturnsExpectedResult_NET8_0.md b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/StaticQueryAnalysisTests.Execute_ConnectionQuery_ReturnsExpectedResult_NET8_0.md deleted file mode 100644 index 3f703422d52..00000000000 --- a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/StaticQueryAnalysisTests.Execute_ConnectionQuery_ReturnsExpectedResult_NET8_0.md +++ /dev/null @@ -1,117 +0,0 @@ -# Execute_ConnectionQuery_ReturnsExpectedResult - -## Schema - -```text -type Query { - examples1(first: Int, after: String, last: Int, before: String): Examples1Connection - @listSize(slicingArguments: ["first", "last"], sizedFields: ["edges", "nodes"]) -} - -type Example1 { - field1: Boolean! - field2(first: Int, after: String, last: Int, before: String): Examples2Connection - @listSize(slicingArguments: ["first", "last"], sizedFields: ["edges"]) -} - -type Example2 { - field1: Boolean! - field2: Int! -} - -type Examples1Connection { - pageInfo: PageInfo! - edges: [Examples1Edge!] - nodes: [Example1!] -} - -type Examples2Connection { - pageInfo: PageInfo! - edges: [Examples2Edge!] - nodes: [Example2!] -} - -type Examples1Edge { - cursor: String! - node: Example1! -} - -type Examples2Edge { - cursor: String! - node: Example2! -} - -type PageInfo { - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String - endCursor: String -} -``` - -## Query - -```text -query { - examples1(first: 10) { # Examples1Connection x1 - pageInfo { # PageInfo x1 - hasNextPage # Boolean x1 - } - edges { # Examples1Edge x10 - node { # Example1 x10 - field1 # Boolean x10 - field2(first: 10) { # Examples2Connection x10 - pageInfo { # PageInfo x10 - hasNextPage # Boolean x10 - } - edges { # Examples2Edge x(10x10) - node { # Example2 x(10x10) - field1 # Boolean x(10x10) - field2 # Int x(10x10) - } - } - } - } - } - nodes { # Example1 x10 - field1 # Boolean x10 - } -} - - __cost { - requestCosts { - fieldCounts { name, value } - typeCounts { name, value } - inputTypeCounts { name, value } - inputFieldCounts { name, value } - argumentCounts { name, value } - directiveCounts { name, value } - } - } -} -``` - -## Result Result: - -```text -{ - "errors": [ - { - "message": "The field `__cost` does not exist on the type `Query`.", - "locations": [ - { - "line": 27, - "column": 5 - } - ], - "extensions": { - "type": "Query", - "field": "__cost", - "responseName": "__cost", - "specifiedBy": "https://spec.graphql.org/October2021/#sec-Field-Selections-on-Objects-Interfaces-and-Unions-Types" - } - } - ] -} -``` - diff --git a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/StaticQueryAnalysisTests.Execute_ListQuery_ReturnsExpectedResult_NET7_0.md b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/StaticQueryAnalysisTests.Execute_ListQuery_ReturnsExpectedResult_NET7_0.md deleted file mode 100644 index 2d89981237c..00000000000 --- a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/StaticQueryAnalysisTests.Execute_ListQuery_ReturnsExpectedResult_NET7_0.md +++ /dev/null @@ -1,78 +0,0 @@ -# Execute_ListQuery_ReturnsExpectedResult - -## Query - -```graphql -{ - examples(limit: 10) { - field1 - field2 - } - __cost { - requestCosts { - fieldCounts { - name - value - } - typeCounts { - name - value - } - inputTypeCounts { - name - value - } - inputFieldCounts { - name - value - } - argumentCounts { - name - value - } - directiveCounts { - name - value - } - } - } -} -``` - -## Result Result: - -```text -{ - "errors": [ - { - "message": "The field `__cost` does not exist on the type `Query`.", - "locations": [ - { - "line": 4, - "column": 5 - } - ], - "extensions": { - "type": "Query", - "field": "__cost", - "responseName": "__cost", - "specifiedBy": "https://spec.graphql.org/October2021/#sec-Field-Selections-on-Objects-Interfaces-and-Unions-Types" - } - } - ] -} -``` - -## Schema - -```text -type Query { - examples(limit: Int): [Example!]! @listSize -} - -type Example { - field1: Boolean! - field2: Int! -} -``` - diff --git a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/StaticQueryAnalysisTests.Execute_ListQuery_ReturnsExpectedResult_NET8_0.md b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/StaticQueryAnalysisTests.Execute_ListQuery_ReturnsExpectedResult_NET8_0.md deleted file mode 100644 index 522f1bcbf0b..00000000000 --- a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/StaticQueryAnalysisTests.Execute_ListQuery_ReturnsExpectedResult_NET8_0.md +++ /dev/null @@ -1,63 +0,0 @@ -# Execute_ListQuery_ReturnsExpectedResult - -## Schema - -```text -type Query { - examples(limit: Int): [Example!]! - @listSize( - slicingArguments: ["limit"], - assumedSize: 10, - requireOneSlicingArgument: false - ) -} - -type Example { - field1: Boolean! - field2: Int! -} -``` - -## Query - -```text -query { - examples { field1, field2 } - - __cost { - requestCosts { - fieldCounts { name, value } - typeCounts { name, value } - inputTypeCounts { name, value } - inputFieldCounts { name, value } - argumentCounts { name, value } - directiveCounts { name, value } - } - } -} -``` - -## Result Result: - -```text -{ - "errors": [ - { - "message": "The field `__cost` does not exist on the type `Query`.", - "locations": [ - { - "line": 4, - "column": 5 - } - ], - "extensions": { - "type": "Query", - "field": "__cost", - "responseName": "__cost", - "specifiedBy": "https://spec.graphql.org/October2021/#sec-Field-Selections-on-Objects-Interfaces-and-Unions-Types" - } - } - ] -} -``` - diff --git a/src/HotChocolate/Data/.vscode/launch.json b/src/HotChocolate/Data/.vscode/launch.json deleted file mode 100644 index 61ce9527c03..00000000000 --- a/src/HotChocolate/Data/.vscode/launch.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - // Use IntelliSense to find out which attributes exist for C# debugging - // Use hover for the description of the existing attributes - // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md - "version": "0.2.0", - "configurations": [ - { - "name": ".NET Core Launch (console)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/test/Data.Filters.SqlServer.Tests/bin/Debug/netcoreapp3.1/Data.Filters.SqlServer.Tests.dll", - "args": [], - "cwd": "${workspaceFolder}/test/Data.Filters.SqlServer.Tests", - // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console - "console": "internalConsole", - "stopAtEntry": false - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach", - "processId": "${command:pickProcess}" - } - ] -} \ No newline at end of file diff --git a/src/HotChocolate/Data/.vscode/settings.json b/src/HotChocolate/Data/.vscode/settings.json deleted file mode 100644 index 7a73a41bfdf..00000000000 --- a/src/HotChocolate/Data/.vscode/settings.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/src/HotChocolate/Data/.vscode/tasks.json b/src/HotChocolate/Data/.vscode/tasks.json deleted file mode 100644 index 31c32bd3457..00000000000 --- a/src/HotChocolate/Data/.vscode/tasks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "shell", - "args": [ - "build", - // Ask dotnet build to generate full paths for file names. - "/property:GenerateFullPaths=true", - // Do not generate summary otherwise it leads to duplicate errors in Problems panel - "/consoleloggerparameters:NoSummary" - ], - "group": "build", - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/src/HotChocolate/Data/Directory.Build.props b/src/HotChocolate/Data/Directory.Build.props index ac43e770784..8753bbfa113 100644 --- a/src/HotChocolate/Data/Directory.Build.props +++ b/src/HotChocolate/Data/Directory.Build.props @@ -2,7 +2,6 @@ - $(Library2TargetFrameworks) $(NoWarn);CA1062 en diff --git a/src/HotChocolate/Data/src/Data/Filters/Attributes/UseFilteringAttribute.cs b/src/HotChocolate/Data/src/Data/Filters/Attributes/UseFilteringAttribute.cs index 2be05cb682a..159c5b80d83 100644 --- a/src/HotChocolate/Data/src/Data/Filters/Attributes/UseFilteringAttribute.cs +++ b/src/HotChocolate/Data/src/Data/Filters/Attributes/UseFilteringAttribute.cs @@ -55,7 +55,6 @@ protected override void OnConfigure( } } -#if NET6_0_OR_GREATER /// /// Registers the middleware and adds the arguments for filtering /// @@ -66,4 +65,3 @@ public UseFilteringAttribute([CallerLineNumber] int order = 0) : base(typeof(T), { } } -#endif diff --git a/src/HotChocolate/Data/src/Data/Filters/Convention/Extensions/FilterConventionDescriptorExtensions.cs b/src/HotChocolate/Data/src/Data/Filters/Convention/Extensions/FilterConventionDescriptorExtensions.cs index 0ca6d1314da..81d99c2b2cb 100644 --- a/src/HotChocolate/Data/src/Data/Filters/Convention/Extensions/FilterConventionDescriptorExtensions.cs +++ b/src/HotChocolate/Data/src/Data/Filters/Convention/Extensions/FilterConventionDescriptorExtensions.cs @@ -112,10 +112,8 @@ public static IFilterConventionDescriptor BindDefaultTypes( .BindComparableType() .BindComparableType() .BindComparableType() -#if NET6_0_OR_GREATER .BindComparableType() .BindComparableType() -#endif .BindComparableType() .BindRuntimeType>() .BindRuntimeType>(); @@ -148,12 +146,10 @@ public static IFilterConventionDescriptor BindDefaultTypes( .BindRuntimeType() .BindRuntimeType() .BindRuntimeType() -#if NET6_0_OR_GREATER - .BindRuntimeType() - .BindRuntimeType() - .BindRuntimeType() - .BindRuntimeType() -#endif + .BindRuntimeType() + .BindRuntimeType() + .BindRuntimeType() + .BindRuntimeType() .BindRuntimeType() .BindRuntimeType() .BindRuntimeType() diff --git a/src/HotChocolate/Data/src/Data/Projections/Extensions/ProjectionObjectFieldDescriptorExtensions.cs b/src/HotChocolate/Data/src/Data/Projections/Extensions/ProjectionObjectFieldDescriptorExtensions.cs index 623207920dc..49b6fba4ed9 100644 --- a/src/HotChocolate/Data/src/Data/Projections/Extensions/ProjectionObjectFieldDescriptorExtensions.cs +++ b/src/HotChocolate/Data/src/Data/Projections/Extensions/ProjectionObjectFieldDescriptorExtensions.cs @@ -323,9 +323,7 @@ public TValueNode ArgumentLiteral(string name) where TValueNode : IV public T Service() where T : notnull => _context.Service(); - #if NET8_0_OR_GREATER public T? Service(object key) where T : notnull => _context.Service(key); - #endif public T Resolver() => _context.Resolver(); diff --git a/src/HotChocolate/Data/src/Data/Sorting/Attributes/UseSortingAttribute.cs b/src/HotChocolate/Data/src/Data/Sorting/Attributes/UseSortingAttribute.cs index 505cd6365be..7bfaeb58b3f 100644 --- a/src/HotChocolate/Data/src/Data/Sorting/Attributes/UseSortingAttribute.cs +++ b/src/HotChocolate/Data/src/Data/Sorting/Attributes/UseSortingAttribute.cs @@ -53,7 +53,6 @@ protected override void OnConfigure( } } -#if NET6_0_OR_GREATER /// /// Specifies the GraphQL type. /// @@ -64,4 +63,3 @@ public UseSortingAttribute([CallerLineNumber] int order = 0) : base(typeof(T), o { } } -#endif diff --git a/src/HotChocolate/Data/test/Data.AutoMapper.Tests/ProjectToTests.cs b/src/HotChocolate/Data/test/Data.AutoMapper.Tests/ProjectToTests.cs index 850869ccae3..4fca8559201 100644 --- a/src/HotChocolate/Data/test/Data.AutoMapper.Tests/ProjectToTests.cs +++ b/src/HotChocolate/Data/test/Data.AutoMapper.Tests/ProjectToTests.cs @@ -110,7 +110,7 @@ public async Task Execute_ManyToOne() }") .Build()); - var snapshot = new Snapshot(); + var snapshot = new Snapshot(postFix: TestEnvironment.TargetFramework); snapshot.AddSqlFrom(res1); await snapshot.MatchAsync(); } @@ -147,7 +147,7 @@ query Test { }") .Build()); - var snapshot = new Snapshot(); + var snapshot = new Snapshot(postFix: TestEnvironment.TargetFramework); snapshot.AddSqlFrom(res1); await snapshot.MatchAsync(); } @@ -205,7 +205,7 @@ query Test { }") .Build()); - var snapshot = new Snapshot(); + var snapshot = new Snapshot(postFix: TestEnvironment.TargetFramework); snapshot.AddSqlFrom(res1); await snapshot.MatchAsync(); } diff --git a/src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_ManyToOne_Deep.snap b/src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_ManyToOne_Deep_NET8_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_ManyToOne_Deep.snap rename to src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_ManyToOne_Deep_NET8_0.snap diff --git a/src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_ManyToOne_Deep_NET9_0.snap b/src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_ManyToOne_Deep_NET9_0.snap new file mode 100644 index 00000000000..f3ab0475c64 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_ManyToOne_Deep_NET9_0.snap @@ -0,0 +1,107 @@ +Result: +--------------- +{ + "data": { + "posts": [ + { + "postId": 1, + "title": "titleA", + "blog": { + "url": "testa.com", + "posts": [ + { + "title": "titleA", + "blog": null + }, + { + "title": "titleB", + "blog": null + } + ] + } + }, + { + "postId": 2, + "title": "titleB", + "blog": { + "url": "testa.com", + "posts": [ + { + "title": "titleA", + "blog": null + }, + { + "title": "titleB", + "blog": null + } + ] + } + }, + { + "postId": 3, + "title": "titleC", + "blog": { + "url": "testb.com", + "posts": [ + { + "title": "titleC", + "blog": null + }, + { + "title": "titleD", + "blog": null + } + ] + } + }, + { + "postId": 4, + "title": "titleD", + "blog": { + "url": "testb.com", + "posts": [ + { + "title": "titleC", + "blog": null + }, + { + "title": "titleD", + "blog": null + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT "b"."BlogId" IS NULL, "p"."PostId", "b"."BlogId", "p0"."PostId", "p0"."Title", "b"."Url", "p"."Title" +FROM "Posts" AS "p" +LEFT JOIN "Blogs" AS "b" ON "p"."BlogId" = "b"."BlogId" +LEFT JOIN "Posts" AS "p0" ON "b"."BlogId" = "p0"."BlogId" +ORDER BY "p"."PostId", "b"."BlogId" +--------------- + +Expression: +--------------- +DbSet() + .Select(dtoPost => new PostDto{ + Blog = dtoPost.Blog == null ? null : new BlogDto{ + Posts = dtoPost.Blog.Posts + .Select(dtoPost => new PostDto{ + PostId = dtoPost.PostId ?? 0, + Title = dtoPost.Title + } + ) + .ToList(), + Url = dtoPost.Blog.Url + } + , + PostId = dtoPost.PostId ?? 0, + Title = dtoPost.Title + } + ) +--------------- diff --git a/src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_ManyToOne.snap b/src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_ManyToOne_NET8_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_ManyToOne.snap rename to src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_ManyToOne_NET8_0.snap diff --git a/src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_ManyToOne_NET9_0.snap b/src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_ManyToOne_NET9_0.snap new file mode 100644 index 00000000000..17aac4d3ea0 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_ManyToOne_NET9_0.snap @@ -0,0 +1,56 @@ +Result: +--------------- +{ + "data": { + "posts": [ + { + "postId": 1, + "title": "titleA", + "blog": { + "url": "testa.com" + } + }, + { + "postId": 2, + "title": "titleB", + "blog": { + "url": "testa.com" + } + }, + { + "postId": 3, + "title": "titleC", + "blog": { + "url": "testb.com" + } + }, + { + "postId": 4, + "title": "titleD", + "blog": { + "url": "testb.com" + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT "b"."BlogId" IS NULL, "b"."Url", "p"."PostId", "p"."Title" +FROM "Posts" AS "p" +LEFT JOIN "Blogs" AS "b" ON "p"."BlogId" = "b"."BlogId" +--------------- + +Expression: +--------------- +DbSet() + .Select(dtoPost => new PostDto{ + Blog = dtoPost.Blog == null ? null : new BlogDto{ Url = dtoPost.Blog.Url } + , + PostId = dtoPost.PostId ?? 0, + Title = dtoPost.Title + } + ) +--------------- diff --git a/src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_OneToOne_Deep.snap b/src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_OneToOne_Deep_NET8_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_OneToOne_Deep.snap rename to src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_OneToOne_Deep_NET8_0.snap diff --git a/src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_OneToOne_Deep_NET9_0.snap b/src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_OneToOne_Deep_NET9_0.snap new file mode 100644 index 00000000000..5a7756654ed --- /dev/null +++ b/src/HotChocolate/Data/test/Data.AutoMapper.Tests/__snapshots__/ProjectToTests.Execute_OneToOne_Deep_NET9_0.snap @@ -0,0 +1,73 @@ +Result: +--------------- +{ + "data": { + "posts": [ + { + "postId": 1, + "title": "titleA", + "blog": { + "url": "testa.com", + "titleImage": { + "url": "https://testa.com/image.png" + } + } + }, + { + "postId": 2, + "title": "titleB", + "blog": { + "url": "testa.com", + "titleImage": { + "url": "https://testa.com/image.png" + } + } + }, + { + "postId": 3, + "title": "titleC", + "blog": { + "url": "testb.com", + "titleImage": { + "url": "https://testb.com/image.png" + } + } + }, + { + "postId": 4, + "title": "titleD", + "blog": { + "url": "testb.com", + "titleImage": { + "url": "https://testb.com/image.png" + } + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT "b"."BlogId" IS NULL, "i"."ImageId" IS NULL, "i"."Url", "b"."Url", "p"."PostId", "p"."Title" +FROM "Posts" AS "p" +LEFT JOIN "Blogs" AS "b" ON "p"."BlogId" = "b"."BlogId" +LEFT JOIN "Images" AS "i" ON "b"."ImageId" = "i"."ImageId" +--------------- + +Expression: +--------------- +DbSet() + .Select(dtoPost => new PostDto{ + Blog = dtoPost.Blog == null ? null : new BlogDto{ + TitleImage = dtoPost.Blog.TitleImage == null ? null : new ImageDto{ Url = dtoPost.Blog.TitleImage.Url } + , + Url = dtoPost.Blog.Url + } + , + PostId = dtoPost.PostId ?? 0, + Title = dtoPost.Title + } + ) +--------------- diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/IntegrationTests.cs b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/IntegrationTests.cs index 104f4f7fb45..a84d4af346f 100644 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/IntegrationTests.cs +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/IntegrationTests.cs @@ -239,11 +239,7 @@ public async Task Paging_Next_2_With_User_Sorting() """) .SetGlobalState("printSQL", true)); -#if NET6_0 - result.MatchMarkdownSnapshot(postFix: "NET6_0"); -#else result.MatchMarkdownSnapshot(); -#endif } public class Query diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_User_Sorting_NET6_0.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_User_Sorting_NET6_0.md deleted file mode 100644 index 28a8388dc75..00000000000 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_User_Sorting_NET6_0.md +++ /dev/null @@ -1,24 +0,0 @@ -# Paging_Next_2_With_User_Sorting - -```json -{ - "data": { - "brands": { - "nodes": [ - { - "name": "Brand18" - }, - { - "name": "Brand19" - } - ], - "pageInfo": { - "endCursor": "QnJhbmQxOToyMA==" - } - } - }, - "extensions": { - "sql": "-- @__p_0='Brand17'\n-- @__p_1='18'\n-- @__p_2='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE (b.\"Name\" > @__p_0) OR ((b.\"Name\" = @__p_0) AND (b.\"Id\" > @__p_1))\nORDER BY b.\"Name\", b.\"Id\"\nLIMIT @__p_2" - } -} -``` diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorBooleanTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorBooleanTests.cs index 01c9827fd42..5c2c2dc81c9 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorBooleanTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorBooleanTests.cs @@ -126,7 +126,7 @@ public async Task Create_NullableBooleanNotEqual_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create() .AddResult(res1, "true") .AddResult(res2, "false") .AddResult(res3, "null") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorComparableTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorComparableTests.cs index 2d6e30c069e..a0948f4973b 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorComparableTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorComparableTests.cs @@ -404,7 +404,7 @@ public async Task Create_ShortIn_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create() .AddResult(res1, "12and13") .AddResult(res2, "13and14") .AddResult(res3, "nullAnd14") @@ -435,7 +435,7 @@ public async Task Create_ShortNotIn_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create() .AddResult(res1, "12and13") .AddResult(res2, "13and14") .AddResult(res3, "nullAnd14") @@ -497,7 +497,7 @@ public async Task Create_ShortNullableNotEqual_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create() .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "null") @@ -570,7 +570,7 @@ public async Task Create_ShortNullableNotGreaterThan_Expression() // assert await Snapshot - .Create() + .Create(postFix: TestEnvironment.TargetFramework) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -644,7 +644,7 @@ public async Task Create_ShortNullableNotGreaterThanOrEquals_Expression() // assert await Snapshot - .Create() + .Create(postFix: TestEnvironment.TargetFramework) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -718,7 +718,7 @@ public async Task Create_ShortNullableNotLowerThan_Expression() // assert await Snapshot - .Create() + .Create(postFix: TestEnvironment.TargetFramework) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -792,7 +792,7 @@ public async Task Create_ShortNullableNotLowerThanOrEquals_Expression() // assert await Snapshot - .Create() + .Create(postFix: TestEnvironment.TargetFramework) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorEnumTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorEnumTests.cs index 8904ceb1e82..eba2de83825 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorEnumTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorEnumTests.cs @@ -110,7 +110,7 @@ public async Task Create_EnumIn_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create() .AddResult(res1, "BarAndFoo") .AddResult(res2, "FOO") .AddResult(res3, "nullAndFoo") @@ -141,7 +141,7 @@ public async Task Create_EnumNotIn_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create() .AddResult(res1, "BarAndFoo") .AddResult(res2, "FOO") .AddResult(res3, "nullAndFoo") @@ -204,7 +204,7 @@ public async Task Create_NullableEnumNotEqual_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create() .AddResult(res1, "BAR") .AddResult(res2, "FOO") .AddResult(res3, "null") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorExpressionTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorExpressionTests.cs index 986118deaea..f3f780289cd 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorExpressionTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorExpressionTests.cs @@ -55,7 +55,7 @@ public async Task Create_StringConcatExpression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create() .AddResult(res1, "Sam_Sampleman") .AddResult(res2, "NoMatch") .AddResult(res3, "null") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorListTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorListTests.cs index f07a001232b..72d4ef377b7 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorListTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorListTests.cs @@ -97,7 +97,7 @@ public async Task Create_ArraySomeObjectStringEqualWithNull_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create() .AddResult(res1, "a") .AddResult(res2, "d") .AddResult(res3, "null") @@ -131,7 +131,7 @@ public async Task Create_ArrayNoneObjectStringEqual_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create() .AddResult(res1, "a") .AddResult(res2, "d") .AddResult(res3, "null") @@ -165,7 +165,7 @@ public async Task Create_ArrayAllObjectStringEqual_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create() .AddResult(res1, "a") .AddResult(res2, "d") .AddResult(res3, "null") @@ -199,7 +199,7 @@ public async Task Create_ArrayAnyObjectStringEqual_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create() .AddResult(res1, "false") .AddResult(res2, "true") .AddResult(res3, "null") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorObjectTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorObjectTests.cs index 83897f13f4e..1e714745844 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorObjectTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorObjectTests.cs @@ -174,7 +174,7 @@ public async Task Create_ObjectShortIn_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create() .AddResult(res1, "12and13") .AddResult(res2, "13and14") .AddResult(res3, "nullAnd14") @@ -388,7 +388,7 @@ public async Task Create_ObjectEnumIn_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create() .AddResult(res1, "BarAndFoo") .AddResult(res2, "FOO") .AddResult(res3, "nullAndFoo") @@ -537,7 +537,7 @@ public async Task Create_ObjectStringIn_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create() .AddResult(res1, "testatestAndtestb") .AddResult(res2, "testbtestAndNull") .AddResult(res3, "testatest") @@ -577,7 +577,7 @@ public async Task Create_ArrayObjectNestedArraySomeStringEqual_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create() .AddResult(res1, "a") .AddResult(res2, "b") .AddResult(res3, "null") @@ -614,7 +614,7 @@ public async Task Create_ArrayObjectNestedArrayAnyStringEqual_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create() .AddResult(res1, "false") .AddResult(res2, "true") .AddResult(res3, "null") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorStringTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorStringTests.cs index 9145d3be7ba..a5acc294ecb 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorStringTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorStringTests.cs @@ -107,7 +107,7 @@ public async Task Create_StringIn_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create() .AddResult(res1, "testatestAndtestb") .AddResult(res2, "testbtestAndNull") .AddResult(res3, "testatest") @@ -170,7 +170,7 @@ public async Task Create_StringContains_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create() .AddResult(res1, "a") .AddResult(res2, "b") .AddResult(res3, "null") @@ -389,7 +389,7 @@ public async Task Create_NullableStringNotEqual_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create() .AddResult(res1, "testatest") .AddResult(res2, "testbtest") .AddResult(res3, "null") @@ -486,7 +486,7 @@ public async Task Create_NullableStringContains_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create() .AddResult(res1, "a") .AddResult(res2, "b") .AddResult(res3, "null") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression_NET6_0.snap deleted file mode 100644 index c16cfd39ee8..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression_NET6_0.snap +++ /dev/null @@ -1,72 +0,0 @@ -true Result: ---------------- -{ - "data": { - "root": [ - { - "bar": null - }, - { - "bar": false - } - ] - } -} ---------------- - -true SQL: ---------------- -.param set @__p_0 1 - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE ("d"."Bar" <> @__p_0) OR ("d"."Bar" IS NULL) ---------------- - -false Result: ---------------- -{ - "data": { - "root": [ - { - "bar": true - }, - { - "bar": null - } - ] - } -} ---------------- - -false SQL: ---------------- -.param set @__p_0 0 - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE ("d"."Bar" <> @__p_0) OR ("d"."Bar" IS NULL) ---------------- - -null Result: ---------------- -{ - "data": { - "root": [ - { - "bar": true - }, - { - "bar": false - } - ] - } -} ---------------- - -null SQL: ---------------- -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NOT NULL ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression_NET7_0.snap deleted file mode 100644 index 2f77eae08f1..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression_NET7_0.snap +++ /dev/null @@ -1,72 +0,0 @@ -true Result: ---------------- -{ - "data": { - "root": [ - { - "bar": null - }, - { - "bar": false - } - ] - } -} ---------------- - -true SQL: ---------------- -.param set @__p_0 1 - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" <> @__p_0 OR ("d"."Bar" IS NULL) ---------------- - -false Result: ---------------- -{ - "data": { - "root": [ - { - "bar": true - }, - { - "bar": null - } - ] - } -} ---------------- - -false SQL: ---------------- -.param set @__p_0 0 - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" <> @__p_0 OR ("d"."Bar" IS NULL) ---------------- - -null Result: ---------------- -{ - "data": { - "root": [ - { - "bar": true - }, - { - "bar": false - } - ] - } -} ---------------- - -null SQL: ---------------- -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NOT NULL ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression_NET6_0.snap deleted file mode 100644 index c888ae0101b..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression_NET6_0.snap +++ /dev/null @@ -1,73 +0,0 @@ -12and13 Result: ---------------- -{ - "data": { - "root": [ - { - "barShort": 12 - }, - { - "barShort": 13 - } - ] - } -} ---------------- - -12and13 SQL: ---------------- -SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" -FROM "Data" AS "d" -WHERE "d"."BarShort" IN (12, 13) ---------------- - -13and14 Result: ---------------- -{ - "data": { - "root": [ - { - "barShort": 14 - }, - { - "barShort": 13 - } - ] - } -} ---------------- - -13and14 SQL: ---------------- -SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" -FROM "Data" AS "d" -WHERE "d"."BarShort" IN (13, 14) ---------------- - -nullAnd14 ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `in` of type ShortOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 33 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "[Short!]", - "filterType": "ShortOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression_NET7_0.snap deleted file mode 100644 index c888ae0101b..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression_NET7_0.snap +++ /dev/null @@ -1,73 +0,0 @@ -12and13 Result: ---------------- -{ - "data": { - "root": [ - { - "barShort": 12 - }, - { - "barShort": 13 - } - ] - } -} ---------------- - -12and13 SQL: ---------------- -SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" -FROM "Data" AS "d" -WHERE "d"."BarShort" IN (12, 13) ---------------- - -13and14 Result: ---------------- -{ - "data": { - "root": [ - { - "barShort": 14 - }, - { - "barShort": 13 - } - ] - } -} ---------------- - -13and14 SQL: ---------------- -SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" -FROM "Data" AS "d" -WHERE "d"."BarShort" IN (13, 14) ---------------- - -nullAnd14 ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `in` of type ShortOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 33 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "[Short!]", - "filterType": "ShortOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression_NET6_0.snap deleted file mode 100644 index b7e362440e1..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression_NET6_0.snap +++ /dev/null @@ -1,67 +0,0 @@ -12and13 Result: ---------------- -{ - "data": { - "root": [ - { - "barShort": 14 - } - ] - } -} ---------------- - -12and13 SQL: ---------------- -SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" -FROM "Data" AS "d" -WHERE "d"."BarShort" NOT IN (12, 13) ---------------- - -13and14 Result: ---------------- -{ - "data": { - "root": [ - { - "barShort": 12 - } - ] - } -} ---------------- - -13and14 SQL: ---------------- -SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" -FROM "Data" AS "d" -WHERE "d"."BarShort" NOT IN (13, 14) ---------------- - -nullAnd14 ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `nin` of type ShortOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 34 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "[Short!]", - "filterType": "ShortOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression_NET7_0.snap deleted file mode 100644 index b7e362440e1..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression_NET7_0.snap +++ /dev/null @@ -1,67 +0,0 @@ -12and13 Result: ---------------- -{ - "data": { - "root": [ - { - "barShort": 14 - } - ] - } -} ---------------- - -12and13 SQL: ---------------- -SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" -FROM "Data" AS "d" -WHERE "d"."BarShort" NOT IN (12, 13) ---------------- - -13and14 Result: ---------------- -{ - "data": { - "root": [ - { - "barShort": 12 - } - ] - } -} ---------------- - -13and14 SQL: ---------------- -SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" -FROM "Data" AS "d" -WHERE "d"."BarShort" NOT IN (13, 14) ---------------- - -nullAnd14 ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `nin` of type ShortOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 34 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "[Short!]", - "filterType": "ShortOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET7_0.snap deleted file mode 100644 index 54355f3ca88..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET7_0.snap +++ /dev/null @@ -1,68 +0,0 @@ -12and13 Result: ---------------- -{ - "data": { - "root": [ - { - "barShort": 12 - }, - { - "barShort": 13 - } - ] - } -} ---------------- - -12and13 SQL: ---------------- -SELECT "d"."Id", "d"."BarShort" -FROM "Data" AS "d" -WHERE "d"."BarShort" IN (12, 13) ---------------- - -13and14 Result: ---------------- -{ - "data": { - "root": [ - { - "barShort": 14 - }, - { - "barShort": 13 - } - ] - } -} ---------------- - -13and14 SQL: ---------------- -SELECT "d"."Id", "d"."BarShort" -FROM "Data" AS "d" -WHERE "d"."BarShort" IN (13, 14) ---------------- - -13andNull Result: ---------------- -{ - "data": { - "root": [ - { - "barShort": null - }, - { - "barShort": 13 - } - ] - } -} ---------------- - -13andNull SQL: ---------------- -SELECT "d"."Id", "d"."BarShort" -FROM "Data" AS "d" -WHERE "d"."BarShort" = 13 OR ("d"."BarShort" IS NULL) ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET9_0.snap similarity index 67% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET6_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET9_0.snap index b612fa4872d..39ff3fefa3b 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET6_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET9_0.snap @@ -16,9 +16,14 @@ 12and13 SQL: --------------- +.param set @__p_0 '[12,13]' + SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" IN (12, 13) +WHERE "d"."BarShort" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- 13and14 Result: @@ -39,9 +44,14 @@ WHERE "d"."BarShort" IN (12, 13) 13and14 SQL: --------------- +.param set @__p_0 '[13,14]' + SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" IN (13, 14) +WHERE "d"."BarShort" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- 13andNull Result: @@ -62,7 +72,12 @@ WHERE "d"."BarShort" IN (13, 14) 13andNull SQL: --------------- +.param set @__p_0_without_nulls '[13]' + SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE ("d"."BarShort" = 13) OR "d"."BarShort" IS NULL +WHERE "d"."BarShort" IN ( + SELECT "p"."value" + FROM json_each(@__p_0_without_nulls) AS "p" +) OR "d"."BarShort" IS NULL --------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThanOrEquals_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThanOrEquals_Expression_NET8_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThanOrEquals_Expression.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThanOrEquals_Expression_NET8_0.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThanOrEquals_Expression_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThanOrEquals_Expression_NET9_0.snap new file mode 100644 index 00000000000..2667e6aa075 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThanOrEquals_Expression_NET9_0.snap @@ -0,0 +1,111 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": null + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @__p_0 12 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE CASE + WHEN "d"."BarShort" >= @__p_0 THEN 0 + ELSE 1 +END +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": null + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @__p_0 13 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE CASE + WHEN "d"."BarShort" >= @__p_0 THEN 0 + ELSE 1 +END +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": null + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @__p_0 14 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE CASE + WHEN "d"."BarShort" >= @__p_0 THEN 0 + ELSE 1 +END +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `ngte` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 35 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThan_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThan_Expression_NET8_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThan_Expression.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThan_Expression_NET8_0.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThan_Expression_NET9_0.snap similarity index 52% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression_NET7_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThan_Expression_NET9_0.snap index 5eef8b4803a..b989d260968 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression_NET7_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThan_Expression_NET9_0.snap @@ -4,13 +4,10 @@ "data": { "root": [ { - "barShort": null - }, - { - "barShort": 14 + "barShort": 12 }, { - "barShort": 13 + "barShort": null } ] } @@ -23,7 +20,10 @@ SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" <> @__p_0 OR ("d"."BarShort" IS NULL) +WHERE CASE + WHEN "d"."BarShort" > @__p_0 THEN 0 + ELSE 1 +END --------------- 13 Result: @@ -38,7 +38,7 @@ WHERE "d"."BarShort" <> @__p_0 OR ("d"."BarShort" IS NULL) "barShort": null }, { - "barShort": 14 + "barShort": 13 } ] } @@ -51,10 +51,13 @@ WHERE "d"."BarShort" <> @__p_0 OR ("d"."BarShort" IS NULL) SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" <> @__p_0 OR ("d"."BarShort" IS NULL) +WHERE CASE + WHEN "d"."BarShort" > @__p_0 THEN 0 + ELSE 1 +END --------------- -null Result: +14 Result: --------------- { "data": { @@ -62,6 +65,9 @@ null Result: { "barShort": 12 }, + { + "barShort": null + }, { "barShort": 14 }, @@ -73,9 +79,42 @@ null Result: } --------------- -null SQL: +14 SQL: --------------- +.param set @__p_0 14 + SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" IS NOT NULL +WHERE CASE + WHEN "d"."BarShort" > @__p_0 THEN 0 + ELSE 1 +END +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `ngt` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} --------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET6_0.snap deleted file mode 100644 index 355386cbbae..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET6_0.snap +++ /dev/null @@ -1,68 +0,0 @@ -12and13 Result: ---------------- -{ - "data": { - "root": [ - { - "barShort": null - }, - { - "barShort": 14 - } - ] - } -} ---------------- - -12and13 SQL: ---------------- -SELECT "d"."Id", "d"."BarShort" -FROM "Data" AS "d" -WHERE "d"."BarShort" NOT IN (12, 13) OR "d"."BarShort" IS NULL ---------------- - -13and14 Result: ---------------- -{ - "data": { - "root": [ - { - "barShort": 12 - }, - { - "barShort": null - } - ] - } -} ---------------- - -13and14 SQL: ---------------- -SELECT "d"."Id", "d"."BarShort" -FROM "Data" AS "d" -WHERE "d"."BarShort" NOT IN (13, 14) OR "d"."BarShort" IS NULL ---------------- - -13andNull Result: ---------------- -{ - "data": { - "root": [ - { - "barShort": 12 - }, - { - "barShort": 14 - } - ] - } -} ---------------- - -13andNull SQL: ---------------- -SELECT "d"."Id", "d"."BarShort" -FROM "Data" AS "d" -WHERE ("d"."BarShort" <> 13) AND "d"."BarShort" IS NOT NULL ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET9_0.snap similarity index 63% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET7_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET9_0.snap index 87d54ac87eb..120bf90817f 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET7_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET9_0.snap @@ -16,9 +16,14 @@ 12and13 SQL: --------------- +.param set @__p_0 '[12,13]' + SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" NOT IN (12, 13) OR ("d"."BarShort" IS NULL) +WHERE "d"."BarShort" NOT IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) OR "d"."BarShort" IS NULL --------------- 13and14 Result: @@ -39,9 +44,14 @@ WHERE "d"."BarShort" NOT IN (12, 13) OR ("d"."BarShort" IS NULL) 13and14 SQL: --------------- +.param set @__p_0 '[13,14]' + SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" NOT IN (13, 14) OR ("d"."BarShort" IS NULL) +WHERE "d"."BarShort" NOT IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) OR "d"."BarShort" IS NULL --------------- 13andNull Result: @@ -62,7 +72,12 @@ WHERE "d"."BarShort" NOT IN (13, 14) OR ("d"."BarShort" IS NULL) 13andNull SQL: --------------- +.param set @__p_0_without_nulls '[13]' + SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" <> 13 AND ("d"."BarShort" IS NOT NULL) +WHERE "d"."BarShort" NOT IN ( + SELECT "p"."value" + FROM json_each(@__p_0_without_nulls) AS "p" +) AND "d"."BarShort" IS NOT NULL --------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThanOrEquals_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThanOrEquals_Expression_NET8_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThanOrEquals_Expression.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThanOrEquals_Expression_NET8_0.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThanOrEquals_Expression_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThanOrEquals_Expression_NET9_0.snap new file mode 100644 index 00000000000..9c32284c141 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThanOrEquals_Expression_NET9_0.snap @@ -0,0 +1,111 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": null + }, + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @__p_0 12 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE CASE + WHEN "d"."BarShort" <= @__p_0 THEN 0 + ELSE 1 +END +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": null + }, + { + "barShort": 14 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @__p_0 13 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE CASE + WHEN "d"."BarShort" <= @__p_0 THEN 0 + ELSE 1 +END +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": null + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @__p_0 14 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE CASE + WHEN "d"."BarShort" <= @__p_0 THEN 0 + ELSE 1 +END +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `nlte` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 35 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThan_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThan_Expression_NET8_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThan_Expression.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThan_Expression_NET8_0.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThan_Expression_NET9_0.snap similarity index 53% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression_NET6_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThan_Expression_NET9_0.snap index e00989a668a..4be821c0160 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression_NET6_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThan_Expression_NET9_0.snap @@ -3,6 +3,9 @@ { "data": { "root": [ + { + "barShort": 12 + }, { "barShort": null }, @@ -23,7 +26,10 @@ SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE ("d"."BarShort" <> @__p_0) OR "d"."BarShort" IS NULL +WHERE CASE + WHEN "d"."BarShort" < @__p_0 THEN 0 + ELSE 1 +END --------------- 13 Result: @@ -31,14 +37,14 @@ WHERE ("d"."BarShort" <> @__p_0) OR "d"."BarShort" IS NULL { "data": { "root": [ - { - "barShort": 12 - }, { "barShort": null }, { "barShort": 14 + }, + { + "barShort": 13 } ] } @@ -51,31 +57,64 @@ WHERE ("d"."BarShort" <> @__p_0) OR "d"."BarShort" IS NULL SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE ("d"."BarShort" <> @__p_0) OR "d"."BarShort" IS NULL +WHERE CASE + WHEN "d"."BarShort" < @__p_0 THEN 0 + ELSE 1 +END --------------- -null Result: +14 Result: --------------- { "data": { "root": [ { - "barShort": 12 + "barShort": null }, { "barShort": 14 - }, - { - "barShort": 13 } ] } } --------------- -null SQL: +14 SQL: --------------- +.param set @__p_0 14 + SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" IS NOT NULL +WHERE CASE + WHEN "d"."BarShort" < @__p_0 THEN 0 + ELSE 1 +END +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `nlt` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} --------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression_NET6_0.snap deleted file mode 100644 index f904cf4f84c..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression_NET6_0.snap +++ /dev/null @@ -1,68 +0,0 @@ -BarAndFoo Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "BAR" - }, - { - "barEnum": "FOO" - } - ] - } -} ---------------- - -BarAndFoo SQL: ---------------- -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" IN (1, 0) ---------------- - -FOO Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "FOO" - } - ] - } -} ---------------- - -FOO SQL: ---------------- -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" = 0 ---------------- - -nullAndFoo Result: ---------------- -{ - "errors": [ - { - "message": "The specified value type of field `in` does not match the field type.", - "locations": [ - { - "line": 1, - "column": 32 - } - ], - "path": [ - "root" - ], - "extensions": { - "fieldName": "in", - "fieldType": "[FooEnum!]", - "locationType": "[FooEnum!]", - "specifiedBy": "https://spec.graphql.org/October2021/#sec-Values-of-Correct-Type" - } - } - ] -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression_NET7_0.snap deleted file mode 100644 index f904cf4f84c..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression_NET7_0.snap +++ /dev/null @@ -1,68 +0,0 @@ -BarAndFoo Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "BAR" - }, - { - "barEnum": "FOO" - } - ] - } -} ---------------- - -BarAndFoo SQL: ---------------- -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" IN (1, 0) ---------------- - -FOO Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "FOO" - } - ] - } -} ---------------- - -FOO SQL: ---------------- -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" = 0 ---------------- - -nullAndFoo Result: ---------------- -{ - "errors": [ - { - "message": "The specified value type of field `in` does not match the field type.", - "locations": [ - { - "line": 1, - "column": 32 - } - ], - "path": [ - "root" - ], - "extensions": { - "fieldName": "in", - "fieldType": "[FooEnum!]", - "locationType": "[FooEnum!]", - "specifiedBy": "https://spec.graphql.org/October2021/#sec-Values-of-Correct-Type" - } - } - ] -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression_NET6_0.snap deleted file mode 100644 index 7d9b244fe55..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression_NET6_0.snap +++ /dev/null @@ -1,74 +0,0 @@ -BarAndFoo Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "BAZ" - }, - { - "barEnum": "QUX" - } - ] - } -} ---------------- - -BarAndFoo SQL: ---------------- -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" NOT IN (1, 0) ---------------- - -FOO Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "BAR" - }, - { - "barEnum": "BAZ" - }, - { - "barEnum": "QUX" - } - ] - } -} ---------------- - -FOO SQL: ---------------- -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" <> 0 ---------------- - -nullAndFoo Result: ---------------- -{ - "errors": [ - { - "message": "The specified value type of field `nin` does not match the field type.", - "locations": [ - { - "line": 1, - "column": 33 - } - ], - "path": [ - "root" - ], - "extensions": { - "fieldName": "nin", - "fieldType": "[FooEnum!]", - "locationType": "[FooEnum!]", - "specifiedBy": "https://spec.graphql.org/October2021/#sec-Values-of-Correct-Type" - } - } - ] -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression_NET7_0.snap deleted file mode 100644 index 7d9b244fe55..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression_NET7_0.snap +++ /dev/null @@ -1,74 +0,0 @@ -BarAndFoo Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "BAZ" - }, - { - "barEnum": "QUX" - } - ] - } -} ---------------- - -BarAndFoo SQL: ---------------- -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" NOT IN (1, 0) ---------------- - -FOO Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "BAR" - }, - { - "barEnum": "BAZ" - }, - { - "barEnum": "QUX" - } - ] - } -} ---------------- - -FOO SQL: ---------------- -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" <> 0 ---------------- - -nullAndFoo Result: ---------------- -{ - "errors": [ - { - "message": "The specified value type of field `nin` does not match the field type.", - "locations": [ - { - "line": 1, - "column": 33 - } - ], - "path": [ - "root" - ], - "extensions": { - "fieldName": "nin", - "fieldType": "[FooEnum!]", - "locationType": "[FooEnum!]", - "specifiedBy": "https://spec.graphql.org/October2021/#sec-Values-of-Correct-Type" - } - } - ] -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET7_0.snap deleted file mode 100644 index 573a3ca4549..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET7_0.snap +++ /dev/null @@ -1,65 +0,0 @@ -BarAndFoo Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "BAR" - }, - { - "barEnum": "FOO" - } - ] - } -} ---------------- - -BarAndFoo SQL: ---------------- -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" IN (1, 0) ---------------- - -FOO Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "FOO" - } - ] - } -} ---------------- - -FOO SQL: ---------------- -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" = 0 ---------------- - -nullAndFoo Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "FOO" - }, - { - "barEnum": null - } - ] - } -} ---------------- - -nullAndFoo SQL: ---------------- -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" = 0 OR ("d"."BarEnum" IS NULL) ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET9_0.snap similarity index 66% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET6_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET9_0.snap index 7f1c713e3f6..6e98dc2b031 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET6_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET9_0.snap @@ -16,9 +16,14 @@ BarAndFoo Result: BarAndFoo SQL: --------------- +.param set @__p_0 '[1,0]' + SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" IN (1, 0) +WHERE "d"."BarEnum" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- FOO Result: @@ -36,9 +41,14 @@ FOO Result: FOO SQL: --------------- +.param set @__p_0 '[0]' + SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" = 0 +WHERE "d"."BarEnum" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- nullAndFoo Result: @@ -59,7 +69,12 @@ nullAndFoo Result: nullAndFoo SQL: --------------- +.param set @__p_0_without_nulls '[0]' + SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE ("d"."BarEnum" = 0) OR "d"."BarEnum" IS NULL +WHERE "d"."BarEnum" IN ( + SELECT "p"."value" + FROM json_each(@__p_0_without_nulls) AS "p" +) OR "d"."BarEnum" IS NULL --------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET6_0.snap deleted file mode 100644 index d2fa952e6cd..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET6_0.snap +++ /dev/null @@ -1,90 +0,0 @@ -BAR Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "BAZ" - }, - { - "barEnum": "FOO" - }, - { - "barEnum": null - }, - { - "barEnum": "QUX" - } - ] - } -} ---------------- - -BAR SQL: ---------------- -.param set @__p_0 1 - -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE ("d"."BarEnum" <> @__p_0) OR "d"."BarEnum" IS NULL ---------------- - -FOO Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "BAR" - }, - { - "barEnum": "BAZ" - }, - { - "barEnum": null - }, - { - "barEnum": "QUX" - } - ] - } -} ---------------- - -FOO SQL: ---------------- -.param set @__p_0 0 - -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE ("d"."BarEnum" <> @__p_0) OR "d"."BarEnum" IS NULL ---------------- - -null Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "BAR" - }, - { - "barEnum": "BAZ" - }, - { - "barEnum": "FOO" - }, - { - "barEnum": "QUX" - } - ] - } -} ---------------- - -null SQL: ---------------- -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" IS NOT NULL ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET7_0.snap deleted file mode 100644 index a441f406122..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET7_0.snap +++ /dev/null @@ -1,90 +0,0 @@ -BAR Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "BAZ" - }, - { - "barEnum": "FOO" - }, - { - "barEnum": null - }, - { - "barEnum": "QUX" - } - ] - } -} ---------------- - -BAR SQL: ---------------- -.param set @__p_0 1 - -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" <> @__p_0 OR ("d"."BarEnum" IS NULL) ---------------- - -FOO Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "BAR" - }, - { - "barEnum": "BAZ" - }, - { - "barEnum": null - }, - { - "barEnum": "QUX" - } - ] - } -} ---------------- - -FOO SQL: ---------------- -.param set @__p_0 0 - -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" <> @__p_0 OR ("d"."BarEnum" IS NULL) ---------------- - -null Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "BAR" - }, - { - "barEnum": "BAZ" - }, - { - "barEnum": "FOO" - }, - { - "barEnum": "QUX" - } - ] - } -} ---------------- - -null SQL: ---------------- -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" IS NOT NULL ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET7_0.snap deleted file mode 100644 index d84aa9a8e3e..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET7_0.snap +++ /dev/null @@ -1,80 +0,0 @@ -BarAndFoo Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "BAZ" - }, - { - "barEnum": null - }, - { - "barEnum": "QUX" - } - ] - } -} ---------------- - -BarAndFoo SQL: ---------------- -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" NOT IN (1, 0) OR ("d"."BarEnum" IS NULL) ---------------- - -FOO Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "BAR" - }, - { - "barEnum": "BAZ" - }, - { - "barEnum": null - }, - { - "barEnum": "QUX" - } - ] - } -} ---------------- - -FOO SQL: ---------------- -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" <> 0 OR ("d"."BarEnum" IS NULL) ---------------- - -nullAndFoo Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "BAR" - }, - { - "barEnum": "BAZ" - }, - { - "barEnum": "QUX" - } - ] - } -} ---------------- - -nullAndFoo SQL: ---------------- -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" <> 0 AND ("d"."BarEnum" IS NOT NULL) ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET9_0.snap similarity index 68% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET6_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET9_0.snap index f18e609a979..250998cf0fb 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET6_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET9_0.snap @@ -19,9 +19,14 @@ BarAndFoo Result: BarAndFoo SQL: --------------- +.param set @__p_0 '[1,0]' + SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" NOT IN (1, 0) OR "d"."BarEnum" IS NULL +WHERE "d"."BarEnum" NOT IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) OR "d"."BarEnum" IS NULL --------------- FOO Result: @@ -48,9 +53,14 @@ FOO Result: FOO SQL: --------------- +.param set @__p_0 '[0]' + SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE ("d"."BarEnum" <> 0) OR "d"."BarEnum" IS NULL +WHERE "d"."BarEnum" NOT IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) OR "d"."BarEnum" IS NULL --------------- nullAndFoo Result: @@ -74,7 +84,12 @@ nullAndFoo Result: nullAndFoo SQL: --------------- +.param set @__p_0_without_nulls '[0]' + SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE ("d"."BarEnum" <> 0) AND "d"."BarEnum" IS NOT NULL +WHERE "d"."BarEnum" NOT IN ( + SELECT "p"."value" + FROM json_each(@__p_0_without_nulls) AS "p" +) AND "d"."BarEnum" IS NOT NULL --------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression_NET6_0.snap deleted file mode 100644 index 11b1a180a0c..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression_NET6_0.snap +++ /dev/null @@ -1,56 +0,0 @@ -Sam_Sampleman Result: ---------------- -{ - "data": { - "root": [ - { - "name": "Sam", - "lastName": "Sampleman" - } - ] - } -} ---------------- - -Sam_Sampleman SQL: ---------------- -.param set @__p_0 'Sam Sampleman' - -SELECT "d"."Id", "d"."LastName", "d"."Name" -FROM "Data" AS "d" -WHERE ((COALESCE("d"."Name", '') || ' ') || COALESCE("d"."LastName", '')) = @__p_0 ---------------- - -NoMatch Result: ---------------- -{ - "data": { - "root": [] - } -} ---------------- - -NoMatch SQL: ---------------- -.param set @__p_0 'NoMatch' - -SELECT "d"."Id", "d"."LastName", "d"."Name" -FROM "Data" AS "d" -WHERE ((COALESCE("d"."Name", '') || ' ') || COALESCE("d"."LastName", '')) = @__p_0 ---------------- - -null Result: ---------------- -{ - "data": { - "root": [] - } -} ---------------- - -null SQL: ---------------- -SELECT "d"."Id", "d"."LastName", "d"."Name" -FROM "Data" AS "d" -WHERE 0 ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression_NET7_0.snap deleted file mode 100644 index 11b1a180a0c..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression_NET7_0.snap +++ /dev/null @@ -1,56 +0,0 @@ -Sam_Sampleman Result: ---------------- -{ - "data": { - "root": [ - { - "name": "Sam", - "lastName": "Sampleman" - } - ] - } -} ---------------- - -Sam_Sampleman SQL: ---------------- -.param set @__p_0 'Sam Sampleman' - -SELECT "d"."Id", "d"."LastName", "d"."Name" -FROM "Data" AS "d" -WHERE ((COALESCE("d"."Name", '') || ' ') || COALESCE("d"."LastName", '')) = @__p_0 ---------------- - -NoMatch Result: ---------------- -{ - "data": { - "root": [] - } -} ---------------- - -NoMatch SQL: ---------------- -.param set @__p_0 'NoMatch' - -SELECT "d"."Id", "d"."LastName", "d"."Name" -FROM "Data" AS "d" -WHERE ((COALESCE("d"."Name", '') || ' ') || COALESCE("d"."LastName", '')) = @__p_0 ---------------- - -null Result: ---------------- -{ - "data": { - "root": [] - } -} ---------------- - -null SQL: ---------------- -SELECT "d"."Id", "d"."LastName", "d"."Name" -FROM "Data" AS "d" -WHERE 0 ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET6_0.snap deleted file mode 100644 index 7905938f76f..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET6_0.snap +++ /dev/null @@ -1,74 +0,0 @@ -a Result: ---------------- -{ - "data": { - "root": [ - { - "fooNested": [ - { - "bar": "a" - }, - { - "bar": "a" - }, - { - "bar": "a" - } - ] - } - ] - } -} ---------------- - -a SQL: ---------------- -.param set @__p_0 'a' - -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE NOT EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE ("d"."Id" = "f"."FooId") AND (("f"."Bar" <> @__p_0) OR "f"."Bar" IS NULL)) ---------------- - -d Result: ---------------- -{ - "data": { - "root": [] - } -} ---------------- - -d SQL: ---------------- -.param set @__p_0 'd' - -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE NOT EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE ("d"."Id" = "f"."FooId") AND (("f"."Bar" <> @__p_0) OR "f"."Bar" IS NULL)) ---------------- - -null Result: ---------------- -{ - "data": { - "root": [] - } -} ---------------- - -null SQL: ---------------- -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE NOT EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE ("d"."Id" = "f"."FooId") AND "f"."Bar" IS NOT NULL) ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET7_0.snap deleted file mode 100644 index 5272280dae6..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET7_0.snap +++ /dev/null @@ -1,74 +0,0 @@ -a Result: ---------------- -{ - "data": { - "root": [ - { - "fooNested": [ - { - "bar": "a" - }, - { - "bar": "a" - }, - { - "bar": "a" - } - ] - } - ] - } -} ---------------- - -a SQL: ---------------- -.param set @__p_0 'a' - -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE NOT EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" <> @__p_0 OR ("f"."Bar" IS NULL))) ---------------- - -d Result: ---------------- -{ - "data": { - "root": [] - } -} ---------------- - -d SQL: ---------------- -.param set @__p_0 'd' - -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE NOT EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" <> @__p_0 OR ("f"."Bar" IS NULL))) ---------------- - -null Result: ---------------- -{ - "data": { - "root": [] - } -} ---------------- - -null SQL: ---------------- -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE NOT EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" IS NOT NULL)) ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAnyObjectStringEqual_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAnyObjectStringEqual_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAnyObjectStringEqual_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAnyObjectStringEqual_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAnyObjectStringEqual_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAnyObjectStringEqual_Expression_NET6_0.snap deleted file mode 100644 index b4154515693..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAnyObjectStringEqual_Expression_NET6_0.snap +++ /dev/null @@ -1,131 +0,0 @@ -false Result: ---------------- -{ - "data": { - "root": [] - } -} ---------------- - -false SQL: ---------------- -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE NOT (EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId")) ---------------- - -true Result: ---------------- -{ - "data": { - "root": [ - { - "fooNested": [ - { - "bar": "a" - }, - { - "bar": "a" - }, - { - "bar": "a" - } - ] - }, - { - "fooNested": [ - { - "bar": "c" - }, - { - "bar": "a" - }, - { - "bar": "a" - } - ] - }, - { - "fooNested": [ - { - "bar": "a" - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - }, - { - "fooNested": [ - { - "bar": "c" - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - }, - { - "fooNested": [ - { - "bar": null - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - } - ] - } -} ---------------- - -true SQL: ---------------- -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId") ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `all` of type FooNestedFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 35 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "FooNestedFilterInput!", - "filterType": "FooNestedFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAnyObjectStringEqual_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAnyObjectStringEqual_Expression_NET7_0.snap deleted file mode 100644 index b4154515693..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAnyObjectStringEqual_Expression_NET7_0.snap +++ /dev/null @@ -1,131 +0,0 @@ -false Result: ---------------- -{ - "data": { - "root": [] - } -} ---------------- - -false SQL: ---------------- -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE NOT (EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId")) ---------------- - -true Result: ---------------- -{ - "data": { - "root": [ - { - "fooNested": [ - { - "bar": "a" - }, - { - "bar": "a" - }, - { - "bar": "a" - } - ] - }, - { - "fooNested": [ - { - "bar": "c" - }, - { - "bar": "a" - }, - { - "bar": "a" - } - ] - }, - { - "fooNested": [ - { - "bar": "a" - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - }, - { - "fooNested": [ - { - "bar": "c" - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - }, - { - "fooNested": [ - { - "bar": null - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - } - ] - } -} ---------------- - -true SQL: ---------------- -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId") ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `all` of type FooNestedFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 35 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "FooNestedFilterInput!", - "filterType": "FooNestedFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET6_0.snap deleted file mode 100644 index 946dabd7b1f..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET6_0.snap +++ /dev/null @@ -1,167 +0,0 @@ -a Result: ---------------- -{ - "data": { - "root": [ - { - "fooNested": [ - { - "bar": "c" - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - }, - { - "fooNested": [ - { - "bar": null - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - } - ] - } -} ---------------- - -a SQL: ---------------- -.param set @__p_0 'a' - -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE NOT (EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE ("d"."Id" = "f"."FooId") AND ("f"."Bar" = @__p_0))) ---------------- - -d Result: ---------------- -{ - "data": { - "root": [ - { - "fooNested": [ - { - "bar": "a" - }, - { - "bar": "a" - }, - { - "bar": "a" - } - ] - }, - { - "fooNested": [ - { - "bar": "c" - }, - { - "bar": "a" - }, - { - "bar": "a" - } - ] - } - ] - } -} ---------------- - -d SQL: ---------------- -.param set @__p_0 'd' - -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE NOT (EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE ("d"."Id" = "f"."FooId") AND ("f"."Bar" = @__p_0))) ---------------- - -null Result: ---------------- -{ - "data": { - "root": [ - { - "fooNested": [ - { - "bar": "a" - }, - { - "bar": "a" - }, - { - "bar": "a" - } - ] - }, - { - "fooNested": [ - { - "bar": "c" - }, - { - "bar": "a" - }, - { - "bar": "a" - } - ] - }, - { - "fooNested": [ - { - "bar": "a" - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - }, - { - "fooNested": [ - { - "bar": "c" - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - } - ] - } -} ---------------- - -null SQL: ---------------- -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE NOT (EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE ("d"."Id" = "f"."FooId") AND "f"."Bar" IS NULL)) ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET7_0.snap deleted file mode 100644 index 2e406a3f6ea..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET7_0.snap +++ /dev/null @@ -1,167 +0,0 @@ -a Result: ---------------- -{ - "data": { - "root": [ - { - "fooNested": [ - { - "bar": "c" - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - }, - { - "fooNested": [ - { - "bar": null - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - } - ] - } -} ---------------- - -a SQL: ---------------- -.param set @__p_0 'a' - -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE NOT (EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @__p_0)) ---------------- - -d Result: ---------------- -{ - "data": { - "root": [ - { - "fooNested": [ - { - "bar": "a" - }, - { - "bar": "a" - }, - { - "bar": "a" - } - ] - }, - { - "fooNested": [ - { - "bar": "c" - }, - { - "bar": "a" - }, - { - "bar": "a" - } - ] - } - ] - } -} ---------------- - -d SQL: ---------------- -.param set @__p_0 'd' - -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE NOT (EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @__p_0)) ---------------- - -null Result: ---------------- -{ - "data": { - "root": [ - { - "fooNested": [ - { - "bar": "a" - }, - { - "bar": "a" - }, - { - "bar": "a" - } - ] - }, - { - "fooNested": [ - { - "bar": "c" - }, - { - "bar": "a" - }, - { - "bar": "a" - } - ] - }, - { - "fooNested": [ - { - "bar": "a" - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - }, - { - "fooNested": [ - { - "bar": "c" - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - } - ] - } -} ---------------- - -null SQL: ---------------- -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE NOT (EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" IS NULL))) ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET6_0.snap deleted file mode 100644 index 525d06a1e83..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET6_0.snap +++ /dev/null @@ -1,154 +0,0 @@ -a Result: ---------------- -{ - "data": { - "root": [ - { - "fooNested": [ - { - "bar": "a" - }, - { - "bar": "a" - }, - { - "bar": "a" - } - ] - }, - { - "fooNested": [ - { - "bar": "c" - }, - { - "bar": "a" - }, - { - "bar": "a" - } - ] - }, - { - "fooNested": [ - { - "bar": "a" - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - } - ] - } -} ---------------- - -a SQL: ---------------- -.param set @__p_0 'a' - -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE ("d"."Id" = "f"."FooId") AND ("f"."Bar" = @__p_0)) ---------------- - -d Result: ---------------- -{ - "data": { - "root": [ - { - "fooNested": [ - { - "bar": "a" - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - }, - { - "fooNested": [ - { - "bar": "c" - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - }, - { - "fooNested": [ - { - "bar": null - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - } - ] - } -} ---------------- - -d SQL: ---------------- -.param set @__p_0 'd' - -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE ("d"."Id" = "f"."FooId") AND ("f"."Bar" = @__p_0)) ---------------- - -null Result: ---------------- -{ - "data": { - "root": [ - { - "fooNested": [ - { - "bar": null - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - } - ] - } -} ---------------- - -null SQL: ---------------- -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE ("d"."Id" = "f"."FooId") AND "f"."Bar" IS NULL) ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET7_0.snap deleted file mode 100644 index 53984b1028d..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET7_0.snap +++ /dev/null @@ -1,154 +0,0 @@ -a Result: ---------------- -{ - "data": { - "root": [ - { - "fooNested": [ - { - "bar": "a" - }, - { - "bar": "a" - }, - { - "bar": "a" - } - ] - }, - { - "fooNested": [ - { - "bar": "c" - }, - { - "bar": "a" - }, - { - "bar": "a" - } - ] - }, - { - "fooNested": [ - { - "bar": "a" - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - } - ] - } -} ---------------- - -a SQL: ---------------- -.param set @__p_0 'a' - -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @__p_0) ---------------- - -d Result: ---------------- -{ - "data": { - "root": [ - { - "fooNested": [ - { - "bar": "a" - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - }, - { - "fooNested": [ - { - "bar": "c" - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - }, - { - "fooNested": [ - { - "bar": null - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - } - ] - } -} ---------------- - -d SQL: ---------------- -.param set @__p_0 'd' - -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @__p_0) ---------------- - -null Result: ---------------- -{ - "data": { - "root": [ - { - "fooNested": [ - { - "bar": null - }, - { - "bar": "d" - }, - { - "bar": "b" - } - ] - } - ] - } -} ---------------- - -null SQL: ---------------- -SELECT "d"."Id" -FROM "Data" AS "d" -WHERE EXISTS ( - SELECT 1 - FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" IS NULL)) ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArrayAnyStringEqual_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArrayAnyStringEqual_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArrayAnyStringEqual_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArrayAnyStringEqual_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArrayAnyStringEqual_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArrayAnyStringEqual_Expression_NET6_0.snap deleted file mode 100644 index 233e59c5fbe..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArrayAnyStringEqual_Expression_NET6_0.snap +++ /dev/null @@ -1,143 +0,0 @@ -false Result: ---------------- -{ - "data": { - "root": [] - } -} ---------------- - -false SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE NOT (EXISTS ( - SELECT 1 - FROM "Data" AS "d0" - WHERE "f"."Id" = "d0"."FooId")) ---------------- - -true Result: ---------------- -{ - "data": { - "root": [ - { - "foo": { - "objectArray": [ - { - "foo": { - "barString": "testatest" - } - }, - { - "foo": { - "barString": "testatest" - } - } - ] - } - }, - { - "foo": { - "objectArray": [ - { - "foo": { - "barString": "testatest" - } - }, - { - "foo": { - "barString": "testatest" - } - } - ] - } - }, - { - "foo": { - "objectArray": [ - { - "foo": { - "barString": "testbtest" - } - }, - { - "foo": { - "barString": "testbtest" - } - } - ] - } - }, - { - "foo": { - "objectArray": [ - { - "foo": { - "barString": "testbtest" - } - }, - { - "foo": { - "barString": "testbtest" - } - } - ] - } - }, - { - "foo": { - "objectArray": [ - { - "foo": { - "barString": "testctest" - } - } - ] - } - } - ] - } -} ---------------- - -true SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE EXISTS ( - SELECT 1 - FROM "Data" AS "d0" - WHERE "f"."Id" = "d0"."FooId") ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `any` of type ListBarFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 44 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "Boolean!", - "filterType": "ListBarFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArrayAnyStringEqual_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArrayAnyStringEqual_Expression_NET7_0.snap deleted file mode 100644 index 233e59c5fbe..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArrayAnyStringEqual_Expression_NET7_0.snap +++ /dev/null @@ -1,143 +0,0 @@ -false Result: ---------------- -{ - "data": { - "root": [] - } -} ---------------- - -false SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE NOT (EXISTS ( - SELECT 1 - FROM "Data" AS "d0" - WHERE "f"."Id" = "d0"."FooId")) ---------------- - -true Result: ---------------- -{ - "data": { - "root": [ - { - "foo": { - "objectArray": [ - { - "foo": { - "barString": "testatest" - } - }, - { - "foo": { - "barString": "testatest" - } - } - ] - } - }, - { - "foo": { - "objectArray": [ - { - "foo": { - "barString": "testatest" - } - }, - { - "foo": { - "barString": "testatest" - } - } - ] - } - }, - { - "foo": { - "objectArray": [ - { - "foo": { - "barString": "testbtest" - } - }, - { - "foo": { - "barString": "testbtest" - } - } - ] - } - }, - { - "foo": { - "objectArray": [ - { - "foo": { - "barString": "testbtest" - } - }, - { - "foo": { - "barString": "testbtest" - } - } - ] - } - }, - { - "foo": { - "objectArray": [ - { - "foo": { - "barString": "testctest" - } - } - ] - } - } - ] - } -} ---------------- - -true SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE EXISTS ( - SELECT 1 - FROM "Data" AS "d0" - WHERE "f"."Id" = "d0"."FooId") ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `any` of type ListBarFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 44 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "Boolean!", - "filterType": "ListBarFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression_NET7_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression_NET6_0.snap deleted file mode 100644 index 3002958f444..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression_NET6_0.snap +++ /dev/null @@ -1,73 +0,0 @@ -a Result: ---------------- -{ - "data": { - "root": [] - } -} ---------------- - -a SQL: ---------------- -.param set @__p_0 'a' - -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE EXISTS ( - SELECT 1 - FROM "Data" AS "d0" - INNER JOIN "Foo" AS "f0" ON "d0"."FooId" = "f0"."Id" - WHERE ("f"."Id" = "d0"."FooId") AND ("f0"."BarString" = @__p_0)) ---------------- - -b Result: ---------------- -{ - "data": { - "root": [] - } -} ---------------- - -b SQL: ---------------- -.param set @__p_0 'd' - -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE EXISTS ( - SELECT 1 - FROM "Data" AS "d0" - INNER JOIN "Foo" AS "f0" ON "d0"."FooId" = "f0"."Id" - WHERE ("f"."Id" = "d0"."FooId") AND ("f0"."BarString" = @__p_0)) ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `eq` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 70 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression_NET8_0.snap deleted file mode 100644 index 1474f5f43c0..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression_NET8_0.snap +++ /dev/null @@ -1,73 +0,0 @@ -a Result: ---------------- -{ - "data": { - "root": [] - } -} ---------------- - -a SQL: ---------------- -.param set @__p_0 'a' - -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE EXISTS ( - SELECT 1 - FROM "Data" AS "d0" - INNER JOIN "Foo" AS "f0" ON "d0"."FooId" = "f0"."Id" - WHERE "f"."Id" = "d0"."FooId" AND "f0"."BarString" = @__p_0) ---------------- - -b Result: ---------------- -{ - "data": { - "root": [] - } -} ---------------- - -b SQL: ---------------- -.param set @__p_0 'd' - -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE EXISTS ( - SELECT 1 - FROM "Data" AS "d0" - INNER JOIN "Foo" AS "f0" ON "d0"."FooId" = "f0"."Id" - WHERE "f"."Id" = "d0"."FooId" AND "f0"."BarString" = @__p_0) ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `eq` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 70 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression_NET6_0.snap deleted file mode 100644 index 7e460cb79e5..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression_NET6_0.snap +++ /dev/null @@ -1,81 +0,0 @@ -BarAndFoo Result: ---------------- -{ - "data": { - "root": [ - { - "foo": { - "barEnum": "BAR" - } - }, - { - "foo": { - "barEnum": "BAR" - } - }, - { - "foo": { - "barEnum": "FOO" - } - } - ] - } -} ---------------- - -BarAndFoo SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarEnum" IN (1, 0) ---------------- - -FOO Result: ---------------- -{ - "data": { - "root": [ - { - "foo": { - "barEnum": "FOO" - } - } - ] - } -} ---------------- - -FOO SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarEnum" = 0 ---------------- - -nullAndFoo Result: ---------------- -{ - "errors": [ - { - "message": "The specified value type of field `in` does not match the field type.", - "locations": [ - { - "line": 1, - "column": 39 - } - ], - "path": [ - "root" - ], - "extensions": { - "fieldName": "in", - "fieldType": "[BarEnum!]", - "locationType": "[BarEnum!]", - "specifiedBy": "https://spec.graphql.org/October2021/#sec-Values-of-Correct-Type" - } - } - ] -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression_NET7_0.snap deleted file mode 100644 index 7e460cb79e5..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression_NET7_0.snap +++ /dev/null @@ -1,81 +0,0 @@ -BarAndFoo Result: ---------------- -{ - "data": { - "root": [ - { - "foo": { - "barEnum": "BAR" - } - }, - { - "foo": { - "barEnum": "BAR" - } - }, - { - "foo": { - "barEnum": "FOO" - } - } - ] - } -} ---------------- - -BarAndFoo SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarEnum" IN (1, 0) ---------------- - -FOO Result: ---------------- -{ - "data": { - "root": [ - { - "foo": { - "barEnum": "FOO" - } - } - ] - } -} ---------------- - -FOO SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarEnum" = 0 ---------------- - -nullAndFoo Result: ---------------- -{ - "errors": [ - { - "message": "The specified value type of field `in` does not match the field type.", - "locations": [ - { - "line": 1, - "column": 39 - } - ], - "path": [ - "root" - ], - "extensions": { - "fieldName": "in", - "fieldType": "[BarEnum!]", - "locationType": "[BarEnum!]", - "specifiedBy": "https://spec.graphql.org/October2021/#sec-Values-of-Correct-Type" - } - } - ] -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET7_0.snap deleted file mode 100644 index 7d678f3c178..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET7_0.snap +++ /dev/null @@ -1,78 +0,0 @@ -BarAndFoo Result: ---------------- -{ - "data": { - "root": [ - { - "foo": { - "barEnum": "BAR" - } - }, - { - "foo": { - "barEnum": "BAR" - } - }, - { - "foo": { - "barEnum": "FOO" - } - } - ] - } -} ---------------- - -BarAndFoo SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarEnum" IN (1, 0) ---------------- - -FOO Result: ---------------- -{ - "data": { - "root": [ - { - "foo": { - "barEnum": "FOO" - } - } - ] - } -} ---------------- - -FOO SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarEnum" = 0 ---------------- - -nullAndFoo Result: ---------------- -{ - "data": { - "root": [ - { - "foo": { - "barEnum": "FOO" - } - } - ] - } -} ---------------- - -nullAndFoo SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarEnum" = 0 OR ("f"."BarEnum" IS NULL) ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET9_0.snap similarity index 73% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET6_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET9_0.snap index 075d4e3859e..ec82659bb1d 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET6_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET9_0.snap @@ -25,10 +25,15 @@ BarAndFoo Result: BarAndFoo SQL: --------------- +.param set @__p_0 '[1,0]' + SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarEnum" IN (1, 0) +WHERE "f"."BarEnum" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- FOO Result: @@ -48,10 +53,15 @@ FOO Result: FOO SQL: --------------- +.param set @__p_0 '[0]' + SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarEnum" = 0 +WHERE "f"."BarEnum" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- nullAndFoo Result: @@ -71,8 +81,13 @@ nullAndFoo Result: nullAndFoo SQL: --------------- +.param set @__p_0_without_nulls '[0]' + SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE ("f"."BarEnum" = 0) OR "f"."BarEnum" IS NULL +WHERE "f"."BarEnum" IN ( + SELECT "p"."value" + FROM json_each(@__p_0_without_nulls) AS "p" +) OR "f"."BarEnum" IS NULL --------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET7_0.snap deleted file mode 100644 index 31e48b2a439..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET7_0.snap +++ /dev/null @@ -1,98 +0,0 @@ -12and13 Result: ---------------- -{ - "data": { - "root": [ - { - "foo": { - "barShort": 12 - } - }, - { - "foo": { - "barShort": 12 - } - }, - { - "foo": { - "barShort": 13 - } - } - ] - } -} ---------------- - -12and13 SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarShort" IN (12, 13) ---------------- - -13and14 Result: ---------------- -{ - "data": { - "root": [ - { - "foo": { - "barShort": 14 - } - }, - { - "foo": { - "barShort": 14 - } - }, - { - "foo": { - "barShort": 13 - } - } - ] - } -} ---------------- - -13and14 SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarShort" IN (13, 14) ---------------- - -13andNull Result: ---------------- -{ - "data": { - "root": [ - { - "foo": { - "barShort": null - } - }, - { - "foo": { - "barShort": null - } - }, - { - "foo": { - "barShort": 13 - } - } - ] - } -} ---------------- - -13andNull SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarShort" = 13 OR ("f"."BarShort" IS NULL) ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET9_0.snap similarity index 77% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET6_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET9_0.snap index 5222a365f09..51cf4ad1be9 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET6_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET9_0.snap @@ -25,10 +25,15 @@ 12and13 SQL: --------------- +.param set @__p_0 '[12,13]' + SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarShort" IN (12, 13) +WHERE "f"."BarShort" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- 13and14 Result: @@ -58,10 +63,15 @@ WHERE "f"."BarShort" IN (12, 13) 13and14 SQL: --------------- +.param set @__p_0 '[13,14]' + SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarShort" IN (13, 14) +WHERE "f"."BarShort" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- 13andNull Result: @@ -91,8 +101,13 @@ WHERE "f"."BarShort" IN (13, 14) 13andNull SQL: --------------- +.param set @__p_0_without_nulls '[13]' + SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE ("f"."BarShort" = 13) OR "f"."BarShort" IS NULL +WHERE "f"."BarShort" IN ( + SELECT "p"."value" + FROM json_each(@__p_0_without_nulls) AS "p" +) OR "f"."BarShort" IS NULL --------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression_NET6_0.snap deleted file mode 100644 index 8827383d7cf..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression_NET6_0.snap +++ /dev/null @@ -1,93 +0,0 @@ -12and13 Result: ---------------- -{ - "data": { - "root": [ - { - "foo": { - "barShort": 12 - } - }, - { - "foo": { - "barShort": 12 - } - }, - { - "foo": { - "barShort": 13 - } - } - ] - } -} ---------------- - -12and13 SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarShort" IN (12, 13) ---------------- - -13and14 Result: ---------------- -{ - "data": { - "root": [ - { - "foo": { - "barShort": 14 - } - }, - { - "foo": { - "barShort": 14 - } - }, - { - "foo": { - "barShort": 13 - } - } - ] - } -} ---------------- - -13and14 SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarShort" IN (13, 14) ---------------- - -nullAnd14 ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `in` of type ShortOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 40 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "[Short!]", - "filterType": "ShortOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression_NET7_0.snap deleted file mode 100644 index 8827383d7cf..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression_NET7_0.snap +++ /dev/null @@ -1,93 +0,0 @@ -12and13 Result: ---------------- -{ - "data": { - "root": [ - { - "foo": { - "barShort": 12 - } - }, - { - "foo": { - "barShort": 12 - } - }, - { - "foo": { - "barShort": 13 - } - } - ] - } -} ---------------- - -12and13 SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarShort" IN (12, 13) ---------------- - -13and14 Result: ---------------- -{ - "data": { - "root": [ - { - "foo": { - "barShort": 14 - } - }, - { - "foo": { - "barShort": 14 - } - }, - { - "foo": { - "barShort": 13 - } - } - ] - } -} ---------------- - -13and14 SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarShort" IN (13, 14) ---------------- - -nullAnd14 ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `in` of type ShortOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 40 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "[Short!]", - "filterType": "ShortOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression_NET6_0.snap deleted file mode 100644 index 20f53798479..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression_NET6_0.snap +++ /dev/null @@ -1,93 +0,0 @@ -testatestAndtestb Result: ---------------- -{ - "data": { - "root": [ - { - "foo": { - "barString": "testatest" - } - }, - { - "foo": { - "barString": "testatest" - } - }, - { - "foo": { - "barString": "testbtest" - } - }, - { - "foo": { - "barString": "testbtest" - } - } - ] - } -} ---------------- - -testatestAndtestb SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarString" IN ('testatest', 'testbtest') ---------------- - -testbtestAndNull ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `in` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 41 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "[String!]", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- - -testatest Result: ---------------- -{ - "data": { - "root": [ - { - "foo": { - "barString": "testatest" - } - }, - { - "foo": { - "barString": "testatest" - } - } - ] - } -} ---------------- - -testatest SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarString" = 'testatest' ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression_NET7_0.snap deleted file mode 100644 index 20f53798479..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression_NET7_0.snap +++ /dev/null @@ -1,93 +0,0 @@ -testatestAndtestb Result: ---------------- -{ - "data": { - "root": [ - { - "foo": { - "barString": "testatest" - } - }, - { - "foo": { - "barString": "testatest" - } - }, - { - "foo": { - "barString": "testbtest" - } - }, - { - "foo": { - "barString": "testbtest" - } - } - ] - } -} ---------------- - -testatestAndtestb SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarString" IN ('testatest', 'testbtest') ---------------- - -testbtestAndNull ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `in` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 41 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "[String!]", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- - -testatest Result: ---------------- -{ - "data": { - "root": [ - { - "foo": { - "barString": "testatest" - } - }, - { - "foo": { - "barString": "testatest" - } - } - ] - } -} ---------------- - -testatest SQL: ---------------- -SELECT "d"."Id", "d"."FooId" -FROM "Data" AS "d" -INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarString" = 'testatest' ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET6_0.snap deleted file mode 100644 index 12a948eb391..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET6_0.snap +++ /dev/null @@ -1,71 +0,0 @@ -a Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -a SQL: ---------------- -.param set @__p_0 'a' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NOT NULL AND ((@__p_0 = '') OR (instr("d"."Bar", @__p_0) > 0)) ---------------- - -b Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - } - ] - } -} ---------------- - -b SQL: ---------------- -.param set @__p_0 'b' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NOT NULL AND ((@__p_0 = '') OR (instr("d"."Bar", @__p_0) > 0)) ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `contains` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 34 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET7_0.snap deleted file mode 100644 index 4266cb926dc..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET7_0.snap +++ /dev/null @@ -1,71 +0,0 @@ -a Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -a SQL: ---------------- -.param set @__p_0 'a' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE ("d"."Bar" IS NOT NULL) AND (@__p_0 = '' OR instr("d"."Bar", @__p_0) > 0) ---------------- - -b Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - } - ] - } -} ---------------- - -b SQL: ---------------- -.param set @__p_0 'b' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE ("d"."Bar" IS NOT NULL) AND (@__p_0 = '' OR instr("d"."Bar", @__p_0) > 0) ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `contains` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 34 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET6_0.snap deleted file mode 100644 index 422385ed61b..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET6_0.snap +++ /dev/null @@ -1,71 +0,0 @@ -atest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -atest SQL: ---------------- -.param set @__p_0 'atest' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NOT NULL AND ((@__p_0 = '') OR ((substr("d"."Bar", -length(@__p_0)) = @__p_0) OR (@__p_0 = ''))) ---------------- - -btest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - } - ] - } -} ---------------- - -btest SQL: ---------------- -.param set @__p_0 'btest' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NOT NULL AND ((@__p_0 = '') OR ((substr("d"."Bar", -length(@__p_0)) = @__p_0) OR (@__p_0 = ''))) ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `endsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 34 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET7_0.snap deleted file mode 100644 index 743da85eca5..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET7_0.snap +++ /dev/null @@ -1,71 +0,0 @@ -atest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -atest SQL: ---------------- -.param set @__p_0 'atest' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE ("d"."Bar" IS NOT NULL) AND (@__p_0 = '' OR substr("d"."Bar", -length(@__p_0)) = @__p_0 OR @__p_0 = '') ---------------- - -btest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - } - ] - } -} ---------------- - -btest SQL: ---------------- -.param set @__p_0 'btest' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE ("d"."Bar" IS NOT NULL) AND (@__p_0 = '' OR substr("d"."Bar", -length(@__p_0)) = @__p_0 OR @__p_0 = '') ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `endsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 34 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET9_0.snap similarity index 80% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET6_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET9_0.snap index 2dfb17c233f..1b1d2c51906 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET6_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET9_0.snap @@ -13,11 +13,11 @@ atest Result: atest SQL: --------------- -.param set @__p_0 'atest' +.param set @__p_0_endswith '%atest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE (@__p_0 = '') OR ((substr("d"."Bar", -length(@__p_0)) = @__p_0) OR (@__p_0 = '')) +WHERE "d"."Bar" IS NOT NULL AND "d"."Bar" LIKE @__p_0_endswith ESCAPE '\' --------------- btest Result: @@ -35,11 +35,11 @@ btest Result: btest SQL: --------------- -.param set @__p_0 'btest' +.param set @__p_0_endswith '%btest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE (@__p_0 = '') OR ((substr("d"."Bar", -length(@__p_0)) = @__p_0) OR (@__p_0 = '')) +WHERE "d"."Bar" IS NOT NULL AND "d"."Bar" LIKE @__p_0_endswith ESCAPE '\' --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET7_0.snap deleted file mode 100644 index b08dc4ef220..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET7_0.snap +++ /dev/null @@ -1,65 +0,0 @@ -testatestAndtestb Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - }, - { - "bar": "testbtest" - } - ] - } -} ---------------- - -testatestAndtestb SQL: ---------------- -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IN ('testatest', 'testbtest') ---------------- - -testbtestAndNull Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - }, - { - "bar": null - } - ] - } -} ---------------- - -testbtestAndNull SQL: ---------------- -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" = 'testbtest' OR ("d"."Bar" IS NULL) ---------------- - -testatest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -testatest SQL: ---------------- -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" = 'testatest' ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET9_0.snap similarity index 66% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET6_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET9_0.snap index d29c946bde8..9059a2331b1 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET6_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET9_0.snap @@ -16,9 +16,14 @@ testatestAndtestb Result: testatestAndtestb SQL: --------------- +.param set @__p_0 '["testatest","testbtest"]' + SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" IN ('testatest', 'testbtest') +WHERE "d"."Bar" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- testbtestAndNull Result: @@ -39,9 +44,14 @@ testbtestAndNull Result: testbtestAndNull SQL: --------------- +.param set @__p_0_without_nulls '["testbtest"]' + SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE ("d"."Bar" = 'testbtest') OR "d"."Bar" IS NULL +WHERE "d"."Bar" IN ( + SELECT "p"."value" + FROM json_each(@__p_0_without_nulls) AS "p" +) OR "d"."Bar" IS NULL --------------- testatest Result: @@ -59,7 +69,12 @@ testatest Result: testatest SQL: --------------- +.param set @__p_0 '["testatest"]' + SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" = 'testatest' +WHERE "d"."Bar" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression_NET6_0.snap deleted file mode 100644 index fbe843a45b8..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression_NET6_0.snap +++ /dev/null @@ -1,77 +0,0 @@ -a Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - }, - { - "bar": null - } - ] - } -} ---------------- - -a SQL: ---------------- -.param set @__p_0 'a' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NULL OR NOT ((@__p_0 = '') OR (instr("d"."Bar", @__p_0) > 0)) ---------------- - -b Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - }, - { - "bar": null - } - ] - } -} ---------------- - -b SQL: ---------------- -.param set @__p_0 'b' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NULL OR NOT ((@__p_0 = '') OR (instr("d"."Bar", @__p_0) > 0)) ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `ncontains` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 35 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression_NET9_0.snap similarity index 87% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression_NET7_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression_NET9_0.snap index 754df7c7e9f..b1eccdc5016 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression_NET7_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression_NET9_0.snap @@ -20,7 +20,7 @@ a SQL: SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE ("d"."Bar" IS NULL) OR NOT (@__p_0 = '' OR instr("d"."Bar", @__p_0) > 0) +WHERE "d"."Bar" IS NULL OR instr("d"."Bar", @__p_0) <= 0 --------------- b Result: @@ -45,7 +45,7 @@ b SQL: SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE ("d"."Bar" IS NULL) OR NOT (@__p_0 = '' OR instr("d"."Bar", @__p_0) > 0) +WHERE "d"."Bar" IS NULL OR instr("d"."Bar", @__p_0) <= 0 --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET6_0.snap deleted file mode 100644 index 7e3cb5607a2..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET6_0.snap +++ /dev/null @@ -1,77 +0,0 @@ -atest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - }, - { - "bar": null - } - ] - } -} ---------------- - -atest SQL: ---------------- -.param set @__p_0 'atest' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NULL OR ((@__p_0 <> '') AND ((substr("d"."Bar", -length(@__p_0)) <> @__p_0) AND (@__p_0 <> ''))) ---------------- - -btest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - }, - { - "bar": null - } - ] - } -} ---------------- - -btest SQL: ---------------- -.param set @__p_0 'btest' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NULL OR ((@__p_0 <> '') AND ((substr("d"."Bar", -length(@__p_0)) <> @__p_0) AND (@__p_0 <> ''))) ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `nendsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 35 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET9_0.snap similarity index 79% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET7_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET9_0.snap index aa230b60317..96e427a0820 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET7_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET9_0.snap @@ -16,11 +16,11 @@ atest Result: atest SQL: --------------- -.param set @__p_0 'atest' +.param set @__p_0_endswith '%atest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE ("d"."Bar" IS NULL) OR (@__p_0 <> '' AND substr("d"."Bar", -length(@__p_0)) <> @__p_0 AND @__p_0 <> '') +WHERE "d"."Bar" IS NULL OR "d"."Bar" NOT LIKE @__p_0_endswith ESCAPE '\' --------------- btest Result: @@ -41,11 +41,11 @@ btest Result: btest SQL: --------------- -.param set @__p_0 'btest' +.param set @__p_0_endswith '%btest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE ("d"."Bar" IS NULL) OR (@__p_0 <> '' AND substr("d"."Bar", -length(@__p_0)) <> @__p_0 AND @__p_0 <> '') +WHERE "d"."Bar" IS NULL OR "d"."Bar" NOT LIKE @__p_0_endswith ESCAPE '\' --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET6_0.snap deleted file mode 100644 index d85a2139fb1..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET6_0.snap +++ /dev/null @@ -1,72 +0,0 @@ -testatest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - }, - { - "bar": null - } - ] - } -} ---------------- - -testatest SQL: ---------------- -.param set @__p_0 'testatest' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE ("d"."Bar" <> @__p_0) OR "d"."Bar" IS NULL ---------------- - -testbtest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - }, - { - "bar": null - } - ] - } -} ---------------- - -testbtest SQL: ---------------- -.param set @__p_0 'testbtest' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE ("d"."Bar" <> @__p_0) OR "d"."Bar" IS NULL ---------------- - -null Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - }, - { - "bar": "testbtest" - } - ] - } -} ---------------- - -null SQL: ---------------- -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NOT NULL ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET7_0.snap deleted file mode 100644 index de1be6d3f2d..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET7_0.snap +++ /dev/null @@ -1,72 +0,0 @@ -testatest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - }, - { - "bar": null - } - ] - } -} ---------------- - -testatest SQL: ---------------- -.param set @__p_0 'testatest' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" <> @__p_0 OR ("d"."Bar" IS NULL) ---------------- - -testbtest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - }, - { - "bar": null - } - ] - } -} ---------------- - -testbtest SQL: ---------------- -.param set @__p_0 'testbtest' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" <> @__p_0 OR ("d"."Bar" IS NULL) ---------------- - -null Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - }, - { - "bar": "testbtest" - } - ] - } -} ---------------- - -null SQL: ---------------- -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NOT NULL ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET7_0.snap deleted file mode 100644 index 47664990538..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET7_0.snap +++ /dev/null @@ -1,62 +0,0 @@ -testatestAndtestb Result: ---------------- -{ - "data": { - "root": [ - { - "bar": null - } - ] - } -} ---------------- - -testatestAndtestb SQL: ---------------- -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" NOT IN ('testatest', 'testbtest') OR ("d"."Bar" IS NULL) ---------------- - -testbtestAndNull Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -testbtestAndNull SQL: ---------------- -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" <> 'testbtest' AND ("d"."Bar" IS NOT NULL) ---------------- - -testatest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - }, - { - "bar": null - } - ] - } -} ---------------- - -testatest SQL: ---------------- -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" <> 'testatest' OR ("d"."Bar" IS NULL) ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET9_0.snap similarity index 61% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET6_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET9_0.snap index 42283c048e4..ffa93543cda 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET6_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET9_0.snap @@ -13,9 +13,14 @@ testatestAndtestb Result: testatestAndtestb SQL: --------------- +.param set @__p_0 '["testatest","testbtest"]' + SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" NOT IN ('testatest', 'testbtest') OR "d"."Bar" IS NULL +WHERE "d"."Bar" NOT IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) OR "d"."Bar" IS NULL --------------- testbtestAndNull Result: @@ -33,9 +38,14 @@ testbtestAndNull Result: testbtestAndNull SQL: --------------- +.param set @__p_0_without_nulls '["testbtest"]' + SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE ("d"."Bar" <> 'testbtest') AND "d"."Bar" IS NOT NULL +WHERE "d"."Bar" NOT IN ( + SELECT "p"."value" + FROM json_each(@__p_0_without_nulls) AS "p" +) AND "d"."Bar" IS NOT NULL --------------- testatest Result: @@ -56,7 +66,12 @@ testatest Result: testatest SQL: --------------- +.param set @__p_0 '["testatest"]' + SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE ("d"."Bar" <> 'testatest') OR "d"."Bar" IS NULL +WHERE "d"."Bar" NOT IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) OR "d"."Bar" IS NULL --------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET6_0.snap deleted file mode 100644 index 5f24017f588..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET6_0.snap +++ /dev/null @@ -1,77 +0,0 @@ -testa Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - }, - { - "bar": null - } - ] - } -} ---------------- - -testa SQL: ---------------- -.param set @__p_0 'testa' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NULL OR ((@__p_0 <> '') AND ((NOT ("d"."Bar" LIKE @__p_0 || '%') OR (substr("d"."Bar", 1, length(@__p_0)) <> @__p_0)) AND (@__p_0 <> ''))) ---------------- - -testb Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - }, - { - "bar": null - } - ] - } -} ---------------- - -testb SQL: ---------------- -.param set @__p_0 'testb' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NULL OR ((@__p_0 <> '') AND ((NOT ("d"."Bar" LIKE @__p_0 || '%') OR (substr("d"."Bar", 1, length(@__p_0)) <> @__p_0)) AND (@__p_0 <> ''))) ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `nstartsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 37 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET7_0.snap deleted file mode 100644 index 6ea6c1b29c7..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET7_0.snap +++ /dev/null @@ -1,77 +0,0 @@ -testa Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - }, - { - "bar": null - } - ] - } -} ---------------- - -testa SQL: ---------------- -.param set @__p_0 'testa' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE ("d"."Bar" IS NULL) OR (@__p_0 <> '' AND (NOT ("d"."Bar" LIKE @__p_0 || '%') OR substr("d"."Bar", 1, length(@__p_0)) <> @__p_0) AND @__p_0 <> '') ---------------- - -testb Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - }, - { - "bar": null - } - ] - } -} ---------------- - -testb SQL: ---------------- -.param set @__p_0 'testb' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE ("d"."Bar" IS NULL) OR (@__p_0 <> '' AND (NOT ("d"."Bar" LIKE @__p_0 || '%') OR substr("d"."Bar", 1, length(@__p_0)) <> @__p_0) AND @__p_0 <> '') ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `nstartsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 37 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET9_0.snap similarity index 75% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET7_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET9_0.snap index 5eb7652eba3..77a754414f2 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET7_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET9_0.snap @@ -5,6 +5,9 @@ testa Result: "root": [ { "bar": "testbtest" + }, + { + "bar": null } ] } @@ -13,11 +16,11 @@ testa Result: testa SQL: --------------- -.param set @__p_0 'testa' +.param set @__p_0_startswith 'testa%' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE @__p_0 <> '' AND (NOT ("d"."Bar" LIKE @__p_0 || '%') OR substr("d"."Bar", 1, length(@__p_0)) <> @__p_0) AND @__p_0 <> '' +WHERE "d"."Bar" IS NULL OR "d"."Bar" NOT LIKE @__p_0_startswith ESCAPE '\' --------------- testb Result: @@ -27,6 +30,9 @@ testb Result: "root": [ { "bar": "testatest" + }, + { + "bar": null } ] } @@ -35,11 +41,11 @@ testb Result: testb SQL: --------------- -.param set @__p_0 'testb' +.param set @__p_0_startswith 'testb%' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE @__p_0 <> '' AND (NOT ("d"."Bar" LIKE @__p_0 || '%') OR substr("d"."Bar", 1, length(@__p_0)) <> @__p_0) AND @__p_0 <> '' +WHERE "d"."Bar" IS NULL OR "d"."Bar" NOT LIKE @__p_0_startswith ESCAPE '\' --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET6_0.snap deleted file mode 100644 index b57223aa220..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET6_0.snap +++ /dev/null @@ -1,71 +0,0 @@ -testa Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -testa SQL: ---------------- -.param set @__p_0 'testa' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NOT NULL AND ((@__p_0 = '') OR ((("d"."Bar" LIKE @__p_0 || '%') AND (substr("d"."Bar", 1, length(@__p_0)) = @__p_0)) OR (@__p_0 = ''))) ---------------- - -testb Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - } - ] - } -} ---------------- - -testb SQL: ---------------- -.param set @__p_0 'testb' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NOT NULL AND ((@__p_0 = '') OR ((("d"."Bar" LIKE @__p_0 || '%') AND (substr("d"."Bar", 1, length(@__p_0)) = @__p_0)) OR (@__p_0 = ''))) ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `startsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 36 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET7_0.snap deleted file mode 100644 index cc1b8c6b8e0..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET7_0.snap +++ /dev/null @@ -1,71 +0,0 @@ -testa Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -testa SQL: ---------------- -.param set @__p_0 'testa' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE ("d"."Bar" IS NOT NULL) AND (@__p_0 = '' OR (("d"."Bar" LIKE @__p_0 || '%') AND substr("d"."Bar", 1, length(@__p_0)) = @__p_0) OR @__p_0 = '') ---------------- - -testb Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - } - ] - } -} ---------------- - -testb SQL: ---------------- -.param set @__p_0 'testb' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE ("d"."Bar" IS NOT NULL) AND (@__p_0 = '' OR (("d"."Bar" LIKE @__p_0 || '%') AND substr("d"."Bar", 1, length(@__p_0)) = @__p_0) OR @__p_0 = '') ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `startsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 36 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET9_0.snap similarity index 76% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET7_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET9_0.snap index e008d6bc494..ef3b1890a74 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET7_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET9_0.snap @@ -13,11 +13,11 @@ testa Result: testa SQL: --------------- -.param set @__p_0 'testa' +.param set @__p_0_startswith 'testa%' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE @__p_0 = '' OR (("d"."Bar" LIKE @__p_0 || '%') AND substr("d"."Bar", 1, length(@__p_0)) = @__p_0) OR @__p_0 = '' +WHERE "d"."Bar" IS NOT NULL AND "d"."Bar" LIKE @__p_0_startswith ESCAPE '\' --------------- testb Result: @@ -35,11 +35,11 @@ testb Result: testb SQL: --------------- -.param set @__p_0 'testb' +.param set @__p_0_startswith 'testb%' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE @__p_0 = '' OR (("d"."Bar" LIKE @__p_0 || '%') AND substr("d"."Bar", 1, length(@__p_0)) = @__p_0) OR @__p_0 = '' +WHERE "d"."Bar" IS NOT NULL AND "d"."Bar" LIKE @__p_0_startswith ESCAPE '\' --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression_NET6_0.snap deleted file mode 100644 index 057635e45d9..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression_NET6_0.snap +++ /dev/null @@ -1,71 +0,0 @@ -a Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -a SQL: ---------------- -.param set @__p_0 'a' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE (@__p_0 = '') OR (instr("d"."Bar", @__p_0) > 0) ---------------- - -b Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - } - ] - } -} ---------------- - -b SQL: ---------------- -.param set @__p_0 'b' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE (@__p_0 = '') OR (instr("d"."Bar", @__p_0) > 0) ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `contains` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 34 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression_NET7_0.snap deleted file mode 100644 index f00cc81830b..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression_NET7_0.snap +++ /dev/null @@ -1,71 +0,0 @@ -a Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -a SQL: ---------------- -.param set @__p_0 'a' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE @__p_0 = '' OR instr("d"."Bar", @__p_0) > 0 ---------------- - -b Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - } - ] - } -} ---------------- - -b SQL: ---------------- -.param set @__p_0 'b' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE @__p_0 = '' OR instr("d"."Bar", @__p_0) > 0 ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `contains` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 34 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET9_0.snap similarity index 81% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET7_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET9_0.snap index 809bda6c1ac..bdf5a199f37 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET7_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET9_0.snap @@ -13,11 +13,11 @@ atest Result: atest SQL: --------------- -.param set @__p_0 'atest' +.param set @__p_0_endswith '%atest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE @__p_0 = '' OR substr("d"."Bar", -length(@__p_0)) = @__p_0 OR @__p_0 = '' +WHERE "d"."Bar" LIKE @__p_0_endswith ESCAPE '\' --------------- btest Result: @@ -35,11 +35,11 @@ btest Result: btest SQL: --------------- -.param set @__p_0 'btest' +.param set @__p_0_endswith '%btest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE @__p_0 = '' OR substr("d"."Bar", -length(@__p_0)) = @__p_0 OR @__p_0 = '' +WHERE "d"."Bar" LIKE @__p_0_endswith ESCAPE '\' --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression_NET6_0.snap deleted file mode 100644 index dd2ecacb524..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression_NET6_0.snap +++ /dev/null @@ -1,70 +0,0 @@ -testatestAndtestb Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - }, - { - "bar": "testbtest" - } - ] - } -} ---------------- - -testatestAndtestb SQL: ---------------- -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IN ('testatest', 'testbtest') ---------------- - -testbtestAndNull ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `in` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 28 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "[String!]", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- - -testatest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -testatest SQL: ---------------- -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" = 'testatest' ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression_NET7_0.snap deleted file mode 100644 index dd2ecacb524..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression_NET7_0.snap +++ /dev/null @@ -1,70 +0,0 @@ -testatestAndtestb Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - }, - { - "bar": "testbtest" - } - ] - } -} ---------------- - -testatestAndtestb SQL: ---------------- -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IN ('testatest', 'testbtest') ---------------- - -testbtestAndNull ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `in` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 28 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "[String!]", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- - -testatest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -testatest SQL: ---------------- -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" = 'testatest' ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNoContains_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNoContains_Expression_NET6_0.snap deleted file mode 100644 index c15015fbd04..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNoContains_Expression_NET6_0.snap +++ /dev/null @@ -1,71 +0,0 @@ -a Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - } - ] - } -} ---------------- - -a SQL: ---------------- -.param set @__p_0 'a' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE NOT ((@__p_0 = '') OR (instr("d"."Bar", @__p_0) > 0)) ---------------- - -b Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -b SQL: ---------------- -.param set @__p_0 'b' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE NOT ((@__p_0 = '') OR (instr("d"."Bar", @__p_0) > 0)) ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `ncontains` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 35 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNoContains_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNoContains_Expression_NET9_0.snap similarity index 89% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNoContains_Expression_NET7_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNoContains_Expression_NET9_0.snap index 5ce43d9328e..4ff2d04f65b 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNoContains_Expression_NET7_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNoContains_Expression_NET9_0.snap @@ -17,7 +17,7 @@ a SQL: SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE NOT (@__p_0 = '' OR instr("d"."Bar", @__p_0) > 0) +WHERE instr("d"."Bar", @__p_0) <= 0 --------------- b Result: @@ -39,7 +39,7 @@ b SQL: SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE NOT (@__p_0 = '' OR instr("d"."Bar", @__p_0) > 0) +WHERE instr("d"."Bar", @__p_0) <= 0 --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET6_0.snap deleted file mode 100644 index 86e3b9414c3..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET6_0.snap +++ /dev/null @@ -1,71 +0,0 @@ -atest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - } - ] - } -} ---------------- - -atest SQL: ---------------- -.param set @__p_0 'atest' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE (@__p_0 <> '') AND ((substr("d"."Bar", -length(@__p_0)) <> @__p_0) AND (@__p_0 <> '')) ---------------- - -btest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -btest SQL: ---------------- -.param set @__p_0 'btest' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE (@__p_0 <> '') AND ((substr("d"."Bar", -length(@__p_0)) <> @__p_0) AND (@__p_0 <> '')) ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `nendsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 35 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET9_0.snap similarity index 81% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET7_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET9_0.snap index 402b2d66f10..d9d444861dd 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET7_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET9_0.snap @@ -13,11 +13,11 @@ atest Result: atest SQL: --------------- -.param set @__p_0 'atest' +.param set @__p_0_endswith '%atest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE @__p_0 <> '' AND substr("d"."Bar", -length(@__p_0)) <> @__p_0 AND @__p_0 <> '' +WHERE "d"."Bar" NOT LIKE @__p_0_endswith ESCAPE '\' --------------- btest Result: @@ -35,11 +35,11 @@ btest Result: btest SQL: --------------- -.param set @__p_0 'btest' +.param set @__p_0_endswith '%btest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE @__p_0 <> '' AND substr("d"."Bar", -length(@__p_0)) <> @__p_0 AND @__p_0 <> '' +WHERE "d"."Bar" NOT LIKE @__p_0_endswith ESCAPE '\' --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET7_0.snap deleted file mode 100644 index eb9577e1027..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET7_0.snap +++ /dev/null @@ -1,63 +0,0 @@ -testatestAndtestb Result: ---------------- -{ - "data": { - "root": [] - } -} ---------------- - -testatestAndtestb SQL: ---------------- -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" NOT IN ('testatest', 'testbtest') ---------------- - -testbtestAndNull ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `nin` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 29 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "[String!]", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- - -testatest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - } - ] - } -} ---------------- - -testatest SQL: ---------------- -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" <> 'testatest' ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET9_0.snap similarity index 79% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET6_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET9_0.snap index eb9577e1027..43523d406a8 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET6_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET9_0.snap @@ -9,9 +9,14 @@ testatestAndtestb Result: testatestAndtestb SQL: --------------- +.param set @__p_0 '["testatest","testbtest"]' + SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" NOT IN ('testatest', 'testbtest') +WHERE "d"."Bar" NOT IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- testbtestAndNull @@ -57,7 +62,12 @@ testatest Result: testatest SQL: --------------- +.param set @__p_0 '["testatest"]' + SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" <> 'testatest' +WHERE "d"."Bar" NOT IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET9_0.snap similarity index 74% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET6_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET9_0.snap index 8061e9fae5f..058fd6ff261 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET6_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET9_0.snap @@ -13,11 +13,11 @@ testa Result: testa SQL: --------------- -.param set @__p_0 'testa' +.param set @__p_0_startswith 'testa%' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE (@__p_0 <> '') AND ((NOT ("d"."Bar" LIKE @__p_0 || '%') OR (substr("d"."Bar", 1, length(@__p_0)) <> @__p_0)) AND (@__p_0 <> '')) +WHERE "d"."Bar" NOT LIKE @__p_0_startswith ESCAPE '\' --------------- testb Result: @@ -35,11 +35,11 @@ testb Result: testb SQL: --------------- -.param set @__p_0 'testb' +.param set @__p_0_startswith 'testb%' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE (@__p_0 <> '') AND ((NOT ("d"."Bar" LIKE @__p_0 || '%') OR (substr("d"."Bar", 1, length(@__p_0)) <> @__p_0)) AND (@__p_0 <> '')) +WHERE "d"."Bar" NOT LIKE @__p_0_startswith ESCAPE '\' --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET9_0.snap similarity index 75% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET6_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET9_0.snap index 671645869c5..3a8dc9fdd38 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET6_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET9_0.snap @@ -13,11 +13,11 @@ testa Result: testa SQL: --------------- -.param set @__p_0 'testa' +.param set @__p_0_startswith 'testa%' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE (@__p_0 = '') OR ((("d"."Bar" LIKE @__p_0 || '%') AND (substr("d"."Bar", 1, length(@__p_0)) = @__p_0)) OR (@__p_0 = '')) +WHERE "d"."Bar" LIKE @__p_0_startswith ESCAPE '\' --------------- testb Result: @@ -35,11 +35,11 @@ testb Result: testb SQL: --------------- -.param set @__p_0 'testb' +.param set @__p_0_startswith 'testb%' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE (@__p_0 = '') OR ((("d"."Bar" LIKE @__p_0 || '%') AND (substr("d"."Bar", 1, length(@__p_0)) = @__p_0)) OR (@__p_0 = '')) +WHERE "d"."Bar" LIKE @__p_0_startswith ESCAPE '\' --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Expression/QueryableFilterVisitorTimeOnlyTests.cs b/src/HotChocolate/Data/test/Data.Filters.Tests/Expression/QueryableFilterVisitorTimeOnlyTests.cs index bef43d6a408..2b05ac893a1 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Expression/QueryableFilterVisitorTimeOnlyTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Expression/QueryableFilterVisitorTimeOnlyTests.cs @@ -5,7 +5,6 @@ namespace HotChocolate.Data.Filters.Expressions; public class QueryableFilterVisitorTimeOnlyTests : FilterVisitorTestBase { -#if NET6_0_OR_GREATER [Fact] public void Create_ShortEqual_Expression() { @@ -82,5 +81,4 @@ public class FooNullableFilterInput : FilterInputType { } -#endif } diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/FilterAttributeTests.cs b/src/HotChocolate/Data/test/Data.Filters.Tests/FilterAttributeTests.cs index 54a584e6e11..a086fb68784 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/FilterAttributeTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/FilterAttributeTests.cs @@ -39,7 +39,6 @@ public void Create_Schema_With_FilterAttributes() .Create() .MatchSnapshot(); -#if NET6_0_OR_GREATER [Fact] public void Create_Schema_With_FilterInput_With_GenericAttribute() => SchemaBuilder.New() @@ -62,7 +61,6 @@ public class Query5 new Foo { Bar = null!, Baz = 0, }, }; } -#endif public class Query1 { diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionFilterTests.cs b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionFilterTests.cs index 17c1d545f96..57d7696ac4a 100644 --- a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionFilterTests.cs +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionFilterTests.cs @@ -152,7 +152,7 @@ public async Task Create_DeepFilterObjectTwoProjections() // assert await Snapshot - .Create() + .Create(postFix: TestEnvironment.TargetFramework) .AddResult(res1) .MatchAsync(); } @@ -192,7 +192,7 @@ public async Task Create_ListObjectDifferentLevelProjection() // assert await Snapshot - .Create() + .Create(postFix: TestEnvironment.TargetFramework) .AddResult(res1) .MatchAsync(); } @@ -230,7 +230,7 @@ public async Task Create_DeepFilterObjectTwoProjections_Nullable() // assert await Snapshot - .Create() + .Create(postFix: TestEnvironment.TargetFramework) .AddResult(res1) .MatchAsync(); } @@ -269,7 +269,7 @@ public async Task Create_ListObjectDifferentLevelProjection_Nullable() // assert await Snapshot - .Create() + .Create(postFix: TestEnvironment.TargetFramework) .AddResult(res1) .MatchAsync(); } diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionHashSetTest.cs b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionHashSetTest.cs index b4fb596c9cd..737e7f6caaa 100644 --- a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionHashSetTest.cs +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionHashSetTest.cs @@ -71,7 +71,7 @@ public async Task Create_DeepFilterObjectTwoProjections() // assert await Snapshot - .Create() + .Create(postFix: TestEnvironment.TargetFramework) .AddResult(res1) .MatchAsync(); } @@ -104,7 +104,7 @@ public async Task Create_ListObjectDifferentLevelProjection() // assert await Snapshot - .Create() + .Create(postFix: TestEnvironment.TargetFramework) .AddResult(res1) .MatchAsync(); } diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionSetTest.cs b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionSetTest.cs index 31105865b98..2f2d990dc60 100644 --- a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionSetTest.cs +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionSetTest.cs @@ -77,7 +77,7 @@ public async Task Create_DeepFilterObjectTwoProjections() // assert await Snapshot - .Create() + .Create(postFix: TestEnvironment.TargetFramework) .AddResult(res1) .MatchAsync(); } @@ -110,7 +110,7 @@ public async Task Create_ListObjectDifferentLevelProjection() // assert await Snapshot - .Create() + .Create(postFix: TestEnvironment.TargetFramework) .AddResult(res1) .MatchAsync(); } diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionSortedSetTest.cs b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionSortedSetTest.cs index 9ca39388c52..142a2dbcbed 100644 --- a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionSortedSetTest.cs +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionSortedSetTest.cs @@ -71,7 +71,7 @@ public async Task Create_DeepFilterObjectTwoProjections() // assert await Snapshot - .Create() + .Create(postFix: TestEnvironment.TargetFramework) .AddResult(res1) .MatchAsync(); } @@ -104,7 +104,7 @@ public async Task Create_ListObjectDifferentLevelProjection() // assert await Snapshot - .Create() + .Create(postFix: TestEnvironment.TargetFramework) .AddResult(res1) .MatchAsync(); } diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionSortingTests.cs b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionSortingTests.cs index 1fb4deaedaf..7353ca50aa3 100644 --- a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionSortingTests.cs +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionSortingTests.cs @@ -149,7 +149,7 @@ public async Task Create_DeepFilterObjectTwoProjections() // assert await Snapshot - .Create() + .Create(postFix: TestEnvironment.TargetFramework) .AddResult(res1) .MatchAsync(); } @@ -187,7 +187,7 @@ public async Task Create_ListObjectDifferentLevelProjection() // assert await Snapshot - .Create() + .Create(postFix: TestEnvironment.TargetFramework) .AddResult(res1) .MatchAsync(); } diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_NET8_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections.snap rename to src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_NET8_0.snap diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_NET9_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_NET9_0.snap new file mode 100644 index 00000000000..2b9c7406bfc --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_NET9_0.snap @@ -0,0 +1,42 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "objectArray": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "objectArray": [] + } + } + ] + } +} +--------------- + +SQL: +--------------- +.param set @__p_0 'a' + +SELECT 1, "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT 1 AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" + WHERE "f0"."BarString" = @__p_0 +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "f"."Id", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_Nullable.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_Nullable_NET8_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_Nullable.snap rename to src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_Nullable_NET8_0.snap diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_Nullable_NET9_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_Nullable_NET9_0.snap new file mode 100644 index 00000000000..069a5cffa62 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_Nullable_NET9_0.snap @@ -0,0 +1,45 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "objectArray": [] + } + }, + { + "foo": { + "objectArray": [] + } + }, + { + "foo": { + "objectArray": [] + } + }, + { + "foo": { + "objectArray": [] + } + } + ] + } +} +--------------- + +SQL: +--------------- +.param set @__p_0 'a' + +SELECT "f"."Id" IS NOT NULL, "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT "f0"."Id" IS NOT NULL AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooNullableId" + FROM "BarNullableDeep" AS "b" + LEFT JOIN "FooDeep" AS "f0" ON "b"."FooId" = "f0"."Id" + WHERE "f0"."BarString" = @__p_0 +) AS "s" ON "f"."Id" = "s"."FooNullableId" +ORDER BY "d"."Id", "f"."Id", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_NET8_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection.snap rename to src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_NET8_0.snap diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_NET9_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_NET9_0.snap new file mode 100644 index 00000000000..f21777f3f0a --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_NET9_0.snap @@ -0,0 +1,44 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testatest", + "objectArray": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "barString": "testbtest", + "objectArray": [] + } + } + ] + } +} +--------------- + +SQL: +--------------- +.param set @__p_0 'a' + +SELECT 1, "f"."BarString", "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT 1 AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" + WHERE "f0"."BarString" = @__p_0 +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "f"."Id", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_Nullable.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_Nullable_NET8_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_Nullable.snap rename to src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_Nullable_NET8_0.snap diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_Nullable_NET9_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_Nullable_NET9_0.snap new file mode 100644 index 00000000000..6f2ffe393ac --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_Nullable_NET9_0.snap @@ -0,0 +1,49 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testatest", + "objectArray": [] + } + }, + { + "foo": { + "barString": "testbtest", + "objectArray": [] + } + }, + { + "foo": { + "barString": "testctest", + "objectArray": [] + } + }, + { + "foo": { + "barString": "testdtest", + "objectArray": [] + } + } + ] + } +} +--------------- + +SQL: +--------------- +.param set @__p_0 'a' + +SELECT "f"."Id" IS NOT NULL, "f"."BarString", "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT "f0"."Id" IS NOT NULL AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooNullableId" + FROM "BarNullableDeep" AS "b" + LEFT JOIN "FooDeep" AS "f0" ON "b"."FooId" = "f0"."Id" + WHERE "f0"."BarString" = @__p_0 +) AS "s" ON "f"."Id" = "s"."FooNullableId" +ORDER BY "d"."Id", "f"."Id", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_DeepFilterObjectTwoProjections.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_DeepFilterObjectTwoProjections_NET8_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_DeepFilterObjectTwoProjections.snap rename to src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_DeepFilterObjectTwoProjections_NET8_0.snap diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_DeepFilterObjectTwoProjections_NET9_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_DeepFilterObjectTwoProjections_NET9_0.snap new file mode 100644 index 00000000000..10f30603053 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_DeepFilterObjectTwoProjections_NET9_0.snap @@ -0,0 +1,46 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "objectSet": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "objectSet": [ + { + "foo": { + "barString": "d", + "barShort": 14 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT 1, "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT 1 AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "f"."Id", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_ListObjectDifferentLevelProjection.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_ListObjectDifferentLevelProjection_NET8_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_ListObjectDifferentLevelProjection.snap rename to src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_ListObjectDifferentLevelProjection_NET8_0.snap diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_ListObjectDifferentLevelProjection_NET9_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_ListObjectDifferentLevelProjection_NET9_0.snap new file mode 100644 index 00000000000..cf394fbcfa0 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_ListObjectDifferentLevelProjection_NET9_0.snap @@ -0,0 +1,48 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testatest", + "objectSet": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "barString": "testbtest", + "objectSet": [ + { + "foo": { + "barString": "d", + "barShort": 14 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT 1, "f"."BarString", "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT 1 AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "f"."Id", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_DeepFilterObjectTwoProjections.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_DeepFilterObjectTwoProjections_NET8_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_DeepFilterObjectTwoProjections.snap rename to src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_DeepFilterObjectTwoProjections_NET8_0.snap diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_DeepFilterObjectTwoProjections_NET9_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_DeepFilterObjectTwoProjections_NET9_0.snap new file mode 100644 index 00000000000..10f30603053 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_DeepFilterObjectTwoProjections_NET9_0.snap @@ -0,0 +1,46 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "objectSet": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "objectSet": [ + { + "foo": { + "barString": "d", + "barShort": 14 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT 1, "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT 1 AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "f"."Id", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_ListObjectDifferentLevelProjection.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_ListObjectDifferentLevelProjection_NET8_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_ListObjectDifferentLevelProjection.snap rename to src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_ListObjectDifferentLevelProjection_NET8_0.snap diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_ListObjectDifferentLevelProjection_NET9_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_ListObjectDifferentLevelProjection_NET9_0.snap new file mode 100644 index 00000000000..cf394fbcfa0 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_ListObjectDifferentLevelProjection_NET9_0.snap @@ -0,0 +1,48 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testatest", + "objectSet": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "barString": "testbtest", + "objectSet": [ + { + "foo": { + "barString": "d", + "barShort": 14 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT 1, "f"."BarString", "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT 1 AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "f"."Id", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_DeepFilterObjectTwoProjections.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_DeepFilterObjectTwoProjections_NET8_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_DeepFilterObjectTwoProjections.snap rename to src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_DeepFilterObjectTwoProjections_NET8_0.snap diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_DeepFilterObjectTwoProjections_NET9_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_DeepFilterObjectTwoProjections_NET9_0.snap new file mode 100644 index 00000000000..10f30603053 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_DeepFilterObjectTwoProjections_NET9_0.snap @@ -0,0 +1,46 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "objectSet": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "objectSet": [ + { + "foo": { + "barString": "d", + "barShort": 14 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT 1, "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT 1 AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "f"."Id", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_ListObjectDifferentLevelProjection.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_ListObjectDifferentLevelProjection_NET8_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_ListObjectDifferentLevelProjection.snap rename to src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_ListObjectDifferentLevelProjection_NET8_0.snap diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_ListObjectDifferentLevelProjection_NET9_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_ListObjectDifferentLevelProjection_NET9_0.snap new file mode 100644 index 00000000000..cf394fbcfa0 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_ListObjectDifferentLevelProjection_NET9_0.snap @@ -0,0 +1,48 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testatest", + "objectSet": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "barString": "testbtest", + "objectSet": [ + { + "foo": { + "barString": "d", + "barShort": 14 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT 1, "f"."BarString", "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT 1 AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "f"."Id", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_DeepFilterObjectTwoProjections.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_DeepFilterObjectTwoProjections_NET8_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_DeepFilterObjectTwoProjections.snap rename to src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_DeepFilterObjectTwoProjections_NET8_0.snap diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_DeepFilterObjectTwoProjections_NET9_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_DeepFilterObjectTwoProjections_NET9_0.snap new file mode 100644 index 00000000000..17e0b237d75 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_DeepFilterObjectTwoProjections_NET9_0.snap @@ -0,0 +1,70 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "objectArray": [ + { + "foo": { + "barString": "a", + "barShort": 1 + } + }, + { + "foo": { + "barString": "a", + "barShort": 3 + } + }, + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "objectArray": [ + { + "foo": { + "barString": "a", + "barShort": 1 + } + }, + { + "foo": { + "barString": "a", + "barShort": 3 + } + }, + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT 1, "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT 1 AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "f"."Id", "s"."BarShort", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_ListObjectDifferentLevelProjection_NET8_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_ListObjectDifferentLevelProjection_NET8_0.snap new file mode 100644 index 00000000000..adf7ed325a7 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_ListObjectDifferentLevelProjection_NET8_0.snap @@ -0,0 +1,72 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testatest", + "objectArray": [ + { + "foo": { + "barString": "a", + "barShort": 1 + } + }, + { + "foo": { + "barString": "a", + "barShort": 3 + } + }, + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "barString": "testbtest", + "objectArray": [ + { + "foo": { + "barString": "a", + "barShort": 1 + } + }, + { + "foo": { + "barString": "a", + "barShort": 3 + } + }, + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT 1, "f"."BarString", "d"."Id", "f"."Id", "t"."c", "t"."BarString", "t"."BarShort", "t"."Id", "t"."Id0" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT 1 AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "t" ON "f"."Id" = "t"."FooId" +ORDER BY "d"."Id", "f"."Id", "t"."BarShort", "t"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_ListObjectDifferentLevelProjection_NET9_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_ListObjectDifferentLevelProjection_NET9_0.snap new file mode 100644 index 00000000000..f90b85ab008 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_ListObjectDifferentLevelProjection_NET9_0.snap @@ -0,0 +1,72 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testatest", + "objectArray": [ + { + "foo": { + "barString": "a", + "barShort": 1 + } + }, + { + "foo": { + "barString": "a", + "barShort": 3 + } + }, + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "barString": "testbtest", + "objectArray": [ + { + "foo": { + "barString": "a", + "barShort": 1 + } + }, + { + "foo": { + "barString": "a", + "barShort": 3 + } + }, + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT 1, "f"."BarString", "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT 1 AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "f"."Id", "s"."BarShort", "s"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/QueryableSortVisitorExpressionTests.cs b/src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/QueryableSortVisitorExpressionTests.cs index 8502190a007..c9ae6e02f70 100644 --- a/src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/QueryableSortVisitorExpressionTests.cs +++ b/src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/QueryableSortVisitorExpressionTests.cs @@ -41,7 +41,7 @@ public async Task Create_StringConcatExpression() await SnapshotExtensions.AddResult( SnapshotExtensions.AddResult( Snapshot - .Create(postFix: TestEnvironment.TargetFramework), res1, "DESC"), res2, "ASC") + .Create(), res1, "DESC"), res2, "ASC") .MatchAsync(); } diff --git a/src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/__snapshots__/QueryableSortVisitorExpressionTests.Create_StringConcatExpression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/__snapshots__/QueryableSortVisitorExpressionTests.Create_StringConcatExpression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/__snapshots__/QueryableSortVisitorExpressionTests.Create_StringConcatExpression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/__snapshots__/QueryableSortVisitorExpressionTests.Create_StringConcatExpression.snap diff --git a/src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/__snapshots__/QueryableSortVisitorExpressionTests.Create_StringConcatExpression_NET6_0.snap b/src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/__snapshots__/QueryableSortVisitorExpressionTests.Create_StringConcatExpression_NET6_0.snap deleted file mode 100644 index 2d1ee6f20f8..00000000000 --- a/src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/__snapshots__/QueryableSortVisitorExpressionTests.Create_StringConcatExpression_NET6_0.snap +++ /dev/null @@ -1,49 +0,0 @@ -DESC Result: ---------------- -{ - "data": { - "root": [ - { - "name": "Sam", - "lastName": "Sampleman" - }, - { - "name": "Foo", - "lastName": "Galoo" - } - ] - } -} ---------------- - -DESC SQL: ---------------- -SELECT "d"."Id", "d"."LastName", "d"."Name" -FROM "Data" AS "d" -ORDER BY (COALESCE("d"."Name", '') || ' ') || COALESCE("d"."LastName", '') DESC ---------------- - -ASC Result: ---------------- -{ - "data": { - "root": [ - { - "name": "Foo", - "lastName": "Galoo" - }, - { - "name": "Sam", - "lastName": "Sampleman" - } - ] - } -} ---------------- - -ASC SQL: ---------------- -SELECT "d"."Id", "d"."LastName", "d"."Name" -FROM "Data" AS "d" -ORDER BY (COALESCE("d"."Name", '') || ' ') || COALESCE("d"."LastName", '') ---------------- diff --git a/src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/__snapshots__/QueryableSortVisitorExpressionTests.Create_StringConcatExpression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/__snapshots__/QueryableSortVisitorExpressionTests.Create_StringConcatExpression_NET7_0.snap deleted file mode 100644 index 2d1ee6f20f8..00000000000 --- a/src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/__snapshots__/QueryableSortVisitorExpressionTests.Create_StringConcatExpression_NET7_0.snap +++ /dev/null @@ -1,49 +0,0 @@ -DESC Result: ---------------- -{ - "data": { - "root": [ - { - "name": "Sam", - "lastName": "Sampleman" - }, - { - "name": "Foo", - "lastName": "Galoo" - } - ] - } -} ---------------- - -DESC SQL: ---------------- -SELECT "d"."Id", "d"."LastName", "d"."Name" -FROM "Data" AS "d" -ORDER BY (COALESCE("d"."Name", '') || ' ') || COALESCE("d"."LastName", '') DESC ---------------- - -ASC Result: ---------------- -{ - "data": { - "root": [ - { - "name": "Foo", - "lastName": "Galoo" - }, - { - "name": "Sam", - "lastName": "Sampleman" - } - ] - } -} ---------------- - -ASC SQL: ---------------- -SELECT "d"."Id", "d"."LastName", "d"."Name" -FROM "Data" AS "d" -ORDER BY (COALESCE("d"."Name", '') || ' ') || COALESCE("d"."LastName", '') ---------------- diff --git a/src/HotChocolate/Data/test/Data.Sorting.Tests/SortAttributeTests.cs b/src/HotChocolate/Data/test/Data.Sorting.Tests/SortAttributeTests.cs index d3776700087..2391d6742a9 100644 --- a/src/HotChocolate/Data/test/Data.Sorting.Tests/SortAttributeTests.cs +++ b/src/HotChocolate/Data/test/Data.Sorting.Tests/SortAttributeTests.cs @@ -63,7 +63,6 @@ public void Create_Schema_With_SortAttributes() schema.MatchSnapshot(); } -#if NET6_0_OR_GREATER [Fact] public void Create_Schema_With_GenericSortAttributes() { @@ -92,7 +91,6 @@ public class Query5 new Foo { Bar = null!, Baz = 0, }, }; } -#endif public class Query1 { diff --git a/src/HotChocolate/Data/test/Data.Tests/ExecutableTests.cs b/src/HotChocolate/Data/test/Data.Tests/ExecutableTests.cs index 99ad97cfeba..148ab0848cc 100644 --- a/src/HotChocolate/Data/test/Data.Tests/ExecutableTests.cs +++ b/src/HotChocolate/Data/test/Data.Tests/ExecutableTests.cs @@ -56,7 +56,8 @@ public async Task ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault() var result = await executable.SingleOrDefaultAsync(default); // assert - new { result, executable = executable.Print(), }.MatchSnapshot(); + new { result, executable = executable.Print(), } + .MatchSnapshot(postFix: TestEnvironment.TargetFramework); } [Fact] diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault.snap b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET8_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault.snap rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET8_0.snap diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET9_0.snap b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET9_0.snap new file mode 100644 index 00000000000..be38bb5dff6 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET9_0.snap @@ -0,0 +1,17 @@ +{ + "result": { + "Id": 1, + "Name": "Foo", + "Books": [ + { + "Id": 1, + "AuthorId": 0, + "Title": "Foo1", + "Author": null, + "Publisher": null + } + ], + "Publishers": [] + }, + "executable": "System.Linq.Enumerable+IListSkipTakeIterator`1[HotChocolate.Data.Author]" +} diff --git a/src/HotChocolate/Diagnostics/Directory.Build.props b/src/HotChocolate/Diagnostics/Directory.Build.props index 83e630e0415..ea6e2bc3aaf 100644 --- a/src/HotChocolate/Diagnostics/Directory.Build.props +++ b/src/HotChocolate/Diagnostics/Directory.Build.props @@ -1,8 +1,4 @@ - - $(Library2TargetFrameworks) - - diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityTestHelper.cs b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityTestHelper.cs index bcc69e931eb..7064a4d9b3f 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityTestHelper.cs +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityTestHelper.cs @@ -1,5 +1,7 @@ using System.Diagnostics; +#if NET8_0 using HotChocolate.Execution; +#endif using HotChocolate.Utilities; namespace HotChocolate.Diagnostics; @@ -10,8 +12,8 @@ public static IDisposable CaptureActivities(out object activities) { var sync = new object(); var listener = new ActivityListener(); - var root = new OrderedDictionary(); - var lookup = new Dictionary(); + var root = new OrderedDictionary(); + var lookup = new Dictionary>(); Activity rootActivity = default!; listener.ShouldListenTo = source => source.Name.EqualsOrdinal("HotChocolate.Diagnostics"); @@ -24,14 +26,14 @@ public static IDisposable CaptureActivities(out object activities) lookup.TryGetValue(rootActivity, out var parentData)) { RegisterActivity(a, parentData); - lookup[a] = (OrderedDictionary)a.GetCustomProperty("test.data")!; + lookup[a] = (OrderedDictionary)a.GetCustomProperty("test.data")!; } if (a.Parent is not null && lookup.TryGetValue(a.Parent, out parentData)) { RegisterActivity(a, parentData); - lookup[a] = (OrderedDictionary)a.GetCustomProperty("test.data")!; + lookup[a] = (OrderedDictionary)a.GetCustomProperty("test.data")!; } } }; @@ -48,7 +50,9 @@ public static IDisposable CaptureActivities(out object activities) return new Session(rootActivity, listener); } - private static void RegisterActivity(Activity activity, OrderedDictionary parent) + private static void RegisterActivity( + Activity activity, + OrderedDictionary parent) { if (!(parent.TryGetValue("activities", out var value) && value is List children)) { @@ -56,7 +60,7 @@ private static void RegisterActivity(Activity activity, OrderedDictionary parent parent["activities"] = children; } - var data = new OrderedDictionary(); + var data = new OrderedDictionary(); activity.SetCustomProperty("test.data", data); SerializeActivity(activity); children.Add(data); @@ -64,7 +68,7 @@ private static void RegisterActivity(Activity activity, OrderedDictionary parent private static void SerializeActivity(Activity activity) { - var data = (OrderedDictionary)activity.GetCustomProperty("test.data")!; + var data = (OrderedDictionary)activity.GetCustomProperty("test.data")!; if (data is null) { diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/QueryInstrumentationTests.cs b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/QueryInstrumentationTests.cs index 48545576da8..7692ad8d77e 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/QueryInstrumentationTests.cs +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/QueryInstrumentationTests.cs @@ -23,11 +23,7 @@ public async Task Track_events_of_a_simple_query_default() .ExecuteRequestAsync("{ sayHello }"); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -44,11 +40,7 @@ public async Task Track_data_loader_events() .ExecuteRequestAsync("{ dataLoader(key: \"abc\") }"); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -65,11 +57,7 @@ public async Task Track_data_loader_events_with_keys() .ExecuteRequestAsync("{ dataLoader(key: \"abc\") }"); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -154,11 +142,7 @@ public async Task Create_operation_display_name_with_1_field() .ExecuteRequestAsync("{ a: sayHello }"); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -179,11 +163,7 @@ public async Task Create_operation_display_name_with_1_field_and_op() .ExecuteRequestAsync("query GetA { a: sayHello }"); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -204,11 +184,7 @@ public async Task Create_operation_display_name_with_3_field() .ExecuteRequestAsync("{ a: sayHello b: sayHello c: sayHello }"); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -229,11 +205,7 @@ public async Task Create_operation_display_name_with_4_field() .ExecuteRequestAsync("{ a: sayHello b: sayHello c: sayHello d: sayHello }"); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -250,11 +222,7 @@ public async Task Track_events_of_a_simple_query_detailed() .ExecuteRequestAsync("{ sayHello }"); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -271,11 +239,7 @@ public async Task Ensure_operation_name_is_used_as_request_name() .ExecuteRequestAsync("query SayHelloOperation { sayHello }"); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -296,11 +260,7 @@ public async Task Allow_document_to_be_captured() .ExecuteRequestAsync("query SayHelloOperation { sayHello }"); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -321,11 +281,7 @@ public async Task Ensure_that_the_validation_activity_has_an_error_status() .ExecuteRequestAsync("query SayHelloOperation { sayHello_ }"); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -346,11 +302,7 @@ public async Task Cause_a_resolver_error_that_deletes_the_whole_result() .ExecuteRequestAsync("query SayHelloOperation { causeFatalError }"); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -384,11 +336,7 @@ query SayHelloOperation { """); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ServerInstrumentationTests.cs b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ServerInstrumentationTests.cs index 8cf3c7985fb..6ec771f5d6b 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ServerInstrumentationTests.cs +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ServerInstrumentationTests.cs @@ -35,11 +35,7 @@ await server.PostAsync(new ClientQueryRequest }); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -64,11 +60,7 @@ await server.PostAsync(new ClientQueryRequest }); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -93,11 +85,7 @@ await server.GetAsync(new ClientQueryRequest }); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -123,11 +111,7 @@ await server.PostAsync(new ClientQueryRequest }); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -157,11 +141,7 @@ await server.PostAsync(new ClientQueryRequest }); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -191,11 +171,7 @@ await server.PostAsync(new ClientQueryRequest }); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -222,11 +198,7 @@ await server.PostAsync(new ClientQueryRequest }); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -247,11 +219,7 @@ public async Task Http_Get_SDL_download() await response.Content.ReadAsStringAsync(); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -280,11 +248,7 @@ ... on Droid @defer(label: ""my_id"") }); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -319,11 +283,7 @@ await server.PostRawAsync(new ClientQueryRequest }); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -358,11 +318,7 @@ await server.PostRawAsync(new ClientQueryRequest }); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -389,11 +345,7 @@ await server.PostRawAsync(new ClientQueryRequest }); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } @@ -420,11 +372,7 @@ await server.PostRawAsync(new ClientQueryRequest }); // assert -#if NET7_0_OR_GREATER - activities.MatchSnapshot(new SnapshotNameExtension("_NET7")); -#else activities.MatchSnapshot(); -#endif } } diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Allow_document_to_be_captured.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Allow_document_to_be_captured.snap index 8007cd596b6..accc652c5bc 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Allow_document_to_be_captured.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Allow_document_to_be_captured.snap @@ -29,11 +29,11 @@ "event": [ { "Name": "AddedOperationToCache", - "Tags": {} + "Tags": [] }, { "Name": "AddedDocumentToCache", - "Tags": {} + "Tags": [] } ], "activities": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Allow_document_to_be_captured__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Allow_document_to_be_captured__NET7.snap deleted file mode 100644 index accc652c5bc..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Allow_document_to_be_captured__NET7.snap +++ /dev/null @@ -1,141 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteRequest", - "DisplayName": "query SayHelloOperation { sayHello }", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "6af18618ae20c266f6ffc352b78cb69b" - }, - { - "Key": "graphql.document.hash", - "Value": "6af18618ae20c266f6ffc352b78cb69b" - }, - { - "Key": "graphql.operation.id", - "Value": "_Default-1-0-6af18618ae20c266f6ffc352b78cb69b" - }, - { - "Key": "graphql.operation.name", - "Value": "SayHelloOperation" - }, - { - "Key": "graphql.document.body", - "Value": "query SayHelloOperation {\n sayHello\n}" - } - ], - "event": [ - { - "Name": "AddedOperationToCache", - "Tags": [] - }, - { - "Name": "AddedDocumentToCache", - "Tags": [] - } - ], - "activities": [ - { - "OperationName": "ParseDocument", - "DisplayName": "Parse Document", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "6af18618ae20c266f6ffc352b78cb69b" - }, - { - "Key": "graphql.document.hash", - "Value": "6af18618ae20c266f6ffc352b78cb69b" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "CompileOperation", - "DisplayName": "Compile Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteOperation", - "DisplayName": "Execute Operation SayHelloOperation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/sayHello", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "sayHello" - }, - { - "Key": "graphql.selection.type", - "Value": "String!" - }, - { - "Key": "graphql.selection.path", - "Value": "/sayHello" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/sayHello" - }, - { - "Key": "graphql.selection.field.name", - "Value": "sayHello" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "SimpleQuery.sayHello" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "SimpleQuery" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - } - ] - } - ] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result.snap index d59fa861e4c..f50860cdcec 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result.snap @@ -33,11 +33,11 @@ "event": [ { "Name": "AddedOperationToCache", - "Tags": {} + "Tags": [] }, { "Name": "AddedDocumentToCache", - "Tags": {} + "Tags": [] } ], "activities": [ @@ -138,13 +138,28 @@ "event": [ { "Name": "exception", - "Tags": { - "exception.message": "fail", - "exception.type": "GRAPHQL_ERROR", - "graphql.error.path": "/causeFatalError", - "graphql.error.location.column": 27, - "graphql.error.location.line": 1 - } + "Tags": [ + { + "Key": "exception.message", + "Value": "fail" + }, + { + "Key": "exception.type", + "Value": "GRAPHQL_ERROR" + }, + { + "Key": "graphql.error.path", + "Value": "/causeFatalError" + }, + { + "Key": "graphql.error.location.column", + "Value": 27 + }, + { + "Key": "graphql.error.location.line", + "Value": 1 + } + ] } ] } diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result__NET7.snap deleted file mode 100644 index f50860cdcec..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result__NET7.snap +++ /dev/null @@ -1,171 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteRequest", - "DisplayName": "query SayHelloOperation { causeFatalError }", - "Status": "Error", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "851fb754d9ba6b5cc5a55ebcbea2621d" - }, - { - "Key": "graphql.document.hash", - "Value": "851fb754d9ba6b5cc5a55ebcbea2621d" - }, - { - "Key": "graphql.operation.id", - "Value": "_Default-1-0-851fb754d9ba6b5cc5a55ebcbea2621d" - }, - { - "Key": "graphql.operation.name", - "Value": "SayHelloOperation" - }, - { - "Key": "graphql.document.body", - "Value": "query SayHelloOperation {\n causeFatalError\n}" - }, - { - "Key": "otel.status_code", - "Value": "ERROR" - } - ], - "event": [ - { - "Name": "AddedOperationToCache", - "Tags": [] - }, - { - "Name": "AddedDocumentToCache", - "Tags": [] - } - ], - "activities": [ - { - "OperationName": "ParseDocument", - "DisplayName": "Parse Document", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "851fb754d9ba6b5cc5a55ebcbea2621d" - }, - { - "Key": "graphql.document.hash", - "Value": "851fb754d9ba6b5cc5a55ebcbea2621d" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "CompileOperation", - "DisplayName": "Compile Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteOperation", - "DisplayName": "Execute Operation SayHelloOperation", - "Status": "Error", - "tags": [ - { - "Key": "otel.status_code", - "Value": "ERROR" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/causeFatalError", - "Status": "Error", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "causeFatalError" - }, - { - "Key": "graphql.selection.type", - "Value": "String!" - }, - { - "Key": "graphql.selection.path", - "Value": "/causeFatalError" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/causeFatalError" - }, - { - "Key": "graphql.selection.field.name", - "Value": "causeFatalError" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "SimpleQuery.causeFatalError" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "SimpleQuery" - }, - { - "Key": "otel.status_code", - "Value": "ERROR" - } - ], - "event": [ - { - "Name": "exception", - "Tags": [ - { - "Key": "exception.message", - "Value": "fail" - }, - { - "Key": "exception.type", - "Value": "GRAPHQL_ERROR" - }, - { - "Key": "graphql.error.path", - "Value": "/causeFatalError" - }, - { - "Key": "graphql.error.location.column", - "Value": 27 - }, - { - "Key": "graphql.error.location.line", - "Value": 1 - } - ] - } - ] - } - ] - } - ] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result_deep.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result_deep.snap index e8fcadaf5c3..df987de347c 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result_deep.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result_deep.snap @@ -57,13 +57,28 @@ "event": [ { "Name": "exception", - "Tags": { - "exception.message": "The field `causeFatalError` does not exist on the type `Deeper`.", - "exception.type": "GRAPHQL_ERROR", - "graphql.error.path": "/deep/deeper/deeps/deeper", - "graphql.error.location.column": 21, - "graphql.error.location.line": 6 - } + "Tags": [ + { + "Key": "exception.message", + "Value": "The field `causeFatalError` does not exist on the type `Deeper`." + }, + { + "Key": "exception.type", + "Value": "GRAPHQL_ERROR" + }, + { + "Key": "graphql.error.path", + "Value": "/deep/deeper/deeps/deeper" + }, + { + "Key": "graphql.error.location.column", + "Value": 21 + }, + { + "Key": "graphql.error.location.line", + "Value": 6 + } + ] } ] } diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result_deep__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result_deep__NET7.snap deleted file mode 100644 index df987de347c..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result_deep__NET7.snap +++ /dev/null @@ -1,88 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteRequest", - "DisplayName": "Execute Request", - "Status": "Error", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "803df9346db185e9dc0b22dd3909aa70" - }, - { - "Key": "graphql.document.hash", - "Value": "803df9346db185e9dc0b22dd3909aa70" - }, - { - "Key": "graphql.document.body", - "Value": "query SayHelloOperation {\n deep {\n deeper {\n deeps {\n deeper {\n causeFatalError\n }\n }\n }\n }\n}" - }, - { - "Key": "otel.status_code", - "Value": "ERROR" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ParseDocument", - "DisplayName": "Parse Document", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Error", - "tags": [ - { - "Key": "otel.status_code", - "Value": "ERROR" - }, - { - "Key": "graphql.document.id", - "Value": "803df9346db185e9dc0b22dd3909aa70" - }, - { - "Key": "graphql.document.hash", - "Value": "803df9346db185e9dc0b22dd3909aa70" - } - ], - "event": [ - { - "Name": "exception", - "Tags": [ - { - "Key": "exception.message", - "Value": "The field `causeFatalError` does not exist on the type `Deeper`." - }, - { - "Key": "exception.type", - "Value": "GRAPHQL_ERROR" - }, - { - "Key": "graphql.error.path", - "Value": "/deep/deeper/deeps/deeper" - }, - { - "Key": "graphql.error.location.column", - "Value": 21 - }, - { - "Key": "graphql.error.location.line", - "Value": 6 - } - ] - } - ] - } - ] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field.snap index d70ec95a621..554fb6c5705 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field.snap @@ -21,11 +21,11 @@ "event": [ { "Name": "AddedOperationToCache", - "Tags": {} + "Tags": [] }, { "Name": "AddedDocumentToCache", - "Tags": {} + "Tags": [] } ], "activities": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field__NET7.snap deleted file mode 100644 index 554fb6c5705..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field__NET7.snap +++ /dev/null @@ -1,133 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteRequest", - "DisplayName": "query { a }", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "452ea802c4d1bf2a81a7411b0b361d9f" - }, - { - "Key": "graphql.document.hash", - "Value": "452ea802c4d1bf2a81a7411b0b361d9f" - }, - { - "Key": "graphql.operation.id", - "Value": "_Default-1-0-452ea802c4d1bf2a81a7411b0b361d9f" - } - ], - "event": [ - { - "Name": "AddedOperationToCache", - "Tags": [] - }, - { - "Name": "AddedDocumentToCache", - "Tags": [] - } - ], - "activities": [ - { - "OperationName": "ParseDocument", - "DisplayName": "Parse Document", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "452ea802c4d1bf2a81a7411b0b361d9f" - }, - { - "Key": "graphql.document.hash", - "Value": "452ea802c4d1bf2a81a7411b0b361d9f" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "CompileOperation", - "DisplayName": "Compile Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteOperation", - "DisplayName": "Execute Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/a", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "a" - }, - { - "Key": "graphql.selection.type", - "Value": "String!" - }, - { - "Key": "graphql.selection.path", - "Value": "/a" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/a" - }, - { - "Key": "graphql.selection.field.name", - "Value": "sayHello" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "SimpleQuery.sayHello" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "SimpleQuery" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - } - ] - } - ] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field_and_op.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field_and_op.snap index 8c9e0d05308..325b05cc8bf 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field_and_op.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field_and_op.snap @@ -25,11 +25,11 @@ "event": [ { "Name": "AddedOperationToCache", - "Tags": {} + "Tags": [] }, { "Name": "AddedDocumentToCache", - "Tags": {} + "Tags": [] } ], "activities": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field_and_op__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field_and_op__NET7.snap deleted file mode 100644 index 325b05cc8bf..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field_and_op__NET7.snap +++ /dev/null @@ -1,137 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteRequest", - "DisplayName": "query GetA { a }", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "cee0e2939ece72d650cb0331f4be4669" - }, - { - "Key": "graphql.document.hash", - "Value": "cee0e2939ece72d650cb0331f4be4669" - }, - { - "Key": "graphql.operation.id", - "Value": "_Default-1-0-cee0e2939ece72d650cb0331f4be4669" - }, - { - "Key": "graphql.operation.name", - "Value": "GetA" - } - ], - "event": [ - { - "Name": "AddedOperationToCache", - "Tags": [] - }, - { - "Name": "AddedDocumentToCache", - "Tags": [] - } - ], - "activities": [ - { - "OperationName": "ParseDocument", - "DisplayName": "Parse Document", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "cee0e2939ece72d650cb0331f4be4669" - }, - { - "Key": "graphql.document.hash", - "Value": "cee0e2939ece72d650cb0331f4be4669" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "CompileOperation", - "DisplayName": "Compile Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteOperation", - "DisplayName": "Execute Operation GetA", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/a", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "a" - }, - { - "Key": "graphql.selection.type", - "Value": "String!" - }, - { - "Key": "graphql.selection.path", - "Value": "/a" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/a" - }, - { - "Key": "graphql.selection.field.name", - "Value": "sayHello" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "SimpleQuery.sayHello" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "SimpleQuery" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - } - ] - } - ] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_3_field.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_3_field.snap index 9a7a2773cdf..7757a4c380a 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_3_field.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_3_field.snap @@ -21,11 +21,11 @@ "event": [ { "Name": "AddedOperationToCache", - "Tags": {} + "Tags": [] }, { "Name": "AddedDocumentToCache", - "Tags": {} + "Tags": [] } ], "activities": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_3_field__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_3_field__NET7.snap deleted file mode 100644 index 7757a4c380a..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_3_field__NET7.snap +++ /dev/null @@ -1,213 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteRequest", - "DisplayName": "query { a b c }", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "2e55fbe10a9e3ddf26935a8f8d15ec89" - }, - { - "Key": "graphql.document.hash", - "Value": "2e55fbe10a9e3ddf26935a8f8d15ec89" - }, - { - "Key": "graphql.operation.id", - "Value": "_Default-1-0-2e55fbe10a9e3ddf26935a8f8d15ec89" - } - ], - "event": [ - { - "Name": "AddedOperationToCache", - "Tags": [] - }, - { - "Name": "AddedDocumentToCache", - "Tags": [] - } - ], - "activities": [ - { - "OperationName": "ParseDocument", - "DisplayName": "Parse Document", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "2e55fbe10a9e3ddf26935a8f8d15ec89" - }, - { - "Key": "graphql.document.hash", - "Value": "2e55fbe10a9e3ddf26935a8f8d15ec89" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "CompileOperation", - "DisplayName": "Compile Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteOperation", - "DisplayName": "Execute Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/a", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "a" - }, - { - "Key": "graphql.selection.type", - "Value": "String!" - }, - { - "Key": "graphql.selection.path", - "Value": "/a" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/a" - }, - { - "Key": "graphql.selection.field.name", - "Value": "sayHello" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "SimpleQuery.sayHello" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "SimpleQuery" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/b", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "b" - }, - { - "Key": "graphql.selection.type", - "Value": "String!" - }, - { - "Key": "graphql.selection.path", - "Value": "/b" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/b" - }, - { - "Key": "graphql.selection.field.name", - "Value": "sayHello" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "SimpleQuery.sayHello" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "SimpleQuery" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/c", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "c" - }, - { - "Key": "graphql.selection.type", - "Value": "String!" - }, - { - "Key": "graphql.selection.path", - "Value": "/c" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/c" - }, - { - "Key": "graphql.selection.field.name", - "Value": "sayHello" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "SimpleQuery.sayHello" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "SimpleQuery" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - } - ] - } - ] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_4_field.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_4_field.snap index ea996f48414..3c6df296c31 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_4_field.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_4_field.snap @@ -21,11 +21,11 @@ "event": [ { "Name": "AddedOperationToCache", - "Tags": {} + "Tags": [] }, { "Name": "AddedDocumentToCache", - "Tags": {} + "Tags": [] } ], "activities": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_4_field__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_4_field__NET7.snap deleted file mode 100644 index 3c6df296c31..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_4_field__NET7.snap +++ /dev/null @@ -1,253 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteRequest", - "DisplayName": "query { a b c ... }", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "a5f924bb2f5f8651014e92e1cc2428c7" - }, - { - "Key": "graphql.document.hash", - "Value": "a5f924bb2f5f8651014e92e1cc2428c7" - }, - { - "Key": "graphql.operation.id", - "Value": "_Default-1-0-a5f924bb2f5f8651014e92e1cc2428c7" - } - ], - "event": [ - { - "Name": "AddedOperationToCache", - "Tags": [] - }, - { - "Name": "AddedDocumentToCache", - "Tags": [] - } - ], - "activities": [ - { - "OperationName": "ParseDocument", - "DisplayName": "Parse Document", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "a5f924bb2f5f8651014e92e1cc2428c7" - }, - { - "Key": "graphql.document.hash", - "Value": "a5f924bb2f5f8651014e92e1cc2428c7" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "CompileOperation", - "DisplayName": "Compile Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteOperation", - "DisplayName": "Execute Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/a", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "a" - }, - { - "Key": "graphql.selection.type", - "Value": "String!" - }, - { - "Key": "graphql.selection.path", - "Value": "/a" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/a" - }, - { - "Key": "graphql.selection.field.name", - "Value": "sayHello" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "SimpleQuery.sayHello" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "SimpleQuery" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/b", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "b" - }, - { - "Key": "graphql.selection.type", - "Value": "String!" - }, - { - "Key": "graphql.selection.path", - "Value": "/b" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/b" - }, - { - "Key": "graphql.selection.field.name", - "Value": "sayHello" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "SimpleQuery.sayHello" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "SimpleQuery" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/c", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "c" - }, - { - "Key": "graphql.selection.type", - "Value": "String!" - }, - { - "Key": "graphql.selection.path", - "Value": "/c" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/c" - }, - { - "Key": "graphql.selection.field.name", - "Value": "sayHello" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "SimpleQuery.sayHello" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "SimpleQuery" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/d", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "d" - }, - { - "Key": "graphql.selection.type", - "Value": "String!" - }, - { - "Key": "graphql.selection.path", - "Value": "/d" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/d" - }, - { - "Key": "graphql.selection.field.name", - "Value": "sayHello" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "SimpleQuery.sayHello" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "SimpleQuery" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - } - ] - } - ] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_operation_name_is_used_as_request_name.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_operation_name_is_used_as_request_name.snap index 124fd51ff50..0f4466abbf6 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_operation_name_is_used_as_request_name.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_operation_name_is_used_as_request_name.snap @@ -25,11 +25,11 @@ "event": [ { "Name": "AddedOperationToCache", - "Tags": {} + "Tags": [] }, { "Name": "AddedDocumentToCache", - "Tags": {} + "Tags": [] } ], "activities": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_operation_name_is_used_as_request_name__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_operation_name_is_used_as_request_name__NET7.snap deleted file mode 100644 index 0f4466abbf6..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_operation_name_is_used_as_request_name__NET7.snap +++ /dev/null @@ -1,137 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteRequest", - "DisplayName": "query SayHelloOperation { sayHello }", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "6af18618ae20c266f6ffc352b78cb69b" - }, - { - "Key": "graphql.document.hash", - "Value": "6af18618ae20c266f6ffc352b78cb69b" - }, - { - "Key": "graphql.operation.id", - "Value": "_Default-1-0-6af18618ae20c266f6ffc352b78cb69b" - }, - { - "Key": "graphql.operation.name", - "Value": "SayHelloOperation" - } - ], - "event": [ - { - "Name": "AddedOperationToCache", - "Tags": [] - }, - { - "Name": "AddedDocumentToCache", - "Tags": [] - } - ], - "activities": [ - { - "OperationName": "ParseDocument", - "DisplayName": "Parse Document", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "6af18618ae20c266f6ffc352b78cb69b" - }, - { - "Key": "graphql.document.hash", - "Value": "6af18618ae20c266f6ffc352b78cb69b" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "CompileOperation", - "DisplayName": "Compile Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteOperation", - "DisplayName": "Execute Operation SayHelloOperation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/sayHello", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "sayHello" - }, - { - "Key": "graphql.selection.type", - "Value": "String!" - }, - { - "Key": "graphql.selection.path", - "Value": "/sayHello" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/sayHello" - }, - { - "Key": "graphql.selection.field.name", - "Value": "sayHello" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "SimpleQuery.sayHello" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "SimpleQuery" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - } - ] - } - ] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_that_the_validation_activity_has_an_error_status.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_that_the_validation_activity_has_an_error_status.snap index 58598c42d1a..c13dbaa8b92 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_that_the_validation_activity_has_an_error_status.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_that_the_validation_activity_has_an_error_status.snap @@ -57,12 +57,24 @@ "event": [ { "Name": "exception", - "Tags": { - "exception.message": "The field `sayHello_` does not exist on the type `SimpleQuery`.", - "exception.type": "GRAPHQL_ERROR", - "graphql.error.location.column": 27, - "graphql.error.location.line": 1 - } + "Tags": [ + { + "Key": "exception.message", + "Value": "The field `sayHello_` does not exist on the type `SimpleQuery`." + }, + { + "Key": "exception.type", + "Value": "GRAPHQL_ERROR" + }, + { + "Key": "graphql.error.location.column", + "Value": 27 + }, + { + "Key": "graphql.error.location.line", + "Value": 1 + } + ] } ] } diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_that_the_validation_activity_has_an_error_status__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_that_the_validation_activity_has_an_error_status__NET7.snap deleted file mode 100644 index c13dbaa8b92..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_that_the_validation_activity_has_an_error_status__NET7.snap +++ /dev/null @@ -1,84 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteRequest", - "DisplayName": "Execute Request", - "Status": "Error", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "bb1d246465341a97bdc727d6cd8ead5c" - }, - { - "Key": "graphql.document.hash", - "Value": "bb1d246465341a97bdc727d6cd8ead5c" - }, - { - "Key": "graphql.document.body", - "Value": "query SayHelloOperation {\n sayHello_\n}" - }, - { - "Key": "otel.status_code", - "Value": "ERROR" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ParseDocument", - "DisplayName": "Parse Document", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Error", - "tags": [ - { - "Key": "otel.status_code", - "Value": "ERROR" - }, - { - "Key": "graphql.document.id", - "Value": "bb1d246465341a97bdc727d6cd8ead5c" - }, - { - "Key": "graphql.document.hash", - "Value": "bb1d246465341a97bdc727d6cd8ead5c" - } - ], - "event": [ - { - "Name": "exception", - "Tags": [ - { - "Key": "exception.message", - "Value": "The field `sayHello_` does not exist on the type `SimpleQuery`." - }, - { - "Key": "exception.type", - "Value": "GRAPHQL_ERROR" - }, - { - "Key": "graphql.error.location.column", - "Value": 27 - }, - { - "Key": "graphql.error.location.line", - "Value": 1 - } - ] - } - ] - } - ] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_data_loader_events__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_data_loader_events__NET7.snap deleted file mode 100644 index 63621e43fdd..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_data_loader_events__NET7.snap +++ /dev/null @@ -1,83 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "9b20745108c8de5afccc35cd56ead9fc" - }, - { - "Key": "graphql.document.hash", - "Value": "9b20745108c8de5afccc35cd56ead9fc" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "CompileOperation", - "DisplayName": "Compile Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/dataLoader", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "dataLoader" - }, - { - "Key": "graphql.selection.type", - "Value": "String" - }, - { - "Key": "graphql.selection.path", - "Value": "/dataLoader" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/dataLoader" - }, - { - "Key": "graphql.selection.field.name", - "Value": "dataLoader" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "SimpleQuery.dataLoader" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "SimpleQuery" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteBatch", - "DisplayName": "Execute CustomDataLoader Batch", - "Status": "Unset", - "tags": [], - "event": [] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_data_loader_events_with_keys__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_data_loader_events_with_keys__NET7.snap deleted file mode 100644 index 63621e43fdd..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_data_loader_events_with_keys__NET7.snap +++ /dev/null @@ -1,83 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "9b20745108c8de5afccc35cd56ead9fc" - }, - { - "Key": "graphql.document.hash", - "Value": "9b20745108c8de5afccc35cd56ead9fc" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "CompileOperation", - "DisplayName": "Compile Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/dataLoader", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "dataLoader" - }, - { - "Key": "graphql.selection.type", - "Value": "String" - }, - { - "Key": "graphql.selection.path", - "Value": "/dataLoader" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/dataLoader" - }, - { - "Key": "graphql.selection.field.name", - "Value": "dataLoader" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "SimpleQuery.dataLoader" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "SimpleQuery" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteBatch", - "DisplayName": "Execute CustomDataLoader Batch", - "Status": "Unset", - "tags": [], - "event": [] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_events_of_a_simple_query_default__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_events_of_a_simple_query_default__NET7.snap deleted file mode 100644 index 31c920d0d93..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_events_of_a_simple_query_default__NET7.snap +++ /dev/null @@ -1,76 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "f7e9989fbb67af7fa747a9983313c9e5" - }, - { - "Key": "graphql.document.hash", - "Value": "f7e9989fbb67af7fa747a9983313c9e5" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "CompileOperation", - "DisplayName": "Compile Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/sayHello", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "sayHello" - }, - { - "Key": "graphql.selection.type", - "Value": "String!" - }, - { - "Key": "graphql.selection.path", - "Value": "/sayHello" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/sayHello" - }, - { - "Key": "graphql.selection.field.name", - "Value": "sayHello" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "SimpleQuery.sayHello" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "SimpleQuery" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_events_of_a_simple_query_detailed.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_events_of_a_simple_query_detailed.snap index c862ca3357b..0ae1c8b55a4 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_events_of_a_simple_query_detailed.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_events_of_a_simple_query_detailed.snap @@ -21,11 +21,11 @@ "event": [ { "Name": "AddedOperationToCache", - "Tags": {} + "Tags": [] }, { "Name": "AddedDocumentToCache", - "Tags": {} + "Tags": [] } ], "activities": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_events_of_a_simple_query_detailed__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_events_of_a_simple_query_detailed__NET7.snap deleted file mode 100644 index 0ae1c8b55a4..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_events_of_a_simple_query_detailed__NET7.snap +++ /dev/null @@ -1,133 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteRequest", - "DisplayName": "query { sayHello }", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "f7e9989fbb67af7fa747a9983313c9e5" - }, - { - "Key": "graphql.document.hash", - "Value": "f7e9989fbb67af7fa747a9983313c9e5" - }, - { - "Key": "graphql.operation.id", - "Value": "_Default-1-0-f7e9989fbb67af7fa747a9983313c9e5" - } - ], - "event": [ - { - "Name": "AddedOperationToCache", - "Tags": [] - }, - { - "Name": "AddedDocumentToCache", - "Tags": [] - } - ], - "activities": [ - { - "OperationName": "ParseDocument", - "DisplayName": "Parse Document", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "f7e9989fbb67af7fa747a9983313c9e5" - }, - { - "Key": "graphql.document.hash", - "Value": "f7e9989fbb67af7fa747a9983313c9e5" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "CompileOperation", - "DisplayName": "Compile Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteOperation", - "DisplayName": "Execute Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/sayHello", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "sayHello" - }, - { - "Key": "graphql.selection.type", - "Value": "String!" - }, - { - "Key": "graphql.selection.path", - "Value": "/sayHello" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/sayHello" - }, - { - "Key": "graphql.selection.field.name", - "Value": "sayHello" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "SimpleQuery.sayHello" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "SimpleQuery" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - } - ] - } - ] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Get_SDL_download__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Get_SDL_download__NET7.snap deleted file mode 100644 index 928bc599863..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Get_SDL_download__NET7.snap +++ /dev/null @@ -1,16 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteHttpRequest", - "DisplayName": "GraphQL HTTP GET SDL", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.schema.name", - "Value": "_Default" - } - ], - "event": [] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Get_SingleRequest_GetHeroName.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Get_SingleRequest_GetHeroName.snap index a2345a02084..c8e9c687563 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Get_SingleRequest_GetHeroName.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Get_SingleRequest_GetHeroName.snap @@ -49,11 +49,11 @@ "event": [ { "Name": "AddedOperationToCache", - "Tags": {} + "Tags": [] }, { "Name": "AddedDocumentToCache", - "Tags": {} + "Tags": [] } ], "activities": [ @@ -73,6 +73,18 @@ ], "event": [] }, + { + "OperationName": "AnalyzeOperationCost", + "DisplayName": "Analyze Operation Complexity", + "Status": "Unset", + "tags": [ + { + "Key": "graphql.operation.id", + "Value": "530cb46cabc38757c74c05cc7a96b636" + } + ], + "event": [] + }, { "OperationName": "CompileOperation", "DisplayName": "Compile Operation", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Get_SingleRequest_GetHeroName__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Get_SingleRequest_GetHeroName__NET7.snap deleted file mode 100644 index c8e9c687563..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Get_SingleRequest_GetHeroName__NET7.snap +++ /dev/null @@ -1,166 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteHttpRequest", - "DisplayName": "GraphQL HTTP GET", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.schema.name", - "Value": "_Default" - }, - { - "Key": "graphql.http.request.type", - "Value": "single" - }, - { - "Key": "graphql.http.request.query.hash", - "Value": "530cb46cabc38757c74c05cc7a96b636" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ParseHttpRequest", - "DisplayName": "Parse HTTP Request", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteRequest", - "DisplayName": "query { hero }", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "530cb46cabc38757c74c05cc7a96b636" - }, - { - "Key": "graphql.operation.id", - "Value": "_Default-1-0-530cb46cabc38757c74c05cc7a96b636" - } - ], - "event": [ - { - "Name": "AddedOperationToCache", - "Tags": [] - }, - { - "Name": "AddedDocumentToCache", - "Tags": [] - } - ], - "activities": [ - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "530cb46cabc38757c74c05cc7a96b636" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "AnalyzeOperationCost", - "DisplayName": "Analyze Operation Complexity", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.operation.id", - "Value": "530cb46cabc38757c74c05cc7a96b636" - } - ], - "event": [] - }, - { - "OperationName": "CompileOperation", - "DisplayName": "Compile Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteOperation", - "DisplayName": "Execute Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/hero", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "hero" - }, - { - "Key": "graphql.selection.type", - "Value": "Character" - }, - { - "Key": "graphql.selection.path", - "Value": "/hero" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/hero" - }, - { - "Key": "graphql.selection.field.name", - "Value": "hero" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "Query.hero" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "Query" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - } - ] - } - ] - }, - { - "OperationName": "FormatHttpResponse", - "DisplayName": "Format HTTP Response", - "Status": "Ok", - "tags": [], - "event": [] - } - ] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName.snap index 301ca6909bb..9b2fffd480d 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName.snap @@ -53,11 +53,11 @@ "event": [ { "Name": "AddedOperationToCache", - "Tags": {} + "Tags": [] }, { "Name": "AddedDocumentToCache", - "Tags": {} + "Tags": [] } ], "activities": [ @@ -77,6 +77,18 @@ ], "event": [] }, + { + "OperationName": "AnalyzeOperationCost", + "DisplayName": "Analyze Operation Complexity", + "Status": "Unset", + "tags": [ + { + "Key": "graphql.operation.id", + "Value": "a570a6bff748b5916eadf153261d9c6d" + } + ], + "event": [] + }, { "OperationName": "CompileOperation", "DisplayName": "Compile Operation", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName_Default.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName_Default.snap index ed83fac2875..ac217570db1 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName_Default.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName_Default.snap @@ -33,11 +33,11 @@ "event": [ { "Name": "AddedOperationToCache", - "Tags": {} + "Tags": [] }, { "Name": "AddedDocumentToCache", - "Tags": {} + "Tags": [] } ], "activities": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName_Default__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName_Default__NET7.snap deleted file mode 100644 index ac217570db1..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName_Default__NET7.snap +++ /dev/null @@ -1,134 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteHttpRequest", - "DisplayName": "query { hero }", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.schema.name", - "Value": "_Default" - }, - { - "Key": "graphql.http.request.type", - "Value": "single" - }, - { - "Key": "graphql.http.request.query.id", - "Value": "a570a6bff748b5916eadf153261d9c6d" - }, - { - "Key": "graphql.http.request.query.hash", - "Value": "a570a6bff748b5916eadf153261d9c6d" - }, - { - "Key": "graphql.document.id", - "Value": "a570a6bff748b5916eadf153261d9c6d" - }, - { - "Key": "graphql.operation.id", - "Value": "_Default-1-0-a570a6bff748b5916eadf153261d9c6d" - } - ], - "event": [ - { - "Name": "AddedOperationToCache", - "Tags": [] - }, - { - "Name": "AddedDocumentToCache", - "Tags": [] - } - ], - "activities": [ - { - "OperationName": "ParseHttpRequest", - "DisplayName": "Parse HTTP Request", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "a570a6bff748b5916eadf153261d9c6d" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "CompileOperation", - "DisplayName": "Compile Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/hero", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "hero" - }, - { - "Key": "graphql.selection.type", - "Value": "Character" - }, - { - "Key": "graphql.selection.path", - "Value": "/hero" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/hero" - }, - { - "Key": "graphql.selection.field.name", - "Value": "hero" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "Query.hero" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "Query" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "FormatHttpResponse", - "DisplayName": "Format HTTP Response", - "Status": "Ok", - "tags": [], - "event": [] - } - ] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName__NET7.snap deleted file mode 100644 index 9b2fffd480d..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName__NET7.snap +++ /dev/null @@ -1,170 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteHttpRequest", - "DisplayName": "GraphQL HTTP POST", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.schema.name", - "Value": "_Default" - }, - { - "Key": "graphql.http.request.type", - "Value": "single" - }, - { - "Key": "graphql.http.request.query.id", - "Value": "a570a6bff748b5916eadf153261d9c6d" - }, - { - "Key": "graphql.http.request.query.hash", - "Value": "a570a6bff748b5916eadf153261d9c6d" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ParseHttpRequest", - "DisplayName": "Parse HTTP Request", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteRequest", - "DisplayName": "query { hero }", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "a570a6bff748b5916eadf153261d9c6d" - }, - { - "Key": "graphql.operation.id", - "Value": "_Default-1-0-a570a6bff748b5916eadf153261d9c6d" - } - ], - "event": [ - { - "Name": "AddedOperationToCache", - "Tags": [] - }, - { - "Name": "AddedDocumentToCache", - "Tags": [] - } - ], - "activities": [ - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "a570a6bff748b5916eadf153261d9c6d" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "AnalyzeOperationCost", - "DisplayName": "Analyze Operation Complexity", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.operation.id", - "Value": "a570a6bff748b5916eadf153261d9c6d" - } - ], - "event": [] - }, - { - "OperationName": "CompileOperation", - "DisplayName": "Compile Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteOperation", - "DisplayName": "Execute Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/hero", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "hero" - }, - { - "Key": "graphql.selection.type", - "Value": "Character" - }, - { - "Key": "graphql.selection.path", - "Value": "/hero" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/hero" - }, - { - "Key": "graphql.selection.field.name", - "Value": "hero" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "Query.hero" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "Query" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - } - ] - } - ] - }, - { - "OperationName": "FormatHttpResponse", - "DisplayName": "Format HTTP Response", - "Status": "Ok", - "tags": [], - "event": [] - } - ] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_query_to_http_activity.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_query_to_http_activity.snap index a646f9f50cd..b8fa982566d 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_query_to_http_activity.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_query_to_http_activity.snap @@ -57,11 +57,11 @@ "event": [ { "Name": "AddedOperationToCache", - "Tags": {} + "Tags": [] }, { "Name": "AddedDocumentToCache", - "Tags": {} + "Tags": [] } ], "activities": [ @@ -81,6 +81,18 @@ ], "event": [] }, + { + "OperationName": "AnalyzeOperationCost", + "DisplayName": "Analyze Operation Complexity", + "Status": "Unset", + "tags": [ + { + "Key": "graphql.operation.id", + "Value": "1d4bca4d0dff630390ddf48e9085589d" + } + ], + "event": [] + }, { "OperationName": "CompileOperation", "DisplayName": "Compile Operation", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_query_to_http_activity__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_query_to_http_activity__NET7.snap deleted file mode 100644 index b8fa982566d..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_query_to_http_activity__NET7.snap +++ /dev/null @@ -1,186 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteHttpRequest", - "DisplayName": "GraphQL HTTP POST", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.schema.name", - "Value": "_Default" - }, - { - "Key": "graphql.http.request.type", - "Value": "single" - }, - { - "Key": "graphql.http.request.query.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" - }, - { - "Key": "graphql.http.request.query.hash", - "Value": "1d4bca4d0dff630390ddf48e9085589d" - }, - { - "Key": "graphql.http.request.variables", - "Value": "{ episode: \"NEW_HOPE\" }" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ParseHttpRequest", - "DisplayName": "Parse HTTP Request", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteRequest", - "DisplayName": "query { hero }", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" - }, - { - "Key": "graphql.operation.id", - "Value": "_Default-1-0-1d4bca4d0dff630390ddf48e9085589d" - } - ], - "event": [ - { - "Name": "AddedOperationToCache", - "Tags": [] - }, - { - "Name": "AddedDocumentToCache", - "Tags": [] - } - ], - "activities": [ - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "AnalyzeOperationCost", - "DisplayName": "Analyze Operation Complexity", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.operation.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" - } - ], - "event": [] - }, - { - "OperationName": "CompileOperation", - "DisplayName": "Compile Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "CoerceVariables", - "DisplayName": "Coerce Variable", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteOperation", - "DisplayName": "Execute Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/hero", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "hero" - }, - { - "Key": "graphql.selection.type", - "Value": "Character" - }, - { - "Key": "graphql.selection.path", - "Value": "/hero" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/hero" - }, - { - "Key": "graphql.selection.field.name", - "Value": "hero" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "Query.hero" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "Query" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - } - ] - } - ] - }, - { - "OperationName": "FormatHttpResponse", - "DisplayName": "Format HTTP Response", - "Status": "Ok", - "tags": [], - "event": [] - } - ] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_variables_to_http_activity.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_variables_to_http_activity.snap index a646f9f50cd..b8fa982566d 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_variables_to_http_activity.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_variables_to_http_activity.snap @@ -57,11 +57,11 @@ "event": [ { "Name": "AddedOperationToCache", - "Tags": {} + "Tags": [] }, { "Name": "AddedDocumentToCache", - "Tags": {} + "Tags": [] } ], "activities": [ @@ -81,6 +81,18 @@ ], "event": [] }, + { + "OperationName": "AnalyzeOperationCost", + "DisplayName": "Analyze Operation Complexity", + "Status": "Unset", + "tags": [ + { + "Key": "graphql.operation.id", + "Value": "1d4bca4d0dff630390ddf48e9085589d" + } + ], + "event": [] + }, { "OperationName": "CompileOperation", "DisplayName": "Compile Operation", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_variables_to_http_activity__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_variables_to_http_activity__NET7.snap deleted file mode 100644 index b8fa982566d..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_variables_to_http_activity__NET7.snap +++ /dev/null @@ -1,186 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteHttpRequest", - "DisplayName": "GraphQL HTTP POST", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.schema.name", - "Value": "_Default" - }, - { - "Key": "graphql.http.request.type", - "Value": "single" - }, - { - "Key": "graphql.http.request.query.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" - }, - { - "Key": "graphql.http.request.query.hash", - "Value": "1d4bca4d0dff630390ddf48e9085589d" - }, - { - "Key": "graphql.http.request.variables", - "Value": "{ episode: \"NEW_HOPE\" }" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ParseHttpRequest", - "DisplayName": "Parse HTTP Request", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteRequest", - "DisplayName": "query { hero }", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" - }, - { - "Key": "graphql.operation.id", - "Value": "_Default-1-0-1d4bca4d0dff630390ddf48e9085589d" - } - ], - "event": [ - { - "Name": "AddedOperationToCache", - "Tags": [] - }, - { - "Name": "AddedDocumentToCache", - "Tags": [] - } - ], - "activities": [ - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "AnalyzeOperationCost", - "DisplayName": "Analyze Operation Complexity", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.operation.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" - } - ], - "event": [] - }, - { - "OperationName": "CompileOperation", - "DisplayName": "Compile Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "CoerceVariables", - "DisplayName": "Coerce Variable", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteOperation", - "DisplayName": "Execute Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/hero", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "hero" - }, - { - "Key": "graphql.selection.type", - "Value": "Character" - }, - { - "Key": "graphql.selection.path", - "Value": "/hero" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/hero" - }, - { - "Key": "graphql.selection.field.name", - "Value": "hero" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "Query.hero" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "Query" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - } - ] - } - ] - }, - { - "OperationName": "FormatHttpResponse", - "DisplayName": "Format HTTP Response", - "Status": "Ok", - "tags": [], - "event": [] - } - ] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_capture_deferred_response.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_capture_deferred_response.snap index bde150aaeec..132c3007a57 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_capture_deferred_response.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_capture_deferred_response.snap @@ -53,11 +53,11 @@ "event": [ { "Name": "AddedOperationToCache", - "Tags": {} + "Tags": [] }, { "Name": "AddedDocumentToCache", - "Tags": {} + "Tags": [] } ], "activities": [ @@ -77,6 +77,18 @@ ], "event": [] }, + { + "OperationName": "AnalyzeOperationCost", + "DisplayName": "Analyze Operation Complexity", + "Status": "Unset", + "tags": [ + { + "Key": "graphql.operation.id", + "Value": "c563b5e7a3e68a1f25847ac7ab07017c" + } + ], + "event": [] + }, { "OperationName": "CompileOperation", "DisplayName": "Compile Operation", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_capture_deferred_response__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_capture_deferred_response__NET7.snap deleted file mode 100644 index 132c3007a57..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_capture_deferred_response__NET7.snap +++ /dev/null @@ -1,212 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteHttpRequest", - "DisplayName": "GraphQL HTTP POST", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.schema.name", - "Value": "_Default" - }, - { - "Key": "graphql.http.request.type", - "Value": "single" - }, - { - "Key": "graphql.http.request.query.id", - "Value": "c563b5e7a3e68a1f25847ac7ab07017c" - }, - { - "Key": "graphql.http.request.query.hash", - "Value": "c563b5e7a3e68a1f25847ac7ab07017c" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ParseHttpRequest", - "DisplayName": "Parse HTTP Request", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteRequest", - "DisplayName": "query { hero }", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "c563b5e7a3e68a1f25847ac7ab07017c" - }, - { - "Key": "graphql.operation.id", - "Value": "_Default-1-0-c563b5e7a3e68a1f25847ac7ab07017c" - } - ], - "event": [ - { - "Name": "AddedOperationToCache", - "Tags": [] - }, - { - "Name": "AddedDocumentToCache", - "Tags": [] - } - ], - "activities": [ - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "c563b5e7a3e68a1f25847ac7ab07017c" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "AnalyzeOperationCost", - "DisplayName": "Analyze Operation Complexity", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.operation.id", - "Value": "c563b5e7a3e68a1f25847ac7ab07017c" - } - ], - "event": [] - }, - { - "OperationName": "CompileOperation", - "DisplayName": "Compile Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteOperation", - "DisplayName": "Execute Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/hero", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "hero" - }, - { - "Key": "graphql.selection.type", - "Value": "Character" - }, - { - "Key": "graphql.selection.path", - "Value": "/hero" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/hero" - }, - { - "Key": "graphql.selection.field.name", - "Value": "hero" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "Query.hero" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "Query" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/hero/id", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "id" - }, - { - "Key": "graphql.selection.type", - "Value": "ID!" - }, - { - "Key": "graphql.selection.path", - "Value": "/hero/id" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/hero/id" - }, - { - "Key": "graphql.selection.field.name", - "Value": "id" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "Droid.id" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "Droid" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - } - ] - } - ] - } - ] - }, - { - "OperationName": "ExecuteStream", - "DisplayName": "ExecuteStream", - "Status": "Unset", - "tags": [], - "event": [] - } - ] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_ensure_list_path_is_correctly_built.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_ensure_list_path_is_correctly_built.snap index 17ae2436335..fd136331c7b 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_ensure_list_path_is_correctly_built.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_ensure_list_path_is_correctly_built.snap @@ -53,11 +53,11 @@ "event": [ { "Name": "AddedOperationToCache", - "Tags": {} + "Tags": [] }, { "Name": "AddedDocumentToCache", - "Tags": {} + "Tags": [] } ], "activities": [ @@ -77,6 +77,18 @@ ], "event": [] }, + { + "OperationName": "AnalyzeOperationCost", + "DisplayName": "Analyze Operation Complexity", + "Status": "Unset", + "tags": [ + { + "Key": "graphql.operation.id", + "Value": "c0513b4b6f0cf7430f64de4aa3dcd7c6" + } + ], + "event": [] + }, { "OperationName": "CompileOperation", "DisplayName": "Compile Operation", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_ensure_list_path_is_correctly_built__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_ensure_list_path_is_correctly_built__NET7.snap deleted file mode 100644 index fd136331c7b..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_ensure_list_path_is_correctly_built__NET7.snap +++ /dev/null @@ -1,330 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteHttpRequest", - "DisplayName": "GraphQL HTTP POST", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.schema.name", - "Value": "_Default" - }, - { - "Key": "graphql.http.request.type", - "Value": "single" - }, - { - "Key": "graphql.http.request.query.id", - "Value": "c0513b4b6f0cf7430f64de4aa3dcd7c6" - }, - { - "Key": "graphql.http.request.query.hash", - "Value": "c0513b4b6f0cf7430f64de4aa3dcd7c6" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ParseHttpRequest", - "DisplayName": "Parse HTTP Request", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteRequest", - "DisplayName": "query { hero }", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "c0513b4b6f0cf7430f64de4aa3dcd7c6" - }, - { - "Key": "graphql.operation.id", - "Value": "_Default-1-0-c0513b4b6f0cf7430f64de4aa3dcd7c6" - } - ], - "event": [ - { - "Name": "AddedOperationToCache", - "Tags": [] - }, - { - "Name": "AddedDocumentToCache", - "Tags": [] - } - ], - "activities": [ - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "c0513b4b6f0cf7430f64de4aa3dcd7c6" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "AnalyzeOperationCost", - "DisplayName": "Analyze Operation Complexity", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.operation.id", - "Value": "c0513b4b6f0cf7430f64de4aa3dcd7c6" - } - ], - "event": [] - }, - { - "OperationName": "CompileOperation", - "DisplayName": "Compile Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteOperation", - "DisplayName": "Execute Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/hero", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "hero" - }, - { - "Key": "graphql.selection.type", - "Value": "Character" - }, - { - "Key": "graphql.selection.path", - "Value": "/hero" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/hero" - }, - { - "Key": "graphql.selection.field.name", - "Value": "hero" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "Query.hero" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "Query" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/hero/friends", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "friends" - }, - { - "Key": "graphql.selection.type", - "Value": "FriendsConnection" - }, - { - "Key": "graphql.selection.path", - "Value": "/hero/friends" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/hero/friends" - }, - { - "Key": "graphql.selection.field.name", - "Value": "friends" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "Droid.friends" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "Droid" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/hero/friends/nodes[2]/friends", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "friends" - }, - { - "Key": "graphql.selection.type", - "Value": "FriendsConnection" - }, - { - "Key": "graphql.selection.path", - "Value": "/hero/friends/nodes[2]/friends" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/hero/friends/nodes/friends" - }, - { - "Key": "graphql.selection.field.name", - "Value": "friends" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "Human.friends" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "Human" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/hero/friends/nodes[1]/friends", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "friends" - }, - { - "Key": "graphql.selection.type", - "Value": "FriendsConnection" - }, - { - "Key": "graphql.selection.path", - "Value": "/hero/friends/nodes[1]/friends" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/hero/friends/nodes/friends" - }, - { - "Key": "graphql.selection.field.name", - "Value": "friends" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "Human.friends" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "Human" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/hero/friends/nodes[0]/friends", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "friends" - }, - { - "Key": "graphql.selection.type", - "Value": "FriendsConnection" - }, - { - "Key": "graphql.selection.path", - "Value": "/hero/friends/nodes[0]/friends" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/hero/friends/nodes/friends" - }, - { - "Key": "graphql.selection.field.name", - "Value": "friends" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "Human.friends" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "Human" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - } - ] - } - ] - }, - { - "OperationName": "FormatHttpResponse", - "DisplayName": "Format HTTP Response", - "Status": "Ok", - "tags": [], - "event": [] - } - ] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_parser_error.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_parser_error.snap index e1d8c23836e..e33490a9a8c 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_parser_error.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_parser_error.snap @@ -25,12 +25,24 @@ "event": [ { "Name": "exception", - "Tags": { - "exception.message": "Found a NameStart character `n` (110) following a number, which is disallowed.", - "exception.type": "HC0011", - "graphql.error.location.column": 37, - "graphql.error.location.line": 10 - } + "Tags": [ + { + "Key": "exception.message", + "Value": "Found a NameStart character `n` (110) following a number, which is disallowed." + }, + { + "Key": "exception.type", + "Value": "HC0011" + }, + { + "Key": "graphql.error.location.column", + "Value": 37 + }, + { + "Key": "graphql.error.location.line", + "Value": 10 + } + ] } ] }, diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_parser_error__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_parser_error__NET7.snap deleted file mode 100644 index e33490a9a8c..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_parser_error__NET7.snap +++ /dev/null @@ -1,59 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteHttpRequest", - "DisplayName": "GraphQL HTTP POST", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.schema.name", - "Value": "_Default" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ParseHttpRequest", - "DisplayName": "Parse HTTP Request", - "Status": "Error", - "tags": [ - { - "Key": "otel.status_code", - "Value": "ERROR" - } - ], - "event": [ - { - "Name": "exception", - "Tags": [ - { - "Key": "exception.message", - "Value": "Found a NameStart character `n` (110) following a number, which is disallowed." - }, - { - "Key": "exception.type", - "Value": "HC0011" - }, - { - "Key": "graphql.error.location.column", - "Value": 37 - }, - { - "Key": "graphql.error.location.line", - "Value": 10 - } - ] - } - ] - }, - { - "OperationName": "FormatHttpResponse", - "DisplayName": "Format HTTP Response", - "Status": "Ok", - "tags": [], - "event": [] - } - ] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_variables_are_not_automatically_added_to_activities.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_variables_are_not_automatically_added_to_activities.snap index 5748c50e118..0c8d0ce5a75 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_variables_are_not_automatically_added_to_activities.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_variables_are_not_automatically_added_to_activities.snap @@ -53,11 +53,11 @@ "event": [ { "Name": "AddedOperationToCache", - "Tags": {} + "Tags": [] }, { "Name": "AddedDocumentToCache", - "Tags": {} + "Tags": [] } ], "activities": [ @@ -77,6 +77,18 @@ ], "event": [] }, + { + "OperationName": "AnalyzeOperationCost", + "DisplayName": "Analyze Operation Complexity", + "Status": "Unset", + "tags": [ + { + "Key": "graphql.operation.id", + "Value": "1d4bca4d0dff630390ddf48e9085589d" + } + ], + "event": [] + }, { "OperationName": "CompileOperation", "DisplayName": "Compile Operation", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_variables_are_not_automatically_added_to_activities__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_variables_are_not_automatically_added_to_activities__NET7.snap deleted file mode 100644 index 0c8d0ce5a75..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_variables_are_not_automatically_added_to_activities__NET7.snap +++ /dev/null @@ -1,182 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteHttpRequest", - "DisplayName": "GraphQL HTTP POST", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.schema.name", - "Value": "_Default" - }, - { - "Key": "graphql.http.request.type", - "Value": "single" - }, - { - "Key": "graphql.http.request.query.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" - }, - { - "Key": "graphql.http.request.query.hash", - "Value": "1d4bca4d0dff630390ddf48e9085589d" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ParseHttpRequest", - "DisplayName": "Parse HTTP Request", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteRequest", - "DisplayName": "query { hero }", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" - }, - { - "Key": "graphql.operation.id", - "Value": "_Default-1-0-1d4bca4d0dff630390ddf48e9085589d" - } - ], - "event": [ - { - "Name": "AddedOperationToCache", - "Tags": [] - }, - { - "Name": "AddedDocumentToCache", - "Tags": [] - } - ], - "activities": [ - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "AnalyzeOperationCost", - "DisplayName": "Analyze Operation Complexity", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.operation.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" - } - ], - "event": [] - }, - { - "OperationName": "CompileOperation", - "DisplayName": "Compile Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "CoerceVariables", - "DisplayName": "Coerce Variable", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteOperation", - "DisplayName": "Execute Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/hero", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "hero" - }, - { - "Key": "graphql.selection.type", - "Value": "Character" - }, - { - "Key": "graphql.selection.path", - "Value": "/hero" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/hero" - }, - { - "Key": "graphql.selection.field.name", - "Value": "hero" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "Query.hero" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "Query" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - } - ] - } - ] - }, - { - "OperationName": "FormatHttpResponse", - "DisplayName": "Format HTTP Response", - "Status": "Ok", - "tags": [], - "event": [] - } - ] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_with_extensions_map.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_with_extensions_map.snap index 7ddf3485660..b4263bede27 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_with_extensions_map.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_with_extensions_map.snap @@ -57,11 +57,11 @@ "event": [ { "Name": "AddedOperationToCache", - "Tags": {} + "Tags": [] }, { "Name": "AddedDocumentToCache", - "Tags": {} + "Tags": [] } ], "activities": [ @@ -81,6 +81,18 @@ ], "event": [] }, + { + "OperationName": "AnalyzeOperationCost", + "DisplayName": "Analyze Operation Complexity", + "Status": "Unset", + "tags": [ + { + "Key": "graphql.operation.id", + "Value": "1d4bca4d0dff630390ddf48e9085589d" + } + ], + "event": [] + }, { "OperationName": "CompileOperation", "DisplayName": "Compile Operation", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_with_extensions_map__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_with_extensions_map__NET7.snap deleted file mode 100644 index b4263bede27..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_with_extensions_map__NET7.snap +++ /dev/null @@ -1,186 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteHttpRequest", - "DisplayName": "GraphQL HTTP POST", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.schema.name", - "Value": "_Default" - }, - { - "Key": "graphql.http.request.type", - "Value": "single" - }, - { - "Key": "graphql.http.request.query.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" - }, - { - "Key": "graphql.http.request.query.hash", - "Value": "1d4bca4d0dff630390ddf48e9085589d" - }, - { - "Key": "graphql.http.request.extensions", - "Value": "{\"test\":\"abc\"}" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ParseHttpRequest", - "DisplayName": "Parse HTTP Request", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteRequest", - "DisplayName": "query { hero }", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" - }, - { - "Key": "graphql.operation.id", - "Value": "_Default-1-0-1d4bca4d0dff630390ddf48e9085589d" - } - ], - "event": [ - { - "Name": "AddedOperationToCache", - "Tags": [] - }, - { - "Name": "AddedDocumentToCache", - "Tags": [] - } - ], - "activities": [ - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "AnalyzeOperationCost", - "DisplayName": "Analyze Operation Complexity", - "Status": "Unset", - "tags": [ - { - "Key": "graphql.operation.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" - } - ], - "event": [] - }, - { - "OperationName": "CompileOperation", - "DisplayName": "Compile Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "CoerceVariables", - "DisplayName": "Coerce Variable", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteOperation", - "DisplayName": "Execute Operation", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ResolveFieldValue", - "DisplayName": "/hero", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.selection.name", - "Value": "hero" - }, - { - "Key": "graphql.selection.type", - "Value": "Character" - }, - { - "Key": "graphql.selection.path", - "Value": "/hero" - }, - { - "Key": "graphql.selection.hierarchy", - "Value": "/hero" - }, - { - "Key": "graphql.selection.field.name", - "Value": "hero" - }, - { - "Key": "graphql.selection.field.coordinate", - "Value": "Query.hero" - }, - { - "Key": "graphql.selection.field.declaringType", - "Value": "Query" - }, - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - } - ] - } - ] - }, - { - "OperationName": "FormatHttpResponse", - "DisplayName": "Format HTTP Response", - "Status": "Ok", - "tags": [], - "event": [] - } - ] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Parsing_error_when_rename_root_is_activated.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Parsing_error_when_rename_root_is_activated.snap index 988f5cf7dd5..b0834861a59 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Parsing_error_when_rename_root_is_activated.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Parsing_error_when_rename_root_is_activated.snap @@ -25,12 +25,24 @@ "event": [ { "Name": "exception", - "Tags": { - "exception.message": "Expected a `Name`-token, but found a `Integer`-token.", - "exception.type": "HC0011", - "graphql.error.location.column": 21, - "graphql.error.location.line": 3 - } + "Tags": [ + { + "Key": "exception.message", + "Value": "Expected a `Name`-token, but found a `Integer`-token." + }, + { + "Key": "exception.type", + "Value": "HC0011" + }, + { + "Key": "graphql.error.location.column", + "Value": 21 + }, + { + "Key": "graphql.error.location.line", + "Value": 3 + } + ] } ] }, diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Parsing_error_when_rename_root_is_activated__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Parsing_error_when_rename_root_is_activated__NET7.snap deleted file mode 100644 index b0834861a59..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Parsing_error_when_rename_root_is_activated__NET7.snap +++ /dev/null @@ -1,59 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteHttpRequest", - "DisplayName": "GraphQL HTTP POST: Begin Parse HTTP Request", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.schema.name", - "Value": "_Default" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ParseHttpRequest", - "DisplayName": "Parse HTTP Request", - "Status": "Error", - "tags": [ - { - "Key": "otel.status_code", - "Value": "ERROR" - } - ], - "event": [ - { - "Name": "exception", - "Tags": [ - { - "Key": "exception.message", - "Value": "Expected a `Name`-token, but found a `Integer`-token." - }, - { - "Key": "exception.type", - "Value": "HC0011" - }, - { - "Key": "graphql.error.location.column", - "Value": 21 - }, - { - "Key": "graphql.error.location.line", - "Value": 3 - } - ] - } - ] - }, - { - "OperationName": "FormatHttpResponse", - "DisplayName": "Format HTTP Response", - "Status": "Ok", - "tags": [], - "event": [] - } - ] - } - ] -} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Validation_error_when_rename_root_is_activated.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Validation_error_when_rename_root_is_activated.snap index 29c52863bfc..746f536dda4 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Validation_error_when_rename_root_is_activated.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Validation_error_when_rename_root_is_activated.snap @@ -69,12 +69,24 @@ "event": [ { "Name": "exception", - "Tags": { - "exception.message": "The field `abc` does not exist on the type `Query`.", - "exception.type": "GRAPHQL_ERROR", - "graphql.error.location.column": 21, - "graphql.error.location.line": 3 - } + "Tags": [ + { + "Key": "exception.message", + "Value": "The field `abc` does not exist on the type `Query`." + }, + { + "Key": "exception.type", + "Value": "GRAPHQL_ERROR" + }, + { + "Key": "graphql.error.location.column", + "Value": 21 + }, + { + "Key": "graphql.error.location.line", + "Value": 3 + } + ] } ] } diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Validation_error_when_rename_root_is_activated__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Validation_error_when_rename_root_is_activated__NET7.snap deleted file mode 100644 index 746f536dda4..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Validation_error_when_rename_root_is_activated__NET7.snap +++ /dev/null @@ -1,105 +0,0 @@ -{ - "activities": [ - { - "OperationName": "ExecuteHttpRequest", - "DisplayName": "GraphQL HTTP POST: Begin Validate Document", - "Status": "Ok", - "tags": [ - { - "Key": "graphql.schema.name", - "Value": "_Default" - }, - { - "Key": "graphql.http.request.type", - "Value": "single" - }, - { - "Key": "graphql.http.request.query.id", - "Value": "e2b13c5332af8a70da160fcb96894e5c" - }, - { - "Key": "graphql.http.request.query.hash", - "Value": "e2b13c5332af8a70da160fcb96894e5c" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ParseHttpRequest", - "DisplayName": "Parse HTTP Request", - "Status": "Ok", - "tags": [ - { - "Key": "otel.status_code", - "Value": "OK" - } - ], - "event": [] - }, - { - "OperationName": "ExecuteRequest", - "DisplayName": "Execute Request", - "Status": "Error", - "tags": [ - { - "Key": "graphql.document.id", - "Value": "e2b13c5332af8a70da160fcb96894e5c" - }, - { - "Key": "otel.status_code", - "Value": "ERROR" - } - ], - "event": [], - "activities": [ - { - "OperationName": "ValidateDocument", - "DisplayName": "Validate Document", - "Status": "Error", - "tags": [ - { - "Key": "otel.status_code", - "Value": "ERROR" - }, - { - "Key": "graphql.document.id", - "Value": "e2b13c5332af8a70da160fcb96894e5c" - } - ], - "event": [ - { - "Name": "exception", - "Tags": [ - { - "Key": "exception.message", - "Value": "The field `abc` does not exist on the type `Query`." - }, - { - "Key": "exception.type", - "Value": "GRAPHQL_ERROR" - }, - { - "Key": "graphql.error.location.column", - "Value": 21 - }, - { - "Key": "graphql.error.location.line", - "Value": 3 - } - ] - } - ] - } - ] - }, - { - "OperationName": "FormatHttpResponse", - "DisplayName": "Format HTTP Response", - "Status": "Ok", - "tags": [], - "event": [] - } - ] - } - ] -} diff --git a/src/HotChocolate/Fusion/.vscode/settings.json b/src/HotChocolate/Fusion/.vscode/settings.json deleted file mode 100644 index 03525aabff6..00000000000 --- a/src/HotChocolate/Fusion/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "dotnet.defaultSolution": "HotChocolate.Fusion.sln" -} diff --git a/src/HotChocolate/Fusion/.vscode/tasks.json b/src/HotChocolate/Fusion/.vscode/tasks.json deleted file mode 100644 index 31c32bd3457..00000000000 --- a/src/HotChocolate/Fusion/.vscode/tasks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "shell", - "args": [ - "build", - // Ask dotnet build to generate full paths for file names. - "/property:GenerateFullPaths=true", - // Do not generate summary otherwise it leads to duplicate errors in Problems panel - "/consoleloggerparameters:NoSummary" - ], - "group": "build", - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/src/HotChocolate/Fusion/Directory.Build.props b/src/HotChocolate/Fusion/Directory.Build.props index 504e90cb29e..ea6e2bc3aaf 100644 --- a/src/HotChocolate/Fusion/Directory.Build.props +++ b/src/HotChocolate/Fusion/Directory.Build.props @@ -1,8 +1,4 @@ - - net8.0 - - diff --git a/src/HotChocolate/Fusion/src/Aspire/HotChocolate.Fusion.Aspire.csproj b/src/HotChocolate/Fusion/src/Aspire/HotChocolate.Fusion.Aspire.csproj index 42de93e593b..00bf38a4210 100644 --- a/src/HotChocolate/Fusion/src/Aspire/HotChocolate.Fusion.Aspire.csproj +++ b/src/HotChocolate/Fusion/src/Aspire/HotChocolate.Fusion.Aspire.csproj @@ -1,9 +1,6 @@ - net8.0 - net8.0 - HotChocolate.Fusion.Aspire HotChocolate.Fusion diff --git a/src/HotChocolate/Fusion/test/Aspire.Analyzers.Tests/HotChocolate.Fusion.Aspire.Analyzers.Tests.csproj b/src/HotChocolate/Fusion/test/Aspire.Analyzers.Tests/HotChocolate.Fusion.Aspire.Analyzers.Tests.csproj index 57d1d431e9c..d176c3b78a5 100644 --- a/src/HotChocolate/Fusion/test/Aspire.Analyzers.Tests/HotChocolate.Fusion.Aspire.Analyzers.Tests.csproj +++ b/src/HotChocolate/Fusion/test/Aspire.Analyzers.Tests/HotChocolate.Fusion.Aspire.Analyzers.Tests.csproj @@ -1,8 +1,6 @@ - net8.0 - net8.0 true diff --git a/src/HotChocolate/Language/.vscode/launch.json b/src/HotChocolate/Language/.vscode/launch.json deleted file mode 100644 index aaad9e92a70..00000000000 --- a/src/HotChocolate/Language/.vscode/launch.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": ".NET Core Launch (console)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - "program": "${workspaceFolder}/benchmark/Language.Visitors.Benchmarks/bin/Debug/netcoreapp3.1/HotChocolate.Language.Visitors.Benchmarks.dll", - "args": [], - "cwd": "${workspaceFolder}/benchmark/Language.Visitors.Benchmarks", - "console": "internalConsole", - "stopAtEntry": false - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach", - "processId": "${command:pickProcess}" - } - ] -} diff --git a/src/HotChocolate/Language/.vscode/tasks.json b/src/HotChocolate/Language/.vscode/tasks.json deleted file mode 100644 index 31c32bd3457..00000000000 --- a/src/HotChocolate/Language/.vscode/tasks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "shell", - "args": [ - "build", - // Ask dotnet build to generate full paths for file names. - "/property:GenerateFullPaths=true", - // Do not generate summary otherwise it leads to duplicate errors in Problems panel - "/consoleloggerparameters:NoSummary" - ], - "group": "build", - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/src/HotChocolate/Language/src/Directory.Build.props b/src/HotChocolate/Language/src/Directory.Build.props index f727db550e7..34c28acc87b 100644 --- a/src/HotChocolate/Language/src/Directory.Build.props +++ b/src/HotChocolate/Language/src/Directory.Build.props @@ -3,9 +3,10 @@ - $(LibraryTargetFrameworks) - true - true + $(ExtendedTargetFrameworks) + + + true diff --git a/src/HotChocolate/Language/src/Language.SyntaxTree/DirectiveLocation.cs b/src/HotChocolate/Language/src/Language.SyntaxTree/DirectiveLocation.cs index c17a9b23152..c66203ddabd 100644 --- a/src/HotChocolate/Language/src/Language.SyntaxTree/DirectiveLocation.cs +++ b/src/HotChocolate/Language/src/Language.SyntaxTree/DirectiveLocation.cs @@ -109,10 +109,10 @@ public override int GetHashCode() public static bool IsValidName(string value) => _cache.ContainsKey(value); -#if NET6_0_OR_GREATER - public static bool TryParse(string value, [NotNullWhen(true)] out DirectiveLocation? location) -#else +#if NETSTANDARD2_0 public static bool TryParse(string value, out DirectiveLocation? location) +#else + public static bool TryParse(string value, [NotNullWhen(true)] out DirectiveLocation? location) #endif => _cache.TryGetValue(value, out location); diff --git a/src/HotChocolate/Language/src/Language.SyntaxTree/Extensions/HashCodeExtensions.cs b/src/HotChocolate/Language/src/Language.SyntaxTree/Extensions/HashCodeExtensions.cs index 471f073d711..beb2798c9a4 100644 --- a/src/HotChocolate/Language/src/Language.SyntaxTree/Extensions/HashCodeExtensions.cs +++ b/src/HotChocolate/Language/src/Language.SyntaxTree/Extensions/HashCodeExtensions.cs @@ -1,4 +1,4 @@ -#if !NET6_0_OR_GREATER +#if NETSTANDARD2_0 using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -8,7 +8,7 @@ namespace HotChocolate.Language; internal static class HashCodeExtensions { -#if !NET6_0_OR_GREATER +#if NETSTANDARD2_0 public static void AddBytes(ref HashCode hashCode, ReadOnlySpan value) { ref var pos = ref MemoryMarshal.GetReference(value); diff --git a/src/HotChocolate/Language/src/Language.SyntaxTree/HotChocolate.Language.SyntaxTree.csproj b/src/HotChocolate/Language/src/Language.SyntaxTree/HotChocolate.Language.SyntaxTree.csproj index c54042beb14..7bbfe47fd24 100644 --- a/src/HotChocolate/Language/src/Language.SyntaxTree/HotChocolate.Language.SyntaxTree.csproj +++ b/src/HotChocolate/Language/src/Language.SyntaxTree/HotChocolate.Language.SyntaxTree.csproj @@ -20,7 +20,7 @@ - + diff --git a/src/HotChocolate/Language/src/Language.SyntaxTree/SyntaxEqualityComparer.cs b/src/HotChocolate/Language/src/Language.SyntaxTree/SyntaxEqualityComparer.cs index 5c243a4453d..d1285b5580e 100644 --- a/src/HotChocolate/Language/src/Language.SyntaxTree/SyntaxEqualityComparer.cs +++ b/src/HotChocolate/Language/src/Language.SyntaxTree/SyntaxEqualityComparer.cs @@ -749,15 +749,15 @@ private int GetHashCode(FieldNode node) private int GetHashCode(FloatValueNode node) { -#if NET6_0_OR_GREATER +#if NETSTANDARD2_0 var hashCode = new HashCode(); hashCode.Add(node.Kind); - hashCode.AddBytes(node.AsSpan()); + HashCodeExtensions.AddBytes(ref hashCode, node.AsSpan()); return hashCode.ToHashCode(); #else var hashCode = new HashCode(); hashCode.Add(node.Kind); - HashCodeExtensions.AddBytes(ref hashCode, node.AsSpan()); + hashCode.AddBytes(node.AsSpan()); return hashCode.ToHashCode(); #endif } @@ -938,10 +938,10 @@ private int GetHashCode(IntValueNode node) { var hashCode = new HashCode(); hashCode.Add(node.Kind); -#if NET6_0_OR_GREATER - hashCode.AddBytes(node.AsSpan()); -#else +#if NETSTANDARD2_0 HashCodeExtensions.AddBytes(ref hashCode, node.AsSpan()); +#else + hashCode.AddBytes(node.AsSpan()); #endif return hashCode.ToHashCode(); } @@ -1203,10 +1203,10 @@ private int GetHashCode(StringValueNode? node) var hashCode = new HashCode(); hashCode.Add(node.Kind); -#if NET6_0_OR_GREATER - hashCode.AddBytes(node.AsSpan()); -#else +#if NETSTANDARD2_0 HashCodeExtensions.AddBytes(ref hashCode, node.AsSpan()); +#else + hashCode.AddBytes(node.AsSpan()); #endif return hashCode.ToHashCode(); } diff --git a/src/HotChocolate/Language/src/Language.SyntaxTree/Utilities/SyntaxPrinter.cs b/src/HotChocolate/Language/src/Language.SyntaxTree/Utilities/SyntaxPrinter.cs index 9b2ef22bbce..19db6ceab95 100644 --- a/src/HotChocolate/Language/src/Language.SyntaxTree/Utilities/SyntaxPrinter.cs +++ b/src/HotChocolate/Language/src/Language.SyntaxTree/Utilities/SyntaxPrinter.cs @@ -80,10 +80,10 @@ public static async ValueTask PrintToAsync( _serializerNoIndent.Serialize(node, syntaxWriter); } -#if NETSTANDARD2_0 || NETSTANDARD2_1 - await streamWriter - .WriteAsync(syntaxWriter.ToString()) - .ConfigureAwait(false); +#if NETSTANDARD2_0 + await streamWriter + .WriteAsync(syntaxWriter.ToString()) + .ConfigureAwait(false); #else await streamWriter .WriteAsync(syntaxWriter.StringBuilder, cancellationToken) diff --git a/src/HotChocolate/Language/src/Language.Utf8/Utf8GraphQLParser.Syntax.cs b/src/HotChocolate/Language/src/Language.Utf8/Utf8GraphQLParser.Syntax.cs index 56c20e3a4a6..6214d941f21 100644 --- a/src/HotChocolate/Language/src/Language.Utf8/Utf8GraphQLParser.Syntax.cs +++ b/src/HotChocolate/Language/src/Language.Utf8/Utf8GraphQLParser.Syntax.cs @@ -12,10 +12,10 @@ public static class Syntax /// Parses a GraphQL object type definitions e.g. type Foo { bar: String } /// public static ObjectTypeDefinitionNode ParseObjectTypeDefinition( - #if NET7_0_OR_GREATER - [StringSyntax("graphql")] string sourceText) => - #else + #if NETSTANDARD2_0 string sourceText) => + #else + [StringSyntax("graphql")] string sourceText) => #endif Parse(sourceText, parser => parser.ParseObjectTypeDefinition()); @@ -37,10 +37,10 @@ public static ObjectTypeDefinitionNode ParseObjectTypeDefinition( /// Parses a GraphQL object type definitions e.g. type Foo { bar: String } /// public static DirectiveDefinitionNode ParseDirectiveDefinition( -#if NET7_0_OR_GREATER - [StringSyntax("graphql")] string sourceText) => -#else +#if NETSTANDARD2_0 string sourceText) => +#else + [StringSyntax("graphql")] string sourceText) => #endif Parse(sourceText, parser => parser.ParseDirectiveDefinition()); @@ -62,10 +62,10 @@ public static DirectiveDefinitionNode ParseDirectiveDefinition( /// Parses a GraphQL field selection string e.g. field(arg: "abc") /// public static FieldDefinitionNode ParseFieldDefinition( -#if NET7_0_OR_GREATER - [StringSyntax("graphql")] string sourceText) => -#else +#if NETSTANDARD2_0 string sourceText) => +#else + [StringSyntax("graphql")] string sourceText) => #endif Parse(sourceText, parser => parser.ParseFieldDefinition()); @@ -87,10 +87,10 @@ public static FieldDefinitionNode ParseFieldDefinition( /// Parses a GraphQL field selection string e.g. field(arg: "abc") /// public static FieldNode ParseField( -#if NET7_0_OR_GREATER - [StringSyntax("graphql")] string sourceText) => -#else +#if NETSTANDARD2_0 string sourceText) => +#else + [StringSyntax("graphql")] string sourceText) => #endif Parse(sourceText, parser => parser.ParseField()); @@ -112,10 +112,10 @@ public static FieldNode ParseField( /// Parses a GraphQL field selection string e.g. field(arg: "abc") /// public static FragmentDefinitionNode ParseFragmentDefinition( -#if NET7_0_OR_GREATER - [StringSyntax("graphql")] string sourceText) => -#else +#if NETSTANDARD2_0 string sourceText) => +#else + [StringSyntax("graphql")] string sourceText) => #endif Parse(sourceText, parser => parser.ParseFragmentDefinition()); @@ -137,10 +137,10 @@ public static FragmentDefinitionNode ParseFragmentDefinition( /// Parses a GraphQL selection set string e.g. { field(arg: "abc") } /// public static SelectionSetNode ParseSelectionSet( -#if NET7_0_OR_GREATER - [StringSyntax("graphql")] string sourceText) => -#else +#if NETSTANDARD2_0 string sourceText) => +#else + [StringSyntax("graphql")] string sourceText) => #endif Parse(sourceText, parser => parser.ParseSelectionSet()); @@ -159,10 +159,10 @@ public static SelectionSetNode ParseSelectionSet( new Utf8GraphQLParser(reader).ParseSelectionSet(); public static IValueNode ParseValueLiteral( -#if NET7_0_OR_GREATER - [StringSyntax("graphql")] string sourceText, -#else +#if NETSTANDARD2_0 string sourceText, +#else + [StringSyntax("graphql")] string sourceText, #endif bool constant = true) => Parse(sourceText, parser => parser.ParseValueLiteral(constant)); @@ -178,10 +178,10 @@ public static IValueNode ParseValueLiteral( new Utf8GraphQLParser(reader).ParseValueLiteral(constant); public static ObjectValueNode ParseObjectLiteral( -#if NET7_0_OR_GREATER - [StringSyntax("graphql")] string sourceText, -#else +#if NETSTANDARD2_0 string sourceText, +#else + [StringSyntax("graphql")] string sourceText, #endif bool constant = true) => Parse(sourceText, parser => parser.ParseObject(constant)); @@ -200,10 +200,10 @@ public static ObjectValueNode ParseObjectLiteral( /// Parses a GraphQL type reference e.g. [String!] /// public static ITypeNode ParseTypeReference( -#if NET7_0_OR_GREATER - [StringSyntax("graphql")] string sourceText) => -#else +#if NETSTANDARD2_0 string sourceText) => +#else + [StringSyntax("graphql")] string sourceText) => #endif Parse(sourceText, parser => parser.ParseTypeReference()); @@ -225,10 +225,10 @@ public static ITypeNode ParseTypeReference( /// Parses a GraphQL schema coordinate e.g. Query.userById(id:) /// public static SchemaCoordinateNode ParseSchemaCoordinate( -#if NET7_0_OR_GREATER - [StringSyntax("graphql")] string sourceText) => -#else +#if NETSTANDARD2_0 string sourceText) => +#else + [StringSyntax("graphql")] string sourceText) => #endif Parse(sourceText, parser => parser.ParseSingleSchemaCoordinate()); diff --git a/src/HotChocolate/Language/src/Language.Utf8/Utf8GraphQLParser.cs b/src/HotChocolate/Language/src/Language.Utf8/Utf8GraphQLParser.cs index 504a03647aa..997d57029f0 100644 --- a/src/HotChocolate/Language/src/Language.Utf8/Utf8GraphQLParser.cs +++ b/src/HotChocolate/Language/src/Language.Utf8/Utf8GraphQLParser.cs @@ -179,18 +179,18 @@ public static DocumentNode Parse( } public static DocumentNode Parse( -#if NET7_0_OR_GREATER - [StringSyntax("graphql")] string sourceText) => -#else +#if NETSTANDARD2_0 string sourceText) => +#else + [StringSyntax("graphql")] string sourceText) => #endif Parse(sourceText, ParserOptions.Default); public static DocumentNode Parse( -#if NET7_0_OR_GREATER - [StringSyntax("graphql")] string sourceText, -#else +#if NETSTANDARD2_0 string sourceText, +#else + [StringSyntax("graphql")] string sourceText, #endif ParserOptions options) { diff --git a/src/HotChocolate/Language/src/Language.Web/DocumentHashProviderBase.cs b/src/HotChocolate/Language/src/Language.Web/DocumentHashProviderBase.cs index adeb75a329b..40e1ba90b0d 100644 --- a/src/HotChocolate/Language/src/Language.Web/DocumentHashProviderBase.cs +++ b/src/HotChocolate/Language/src/Language.Web/DocumentHashProviderBase.cs @@ -19,9 +19,7 @@ internal DocumentHashProviderBase(HashFormat format) public string ComputeHash(ReadOnlySpan document) { -#if NET6_0_OR_GREATER - return ComputeHash(document, Format); -#else +#if NETSTANDARD2_0 var rented = ArrayPool.Shared.Rent(document.Length); document.CopyTo(rented); @@ -34,13 +32,15 @@ public string ComputeHash(ReadOnlySpan document) { ArrayPool.Shared.Return(rented); } +#else + return ComputeHash(document, Format); #endif } -#if NET6_0_OR_GREATER - protected abstract string ComputeHash(ReadOnlySpan document, HashFormat format); -#else +#if NETSTANDARD2_0 protected abstract byte[] ComputeHash(byte[] document, int length); +#else + protected abstract string ComputeHash(ReadOnlySpan document, HashFormat format); #endif protected static string FormatHash(ReadOnlySpan hash, HashFormat format) diff --git a/src/HotChocolate/Language/src/Language.Web/MD5DocumentHashProvider.cs b/src/HotChocolate/Language/src/Language.Web/MD5DocumentHashProvider.cs index c70ace561f1..ea3b0485bc9 100644 --- a/src/HotChocolate/Language/src/Language.Web/MD5DocumentHashProvider.cs +++ b/src/HotChocolate/Language/src/Language.Web/MD5DocumentHashProvider.cs @@ -15,7 +15,12 @@ public MD5DocumentHashProvider(HashFormat format) public override string Name => "md5Hash"; -#if NET6_0_OR_GREATER +#if NETSTANDARD2_0 + protected override byte[] ComputeHash(byte[] document, int length) + { + return _md5.Value!.ComputeHash(document, 0, length); + } +#else [MethodImpl(MethodImplOptions.AggressiveInlining)] protected override string ComputeHash(ReadOnlySpan document, HashFormat format) { @@ -31,10 +36,5 @@ protected override string ComputeHash(ReadOnlySpan document, HashFormat fo return FormatHash(hashSpan, format); } -#else - protected override byte[] ComputeHash(byte[] document, int length) - { - return _md5.Value!.ComputeHash(document, 0, length); - } #endif } diff --git a/src/HotChocolate/Language/src/Language.Web/Sha1DocumentHashProvider.cs b/src/HotChocolate/Language/src/Language.Web/Sha1DocumentHashProvider.cs index b69235a0255..f3fd16de7b5 100644 --- a/src/HotChocolate/Language/src/Language.Web/Sha1DocumentHashProvider.cs +++ b/src/HotChocolate/Language/src/Language.Web/Sha1DocumentHashProvider.cs @@ -19,7 +19,10 @@ public Sha1DocumentHashProvider(HashFormat format) public override string Name => "sha1Hash"; -#if NET6_0_OR_GREATER +#if NETSTANDARD2_0 + protected override byte[] ComputeHash(byte[] document, int length) + => _sha.Value!.ComputeHash(document, 0, length); +#else [MethodImpl(MethodImplOptions.AggressiveInlining)] protected override string ComputeHash(ReadOnlySpan document, HashFormat format) { @@ -35,8 +38,5 @@ protected override string ComputeHash(ReadOnlySpan document, HashFormat fo return FormatHash(hashSpan, format); } -#else - protected override byte[] ComputeHash(byte[] document, int length) - => _sha.Value!.ComputeHash(document, 0, length); #endif } diff --git a/src/HotChocolate/Language/src/Language.Web/Sha256DocumentHashProvider.cs b/src/HotChocolate/Language/src/Language.Web/Sha256DocumentHashProvider.cs index ca7c1fcbe9a..2e23a40e913 100644 --- a/src/HotChocolate/Language/src/Language.Web/Sha256DocumentHashProvider.cs +++ b/src/HotChocolate/Language/src/Language.Web/Sha256DocumentHashProvider.cs @@ -19,7 +19,12 @@ public Sha256DocumentHashProvider(HashFormat format) public override string Name => "sha256Hash"; -#if NET6_0_OR_GREATER +#if NETSTANDARD2_0 + protected override byte[] ComputeHash(byte[] document, int length) + { + return _sha.Value!.ComputeHash(document, 0, length); + } +#else [MethodImpl(MethodImplOptions.AggressiveInlining)] protected override string ComputeHash(ReadOnlySpan document, HashFormat format) { @@ -35,10 +40,5 @@ protected override string ComputeHash(ReadOnlySpan document, HashFormat fo return FormatHash(hashSpan, format); } -#else - protected override byte[] ComputeHash(byte[] document, int length) - { - return _sha.Value!.ComputeHash(document, 0, length); - } #endif } diff --git a/src/HotChocolate/Language/test/Directory.Build.props b/src/HotChocolate/Language/test/Directory.Build.props index 7015caa55c1..ddc3cda3f7f 100644 --- a/src/HotChocolate/Language/test/Directory.Build.props +++ b/src/HotChocolate/Language/test/Directory.Build.props @@ -2,7 +2,6 @@ - $(TestTargetFrameworks) false false diff --git a/src/HotChocolate/Marten/Directory.Build.props b/src/HotChocolate/Marten/Directory.Build.props index d8153909cde..ac19990dffa 100644 --- a/src/HotChocolate/Marten/Directory.Build.props +++ b/src/HotChocolate/Marten/Directory.Build.props @@ -2,7 +2,6 @@ - $(Library2TargetFrameworks) $(NoWarn);CA1062 en diff --git a/src/HotChocolate/MongoDb/.vscode/launch.json b/src/HotChocolate/MongoDb/.vscode/launch.json deleted file mode 100644 index 61ce9527c03..00000000000 --- a/src/HotChocolate/MongoDb/.vscode/launch.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - // Use IntelliSense to find out which attributes exist for C# debugging - // Use hover for the description of the existing attributes - // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md - "version": "0.2.0", - "configurations": [ - { - "name": ".NET Core Launch (console)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/test/Data.Filters.SqlServer.Tests/bin/Debug/netcoreapp3.1/Data.Filters.SqlServer.Tests.dll", - "args": [], - "cwd": "${workspaceFolder}/test/Data.Filters.SqlServer.Tests", - // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console - "console": "internalConsole", - "stopAtEntry": false - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach", - "processId": "${command:pickProcess}" - } - ] -} \ No newline at end of file diff --git a/src/HotChocolate/MongoDb/.vscode/settings.json b/src/HotChocolate/MongoDb/.vscode/settings.json deleted file mode 100644 index 7a73a41bfdf..00000000000 --- a/src/HotChocolate/MongoDb/.vscode/settings.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/src/HotChocolate/MongoDb/.vscode/tasks.json b/src/HotChocolate/MongoDb/.vscode/tasks.json deleted file mode 100644 index 31c32bd3457..00000000000 --- a/src/HotChocolate/MongoDb/.vscode/tasks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "shell", - "args": [ - "build", - // Ask dotnet build to generate full paths for file names. - "/property:GenerateFullPaths=true", - // Do not generate summary otherwise it leads to duplicate errors in Problems panel - "/consoleloggerparameters:NoSummary" - ], - "group": "build", - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/src/HotChocolate/MongoDb/Directory.Build.props b/src/HotChocolate/MongoDb/Directory.Build.props index d8153909cde..ac19990dffa 100644 --- a/src/HotChocolate/MongoDb/Directory.Build.props +++ b/src/HotChocolate/MongoDb/Directory.Build.props @@ -2,7 +2,6 @@ - $(Library2TargetFrameworks) $(NoWarn);CA1062 en diff --git a/src/HotChocolate/MongoDb/src/Data/Filters/Convention/Extensions/MongoDbFilterConventionDescriptorExtensions.cs b/src/HotChocolate/MongoDb/src/Data/Filters/Convention/Extensions/MongoDbFilterConventionDescriptorExtensions.cs index b938c8202d3..ff512b7502c 100644 --- a/src/HotChocolate/MongoDb/src/Data/Filters/Convention/Extensions/MongoDbFilterConventionDescriptorExtensions.cs +++ b/src/HotChocolate/MongoDb/src/Data/Filters/Convention/Extensions/MongoDbFilterConventionDescriptorExtensions.cs @@ -114,10 +114,8 @@ public static IFilterConventionDescriptor BindDefaultMongoDbTypes( .BindComparableType() .BindComparableType() .BindComparableType() -#if NET6_0_OR_GREATER .BindComparableType() .BindComparableType() -#endif .BindComparableType() .BindRuntimeType>() .BindRuntimeType>(); @@ -152,12 +150,10 @@ public static IFilterConventionDescriptor BindDefaultMongoDbTypes( .BindRuntimeType() .BindRuntimeType() .BindRuntimeType() -#if NET6_0_OR_GREATER .BindRuntimeType() .BindRuntimeType() .BindRuntimeType() .BindRuntimeType() -#endif .BindRuntimeType() .BindRuntimeType() .BindRuntimeType() diff --git a/src/HotChocolate/MongoDb/src/Data/Relay/ObjectIdNodeIdValueSerializer.cs b/src/HotChocolate/MongoDb/src/Data/Relay/ObjectIdNodeIdValueSerializer.cs index ea0b4cd1e85..d3fbbaa3c9e 100644 --- a/src/HotChocolate/MongoDb/src/Data/Relay/ObjectIdNodeIdValueSerializer.cs +++ b/src/HotChocolate/MongoDb/src/Data/Relay/ObjectIdNodeIdValueSerializer.cs @@ -132,7 +132,7 @@ public bool TryParse(ReadOnlySpan buffer, [NotNullWhen(true)] out object? private static bool TryParseHexString(ReadOnlySpan formattedId, byte[] rawBytes) { - if (formattedId == null) + if (formattedId.IsEmpty) { return false; } diff --git a/src/HotChocolate/OpenApi/Directory.Build.props b/src/HotChocolate/OpenApi/Directory.Build.props index 504e90cb29e..ea6e2bc3aaf 100644 --- a/src/HotChocolate/OpenApi/Directory.Build.props +++ b/src/HotChocolate/OpenApi/Directory.Build.props @@ -1,8 +1,4 @@ - - net8.0 - - diff --git a/src/HotChocolate/OpenApi/src/HotChocolate.OpenApi/Extensions/RequestExecutorBuilderExtensions.cs b/src/HotChocolate/OpenApi/src/HotChocolate.OpenApi/Extensions/RequestExecutorBuilderExtensions.cs index 212be0c8f7e..5209fe470fe 100644 --- a/src/HotChocolate/OpenApi/src/HotChocolate.OpenApi/Extensions/RequestExecutorBuilderExtensions.cs +++ b/src/HotChocolate/OpenApi/src/HotChocolate.OpenApi/Extensions/RequestExecutorBuilderExtensions.cs @@ -17,7 +17,7 @@ public static IRequestExecutorBuilder AddOpenApi( bool enableMutationConventions = false, MutationConventionOptions mutationConventionOptions = default) { - ArgumentNullException.ThrowIfNull(nameof(builder)); + ArgumentNullException.ThrowIfNull(builder); ArgumentException.ThrowIfNullOrEmpty(nameof(httpClientName)); ArgumentException.ThrowIfNullOrEmpty(nameof(openApiDocumentText)); diff --git a/src/HotChocolate/OpenApi/src/HotChocolate.OpenApi/Extensions/StringExtensions.cs b/src/HotChocolate/OpenApi/src/HotChocolate.OpenApi/Extensions/StringExtensions.cs index bc0a633ad6f..4c33528467c 100644 --- a/src/HotChocolate/OpenApi/src/HotChocolate.OpenApi/Extensions/StringExtensions.cs +++ b/src/HotChocolate/OpenApi/src/HotChocolate.OpenApi/Extensions/StringExtensions.cs @@ -4,7 +4,7 @@ internal static class StringExtensions { public static string FirstCharacterToLower(this string value) { - ArgumentNullException.ThrowIfNull(nameof(value)); + ArgumentNullException.ThrowIfNull(value); if (value.Length is 0) { @@ -19,7 +19,7 @@ public static string FirstCharacterToLower(this string value) public static string FirstCharacterToUpper(this string value) { - ArgumentNullException.ThrowIfNull(nameof(value)); + ArgumentNullException.ThrowIfNull(value); if (value.Length is 0) { diff --git a/src/HotChocolate/Pagination/Directory.Build.props b/src/HotChocolate/Pagination/Directory.Build.props index ac43e770784..8753bbfa113 100644 --- a/src/HotChocolate/Pagination/Directory.Build.props +++ b/src/HotChocolate/Pagination/Directory.Build.props @@ -2,7 +2,6 @@ - $(Library2TargetFrameworks) $(NoWarn);CA1062 en diff --git a/src/HotChocolate/Pagination/src/Directory.Build.props b/src/HotChocolate/Pagination/src/Directory.Build.props index 74bdec99055..61fadb5f680 100644 --- a/src/HotChocolate/Pagination/src/Directory.Build.props +++ b/src/HotChocolate/Pagination/src/Directory.Build.props @@ -2,9 +2,7 @@ - diff --git a/src/HotChocolate/Pagination/src/Pagination.Batching/Extensions/HotChocolatePaginationBatchingDataLoaderExtensions.cs b/src/HotChocolate/Pagination/src/Pagination.Batching/Extensions/HotChocolatePaginationBatchingDataLoaderExtensions.cs index 68bd083f92f..18f22c49083 100644 --- a/src/HotChocolate/Pagination/src/Pagination.Batching/Extensions/HotChocolatePaginationBatchingDataLoaderExtensions.cs +++ b/src/HotChocolate/Pagination/src/Pagination.Batching/Extensions/HotChocolatePaginationBatchingDataLoaderExtensions.cs @@ -83,9 +83,7 @@ static IDataLoader CreatePagingDataLoader( /// /// Throws if the is null. /// -#if NET8_0_OR_GREATER [Experimental(Experiments.Projections)] -#endif public static IPagingDataLoader> Select( this IPagingDataLoader> dataLoader, Expression> selector) diff --git a/src/HotChocolate/Pagination/src/Pagination.Core/Serialization/StringCursorKeySerializer.cs b/src/HotChocolate/Pagination/src/Pagination.Core/Serialization/StringCursorKeySerializer.cs index 3063505c9a5..ae64002d9bc 100644 --- a/src/HotChocolate/Pagination/src/Pagination.Core/Serialization/StringCursorKeySerializer.cs +++ b/src/HotChocolate/Pagination/src/Pagination.Core/Serialization/StringCursorKeySerializer.cs @@ -19,19 +19,6 @@ public object Parse(ReadOnlySpan formattedKey) public bool TryFormat(object key, Span buffer, out int written) { -#if NET8_0_OR_GREATER return _encoding.TryGetBytes((string)key, buffer, out written); -#else - - var s = (string)key; - if(_encoding.GetMaxByteCount(s.Length) > buffer.Length) - { - written = 0; - return false; - } - - written = _encoding.GetBytes(s, buffer); - return true; -#endif } } diff --git a/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/CursorKeySerializerHelperTests.cs b/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/CursorKeySerializerHelperTests.cs index 67060a2bae1..5e2d034c619 100644 --- a/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/CursorKeySerializerHelperTests.cs +++ b/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/CursorKeySerializerHelperTests.cs @@ -93,7 +93,6 @@ public static void TryFormat_EscapedNull_FormatsToEscapedNull() Assert.True(CursorKeySerializerHelper.EscapedNull.SequenceEqual(buffer)); } -#if NET8_0_OR_GREATER [Fact] public static void TryFormat_StringWithoutColons_FormatsCorrectly() { @@ -125,7 +124,6 @@ public static void TryFormat_StringWithColons_EscapesAndFormatsCorrectly() Assert.Equal(12, written); // "part1\\:part2" is 12 bytes Assert.Equal("part1\\:part2", Encoding.UTF8.GetString(buffer.Slice(0, written))); } -#endif [Fact] public static void TryFormat_BufferTooSmall_ReturnsFalse() diff --git a/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/HotChocolate.Pagination.EntityFramework.Tests.csproj b/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/HotChocolate.Pagination.EntityFramework.Tests.csproj index 6d19df84dd7..e96b8e5f86e 100644 --- a/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/HotChocolate.Pagination.EntityFramework.Tests.csproj +++ b/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/HotChocolate.Pagination.EntityFramework.Tests.csproj @@ -2,7 +2,7 @@ HotChocolate.Data - GD0001 + $(NoWarn);GD0001 diff --git a/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/PagingHelperIntegrationTests.cs b/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/PagingHelperIntegrationTests.cs index dc39160eb6e..4df0e245b55 100644 --- a/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/PagingHelperIntegrationTests.cs +++ b/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/PagingHelperIntegrationTests.cs @@ -435,13 +435,7 @@ public async Task Nested_Paging_First_2() var operationResult = result.ExpectOperationResult(); var sql = operationResult.Extensions!["sql"]!.ToString(); -#if NET8_0_OR_GREATER await Snapshot.Create() -#elif NET7_0_OR_GREATER - await Snapshot.Create("NET7") -#else - await Snapshot.Create("NET6") -#endif .Add(sql, "SQL", "sql") .Add(operationResult.WithExtensions(ImmutableDictionary.Empty)) .MatchMarkdownAsync(); @@ -490,13 +484,7 @@ public async Task Nested_Paging_First_2_With_Projections() var operationResult = result.ExpectOperationResult(); var sql = operationResult.Extensions!["sql"]!.ToString(); -#if NET8_0_OR_GREATER await Snapshot.Create() -#elif NET7_0_OR_GREATER - await Snapshot.Create("NET7") -#else - await Snapshot.Create("NET6") -#endif .Add(sql, "SQL", "sql") .Add(operationResult.WithExtensions(ImmutableDictionary.Empty)) .MatchMarkdownAsync(); diff --git a/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_NET6.md b/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_NET6.md deleted file mode 100644 index 125b4a7d084..00000000000 --- a/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_NET6.md +++ /dev/null @@ -1,68 +0,0 @@ -# Nested_Paging_First_2 - -## SQL - -```sql -SELECT p."Id", p."AvailableStock", p."BrandId", p."Description", p."ImageFileName", p."MaxStockThreshold", p."Name", p."OnReorder", p."Price", p."RestockThreshold", p."TypeId" -FROM "Products" AS p -WHERE p."BrandId" IN (2, 1) -ORDER BY p."Name", p."Id" -``` - -## Result 2 - -```json -{ - "data": { - "brands": { - "edges": [ - { - "cursor": "QnJhbmQwOjE=" - }, - { - "cursor": "QnJhbmQxOjI=" - } - ], - "nodes": [ - { - "products": { - "nodes": [ - { - "name": "Product 0-0" - }, - { - "name": "Product 0-1" - } - ], - "pageInfo": { - "hasNextPage": true, - "hasPreviousPage": false, - "startCursor": "UHJvZHVjdCAwLTA6MQ==", - "endCursor": "UHJvZHVjdCAwLTE6Mg==" - } - } - }, - { - "products": { - "nodes": [ - { - "name": "Product 1-0" - }, - { - "name": "Product 1-1" - } - ], - "pageInfo": { - "hasNextPage": true, - "hasPreviousPage": false, - "startCursor": "UHJvZHVjdCAxLTA6MTAx", - "endCursor": "UHJvZHVjdCAxLTE6MTAy" - } - } - } - ] - } - } -} -``` - diff --git a/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_NET7.md b/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_NET7.md deleted file mode 100644 index 125b4a7d084..00000000000 --- a/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_NET7.md +++ /dev/null @@ -1,68 +0,0 @@ -# Nested_Paging_First_2 - -## SQL - -```sql -SELECT p."Id", p."AvailableStock", p."BrandId", p."Description", p."ImageFileName", p."MaxStockThreshold", p."Name", p."OnReorder", p."Price", p."RestockThreshold", p."TypeId" -FROM "Products" AS p -WHERE p."BrandId" IN (2, 1) -ORDER BY p."Name", p."Id" -``` - -## Result 2 - -```json -{ - "data": { - "brands": { - "edges": [ - { - "cursor": "QnJhbmQwOjE=" - }, - { - "cursor": "QnJhbmQxOjI=" - } - ], - "nodes": [ - { - "products": { - "nodes": [ - { - "name": "Product 0-0" - }, - { - "name": "Product 0-1" - } - ], - "pageInfo": { - "hasNextPage": true, - "hasPreviousPage": false, - "startCursor": "UHJvZHVjdCAwLTA6MQ==", - "endCursor": "UHJvZHVjdCAwLTE6Mg==" - } - } - }, - { - "products": { - "nodes": [ - { - "name": "Product 1-0" - }, - { - "name": "Product 1-1" - } - ], - "pageInfo": { - "hasNextPage": true, - "hasPreviousPage": false, - "startCursor": "UHJvZHVjdCAxLTA6MTAx", - "endCursor": "UHJvZHVjdCAxLTE6MTAy" - } - } - } - ] - } - } -} -``` - diff --git a/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_With_Projections_NET6.md b/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_With_Projections_NET6.md deleted file mode 100644 index e619f9f23df..00000000000 --- a/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_With_Projections_NET6.md +++ /dev/null @@ -1,68 +0,0 @@ -# Nested_Paging_First_2_With_Projections - -## SQL - -```sql -SELECT p."Id", p."AvailableStock", p."BrandId", p."Description", p."ImageFileName", p."MaxStockThreshold", p."Name", p."OnReorder", p."Price", p."RestockThreshold", p."TypeId" -FROM "Products" AS p -WHERE p."BrandId" IN (2, 1) -ORDER BY p."Name", p."Id" -``` - -## Result 2 - -```json -{ - "data": { - "brands": { - "edges": [ - { - "cursor": "QnJhbmQwOjE=" - }, - { - "cursor": "QnJhbmQxOjI=" - } - ], - "nodes": [ - { - "products": { - "nodes": [ - { - "name": "Product 0-0" - }, - { - "name": "Product 0-1" - } - ], - "pageInfo": { - "hasNextPage": true, - "hasPreviousPage": false, - "startCursor": "UHJvZHVjdCAwLTA6MQ==", - "endCursor": "UHJvZHVjdCAwLTE6Mg==" - } - } - }, - { - "products": { - "nodes": [ - { - "name": "Product 1-0" - }, - { - "name": "Product 1-1" - } - ], - "pageInfo": { - "hasNextPage": true, - "hasPreviousPage": false, - "startCursor": "UHJvZHVjdCAxLTA6MTAx", - "endCursor": "UHJvZHVjdCAxLTE6MTAy" - } - } - } - ] - } - } -} -``` - diff --git a/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_With_Projections_NET7.md b/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_With_Projections_NET7.md deleted file mode 100644 index e619f9f23df..00000000000 --- a/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/__snapshots__/IntegrationPagingHelperTests.Nested_Paging_First_2_With_Projections_NET7.md +++ /dev/null @@ -1,68 +0,0 @@ -# Nested_Paging_First_2_With_Projections - -## SQL - -```sql -SELECT p."Id", p."AvailableStock", p."BrandId", p."Description", p."ImageFileName", p."MaxStockThreshold", p."Name", p."OnReorder", p."Price", p."RestockThreshold", p."TypeId" -FROM "Products" AS p -WHERE p."BrandId" IN (2, 1) -ORDER BY p."Name", p."Id" -``` - -## Result 2 - -```json -{ - "data": { - "brands": { - "edges": [ - { - "cursor": "QnJhbmQwOjE=" - }, - { - "cursor": "QnJhbmQxOjI=" - } - ], - "nodes": [ - { - "products": { - "nodes": [ - { - "name": "Product 0-0" - }, - { - "name": "Product 0-1" - } - ], - "pageInfo": { - "hasNextPage": true, - "hasPreviousPage": false, - "startCursor": "UHJvZHVjdCAwLTA6MQ==", - "endCursor": "UHJvZHVjdCAwLTE6Mg==" - } - } - }, - { - "products": { - "nodes": [ - { - "name": "Product 1-0" - }, - { - "name": "Product 1-1" - } - ], - "pageInfo": { - "hasNextPage": true, - "hasPreviousPage": false, - "startCursor": "UHJvZHVjdCAxLTA6MTAx", - "endCursor": "UHJvZHVjdCAxLTE6MTAy" - } - } - } - ] - } - } -} -``` - diff --git a/src/HotChocolate/PersistedOperations/.vscode/tasks.json b/src/HotChocolate/PersistedOperations/.vscode/tasks.json deleted file mode 100644 index 31c32bd3457..00000000000 --- a/src/HotChocolate/PersistedOperations/.vscode/tasks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "shell", - "args": [ - "build", - // Ask dotnet build to generate full paths for file names. - "/property:GenerateFullPaths=true", - // Do not generate summary otherwise it leads to duplicate errors in Problems panel - "/consoleloggerparameters:NoSummary" - ], - "group": "build", - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/src/HotChocolate/PersistedOperations/src/Directory.Build.props b/src/HotChocolate/PersistedOperations/src/Directory.Build.props index 0d3215407d9..b56da5ac7dc 100644 --- a/src/HotChocolate/PersistedOperations/src/Directory.Build.props +++ b/src/HotChocolate/PersistedOperations/src/Directory.Build.props @@ -2,8 +2,4 @@ - - $(LibraryTargetFrameworks) - - diff --git a/src/HotChocolate/PersistedOperations/src/PersistedOperations.FileSystem/FileSystemOperationDocumentStorage.cs b/src/HotChocolate/PersistedOperations/src/PersistedOperations.FileSystem/FileSystemOperationDocumentStorage.cs index 520aaf6f90c..fc9e38c32a9 100644 --- a/src/HotChocolate/PersistedOperations/src/PersistedOperations.FileSystem/FileSystemOperationDocumentStorage.cs +++ b/src/HotChocolate/PersistedOperations/src/PersistedOperations.FileSystem/FileSystemOperationDocumentStorage.cs @@ -47,11 +47,7 @@ public FileSystemOperationDocumentStorage(IOperationDocumentFileMap documentMap) string filePath, CancellationToken cancellationToken) { -#if NETSTANDARD2_0 - using var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read); -#else await using var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read); -#endif var document = await BufferHelper.ReadAsync( stream, @@ -96,11 +92,7 @@ private static async ValueTask SaveInternalAsync( return; } -#if NETSTANDARD2_0 - using var stream = new FileStream(filePath, FileMode.CreateNew, FileAccess.Write); -#else await using var stream = new FileStream(filePath, FileMode.CreateNew, FileAccess.Write); -#endif await document.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); await stream.FlushAsync(cancellationToken).ConfigureAwait(false); } diff --git a/src/HotChocolate/PersistedOperations/test/Directory.Build.props b/src/HotChocolate/PersistedOperations/test/Directory.Build.props index a49dd2f5620..4f4a5078fc8 100644 --- a/src/HotChocolate/PersistedOperations/test/Directory.Build.props +++ b/src/HotChocolate/PersistedOperations/test/Directory.Build.props @@ -2,7 +2,6 @@ - $(TestTargetFrameworks) false false diff --git a/src/HotChocolate/Primitives/src/Directory.Build.props b/src/HotChocolate/Primitives/src/Directory.Build.props index 99981438058..96ae8bcf77a 100644 --- a/src/HotChocolate/Primitives/src/Directory.Build.props +++ b/src/HotChocolate/Primitives/src/Directory.Build.props @@ -3,13 +3,10 @@ - $(LibraryTargetFrameworks) $(NoWarn);CA1812 - - true - true + true diff --git a/src/HotChocolate/Primitives/src/Primitives/HotChocolate.Primitives.csproj b/src/HotChocolate/Primitives/src/Primitives/HotChocolate.Primitives.csproj index 2b4122fde8a..a006e6e2469 100644 --- a/src/HotChocolate/Primitives/src/Primitives/HotChocolate.Primitives.csproj +++ b/src/HotChocolate/Primitives/src/Primitives/HotChocolate.Primitives.csproj @@ -6,11 +6,6 @@ HotChocolate - - - - - diff --git a/src/HotChocolate/Primitives/src/Primitives/NameUtils.cs b/src/HotChocolate/Primitives/src/Primitives/NameUtils.cs index 8a4b1cf497b..559feeb973c 100644 --- a/src/HotChocolate/Primitives/src/Primitives/NameUtils.cs +++ b/src/HotChocolate/Primitives/src/Primitives/NameUtils.cs @@ -24,9 +24,7 @@ public static class NameUtils /// public static string EnsureGraphQLName( this string? name, - #if NET6_0_OR_GREATER [CallerArgumentExpression("name")] - #endif string argumentName = "name") { if (name.IsValidGraphQLName()) diff --git a/src/HotChocolate/Raven/Directory.Build.props b/src/HotChocolate/Raven/Directory.Build.props index d8153909cde..ac19990dffa 100644 --- a/src/HotChocolate/Raven/Directory.Build.props +++ b/src/HotChocolate/Raven/Directory.Build.props @@ -2,7 +2,6 @@ - $(Library2TargetFrameworks) $(NoWarn);CA1062 en diff --git a/src/HotChocolate/Raven/test/Data.Raven.Filters.Tests/ConventionTests.cs b/src/HotChocolate/Raven/test/Data.Raven.Filters.Tests/ConventionTests.cs index ee610fb57ca..3be757fdacc 100644 --- a/src/HotChocolate/Raven/test/Data.Raven.Filters.Tests/ConventionTests.cs +++ b/src/HotChocolate/Raven/test/Data.Raven.Filters.Tests/ConventionTests.cs @@ -18,17 +18,10 @@ public async Task ListType_Should_NotContainAllOperation() var tester = _cache.CreateSchema>(TypeWithList.Data); -#if NET7_0_OR_GREATER await Snapshot .Create() .Add(tester.Schema.Print(), "schema") .MatchAsync(); -#else - await Snapshot - .Create("NET6") - .Add(tester.Schema.Print(), "schema") - .MatchAsync(); -#endif } public class TypeWithList diff --git a/src/HotChocolate/Raven/test/Data.Raven.Filters.Tests/__snapshots__/ConventionTests.ListType_Should_NotContainAllOperation_NET6.snap b/src/HotChocolate/Raven/test/Data.Raven.Filters.Tests/__snapshots__/ConventionTests.ListType_Should_NotContainAllOperation_NET6.snap deleted file mode 100644 index 84109d1384b..00000000000 --- a/src/HotChocolate/Raven/test/Data.Raven.Filters.Tests/__snapshots__/ConventionTests.ListType_Should_NotContainAllOperation_NET6.snap +++ /dev/null @@ -1,53 +0,0 @@ -schema { - query: Query -} - -type ListItem { - id: String - foo: String -} - -type Query { - root(where: TypeWithListFilterInput): [TypeWithList] - rootExecutable(where: TypeWithListFilterInput): [TypeWithList] -} - -type TypeWithList { - id: String - list: [ListItem!] -} - -input ListFilterInputTypeOfListItemFilterInput { - none: ListItemFilterInput - some: ListItemFilterInput - any: Boolean -} - -input ListItemFilterInput { - and: [ListItemFilterInput!] - or: [ListItemFilterInput!] - id: StringOperationFilterInput - foo: StringOperationFilterInput -} - -input StringOperationFilterInput { - and: [StringOperationFilterInput!] - or: [StringOperationFilterInput!] - eq: String - neq: String - contains: String - ncontains: String - in: [String] - nin: [String] - startsWith: String - nstartsWith: String - endsWith: String - nendsWith: String -} - -input TypeWithListFilterInput { - and: [TypeWithListFilterInput!] - or: [TypeWithListFilterInput!] - id: StringOperationFilterInput - list: ListFilterInputTypeOfListItemFilterInput -} diff --git a/src/HotChocolate/Raven/test/Data.Raven.Tests/AnnotationBasedTests.cs b/src/HotChocolate/Raven/test/Data.Raven.Tests/AnnotationBasedTests.cs index 285a44018a0..f8b2dc13c1e 100644 --- a/src/HotChocolate/Raven/test/Data.Raven.Tests/AnnotationBasedTests.cs +++ b/src/HotChocolate/Raven/test/Data.Raven.Tests/AnnotationBasedTests.cs @@ -242,11 +242,7 @@ public async Task Executable_Should_Work() public ValueTask CreateExecutorAsync() => new ServiceCollection() .AddSingleton(CreateDocumentStore()) -#if NET7_0_OR_GREATER .AddGraphQLServer(disableCostAnalyzer: true) -#else - .AddGraphQLServer() -#endif .AddRavenFiltering() .AddRavenProjections() .AddRavenSorting() diff --git a/src/HotChocolate/Skimmed/Directory.Build.props b/src/HotChocolate/Skimmed/Directory.Build.props index 504e90cb29e..ea6e2bc3aaf 100644 --- a/src/HotChocolate/Skimmed/Directory.Build.props +++ b/src/HotChocolate/Skimmed/Directory.Build.props @@ -1,8 +1,4 @@ - - net8.0 - - diff --git a/src/HotChocolate/Skimmed/src/Directory.Build.props b/src/HotChocolate/Skimmed/src/Directory.Build.props index c764b72eb7e..96ae8bcf77a 100644 --- a/src/HotChocolate/Skimmed/src/Directory.Build.props +++ b/src/HotChocolate/Skimmed/src/Directory.Build.props @@ -6,9 +6,7 @@ $(NoWarn);CA1812 - - true - true + true diff --git a/src/HotChocolate/Skimmed/src/Skimmed/Collections/ReadOnlyObjectTypeDefinitionCollection.cs b/src/HotChocolate/Skimmed/src/Skimmed/Collections/ReadOnlyObjectTypeDefinitionCollection.cs index 3d1f1c7a5d3..cd815377fc3 100644 --- a/src/HotChocolate/Skimmed/src/Skimmed/Collections/ReadOnlyObjectTypeDefinitionCollection.cs +++ b/src/HotChocolate/Skimmed/src/Skimmed/Collections/ReadOnlyObjectTypeDefinitionCollection.cs @@ -9,7 +9,7 @@ public sealed class ReadOnlyObjectTypeDefinitionCollection : IObjectTypeDefiniti private ReadOnlyObjectTypeDefinitionCollection(IEnumerable types) { - ArgumentNullException.ThrowIfNull(nameof(types)); + ArgumentNullException.ThrowIfNull(types); _types = types.ToArray(); } diff --git a/src/HotChocolate/Spatial/.vscode/launch.json b/src/HotChocolate/Spatial/.vscode/launch.json deleted file mode 100644 index 02e5498d04d..00000000000 --- a/src/HotChocolate/Spatial/.vscode/launch.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // Use IntelliSense to find out which attributes exist for C# debugging - // Use hover for the description of the existing attributes - // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md - "version": "0.2.0", - "configurations": [ - { - "name": "demo - no launch", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/demo/Spatial.Demo/bin/Debug/net5.0/Spatial.Demo.dll", - "args": [], - "cwd": "${workspaceFolder}/demo/Spatial.Demo", - "stopAtEntry": false, - "internalConsoleOptions": "openOnSessionStart", - "env": { - "ASPNETCORE_ENVIRONMENT": "Development", - "ASPNETCORE_URLS": "http://localhost:5000" - } - } - ] -} diff --git a/src/HotChocolate/Spatial/.vscode/tasks.json b/src/HotChocolate/Spatial/.vscode/tasks.json deleted file mode 100644 index 31c32bd3457..00000000000 --- a/src/HotChocolate/Spatial/.vscode/tasks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "shell", - "args": [ - "build", - // Ask dotnet build to generate full paths for file names. - "/property:GenerateFullPaths=true", - // Do not generate summary otherwise it leads to duplicate errors in Problems panel - "/consoleloggerparameters:NoSummary" - ], - "group": "build", - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/src/HotChocolate/Spatial/Directory.Build.props b/src/HotChocolate/Spatial/Directory.Build.props index c87d22d03fd..57010fddfa9 100644 --- a/src/HotChocolate/Spatial/Directory.Build.props +++ b/src/HotChocolate/Spatial/Directory.Build.props @@ -3,7 +3,6 @@ en - $(Library2TargetFrameworks) diff --git a/src/HotChocolate/Spatial/src/Types/HotChocolate.Types.Spatial.csproj b/src/HotChocolate/Spatial/src/Types/HotChocolate.Types.Spatial.csproj index 902241b56c5..505cf7f2374 100644 --- a/src/HotChocolate/Spatial/src/Types/HotChocolate.Types.Spatial.csproj +++ b/src/HotChocolate/Spatial/src/Types/HotChocolate.Types.Spatial.csproj @@ -5,7 +5,6 @@ HotChocolate.Types.Spatial HotChocolate.Types.Spatial Contains types for HotChocolate to expose NetTopologySuite as GeoJSON - $(LibraryTargetFrameworks) diff --git a/src/HotChocolate/Spatial/test/Types.Tests/HotChocolate.Types.Spatial.Tests.csproj b/src/HotChocolate/Spatial/test/Types.Tests/HotChocolate.Types.Spatial.Tests.csproj index 70bd9fd830b..abee4c488d3 100644 --- a/src/HotChocolate/Spatial/test/Types.Tests/HotChocolate.Types.Spatial.Tests.csproj +++ b/src/HotChocolate/Spatial/test/Types.Tests/HotChocolate.Types.Spatial.Tests.csproj @@ -3,7 +3,6 @@ HotChocolate.Types.Spatial.Tests HotChocolate.Types.Spatial - $(TestTargetFrameworks) diff --git a/src/HotChocolate/Utilities/.vscode/tasks.json b/src/HotChocolate/Utilities/.vscode/tasks.json deleted file mode 100644 index 4c82f9671e0..00000000000 --- a/src/HotChocolate/Utilities/.vscode/tasks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "shell", - "args": [ - "build", - // Ask dotnet build to generate full paths for file names. - "/property:GenerateFullPaths=true", - // Do not generate summary otherwise it leads to duplicate errors in Problems panel - "/consoleloggerparameters:NoSummary" - ], - "group": "build", - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - } - ] -} diff --git a/src/HotChocolate/Utilities/src/Directory.Build.props b/src/HotChocolate/Utilities/src/Directory.Build.props index 0d3215407d9..b56da5ac7dc 100644 --- a/src/HotChocolate/Utilities/src/Directory.Build.props +++ b/src/HotChocolate/Utilities/src/Directory.Build.props @@ -2,8 +2,4 @@ - - $(LibraryTargetFrameworks) - - diff --git a/src/HotChocolate/Utilities/src/Utilities.DependencyInjection/ServiceCollectionExtensions.cs b/src/HotChocolate/Utilities/src/Utilities.DependencyInjection/ServiceCollectionExtensions.cs index 878abbaf2d0..81879bc7a78 100644 --- a/src/HotChocolate/Utilities/src/Utilities.DependencyInjection/ServiceCollectionExtensions.cs +++ b/src/HotChocolate/Utilities/src/Utilities.DependencyInjection/ServiceCollectionExtensions.cs @@ -7,31 +7,19 @@ internal static class ServiceCollectionExtensions public static bool IsImplementationTypeRegistered( this IServiceCollection services) { -#if NET8_0_OR_GREATER return services.Any(t => !t.IsKeyedService && t.ImplementationType == typeof(TService)); -#else - return services.Any(t => t.ImplementationType == typeof(TService)); -#endif } public static bool IsServiceTypeRegistered( this IServiceCollection services) { -#if NET8_0_OR_GREATER return services.Any(t => !t.IsKeyedService && t.ServiceType == typeof(TService)); -#else - return services.Any(t => t.ServiceType == typeof(TService)); -#endif } public static IServiceCollection RemoveService( this IServiceCollection services) { -#if NET8_0_OR_GREATER var serviceDescriptor = services.FirstOrDefault(t => !t.IsKeyedService && t.ServiceType == typeof(TService)); -#else - var serviceDescriptor = services.FirstOrDefault(t => t.ServiceType == typeof(TService)); -#endif if (serviceDescriptor is not null) { diff --git a/src/HotChocolate/Utilities/src/Utilities.Introspection/HotChocolate.Utilities.Introspection.csproj b/src/HotChocolate/Utilities/src/Utilities.Introspection/HotChocolate.Utilities.Introspection.csproj index 8b7991a7c4f..f31f75228f2 100644 --- a/src/HotChocolate/Utilities/src/Utilities.Introspection/HotChocolate.Utilities.Introspection.csproj +++ b/src/HotChocolate/Utilities/src/Utilities.Introspection/HotChocolate.Utilities.Introspection.csproj @@ -11,10 +11,6 @@ - - - - diff --git a/src/HotChocolate/Utilities/src/Utilities/ArrayWriter.cs b/src/HotChocolate/Utilities/src/Utilities/ArrayWriter.cs index c6d39c838d4..bfc7d205108 100644 --- a/src/HotChocolate/Utilities/src/Utilities/ArrayWriter.cs +++ b/src/HotChocolate/Utilities/src/Utilities/ArrayWriter.cs @@ -1,7 +1,5 @@ using System.Buffers; -#if NET6_0_OR_GREATER using System.Runtime.InteropServices; -#endif using static HotChocolate.Utilities.Properties.UtilityResources; namespace HotChocolate.Utilities; @@ -60,11 +58,7 @@ public ReadOnlyMemory GetWrittenMemory() /// A of the written portion of the buffer. /// public ReadOnlySpan GetWrittenSpan() -#if NET6_0_OR_GREATER => MemoryMarshal.CreateSpan(ref _buffer[0], _start); -#else - => _buffer.AsSpan().Slice(0, _start); -#endif /// /// Advances the writer by the specified number of bytes. @@ -159,11 +153,7 @@ public Span GetSpan(int sizeHint = 0) var size = sizeHint < 1 ? _initialBufferSize : sizeHint; EnsureBufferCapacity(size); -#if NET6_0_OR_GREATER return MemoryMarshal.CreateSpan(ref _buffer[_start], size); -#else - return _buffer.AsSpan().Slice(_start, size); -#endif } /// diff --git a/src/HotChocolate/Utilities/src/Utilities/DependencyInjection/ServiceFactory.cs b/src/HotChocolate/Utilities/src/Utilities/DependencyInjection/ServiceFactory.cs index c74b3f1591f..679e118943e 100644 --- a/src/HotChocolate/Utilities/src/Utilities/DependencyInjection/ServiceFactory.cs +++ b/src/HotChocolate/Utilities/src/Utilities/DependencyInjection/ServiceFactory.cs @@ -1,13 +1,9 @@ using System.Collections.Concurrent; -#if NET6_0_OR_GREATER using System.Diagnostics.CodeAnalysis; -#endif using System.Globalization; using HotChocolate.Utilities.Properties; using Microsoft.Extensions.DependencyInjection; -#if NET6_0_OR_GREATER using static System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes; -#endif namespace HotChocolate.Utilities; @@ -15,13 +11,9 @@ public static class ServiceFactory { private static readonly ConcurrentDictionary _factories = new(); -#if NET6_0_OR_GREATER public static object CreateInstance( IServiceProvider services, [DynamicallyAccessedMembers(PublicConstructors)] Type type) -#else - public static object CreateInstance(IServiceProvider services, Type type) -#endif { if (services is null) { @@ -49,6 +41,8 @@ public static object CreateInstance(IServiceProvider services, Type type) } static ObjectFactory CreateFactory(Type instanceType) +#pragma warning disable IL2067 // FIXME => ActivatorUtilities.CreateFactory(instanceType, []); +#pragma warning restore IL2067 } } diff --git a/src/HotChocolate/Utilities/src/Utilities/HotChocolate.Utilities.csproj b/src/HotChocolate/Utilities/src/Utilities/HotChocolate.Utilities.csproj index b4db534551f..69616b2fe39 100644 --- a/src/HotChocolate/Utilities/src/Utilities/HotChocolate.Utilities.csproj +++ b/src/HotChocolate/Utilities/src/Utilities/HotChocolate.Utilities.csproj @@ -7,8 +7,8 @@ Contains internal helper classes and utilities used by the Hot Chocolate GraphQL type system and the GraphQL query execution engine. - - true + + true @@ -35,12 +35,6 @@ - - - - - - True diff --git a/src/HotChocolate/Utilities/src/Utilities/MiddlewareCompiler.cs b/src/HotChocolate/Utilities/src/Utilities/MiddlewareCompiler.cs index 527c9229a0d..56ad3c3bdef 100644 --- a/src/HotChocolate/Utilities/src/Utilities/MiddlewareCompiler.cs +++ b/src/HotChocolate/Utilities/src/Utilities/MiddlewareCompiler.cs @@ -3,9 +3,7 @@ using System.Linq.Expressions; using System.Reflection; using HotChocolate.Utilities.Properties; -#if NET6_0_OR_GREATER using static System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes; -#endif namespace HotChocolate.Utilities; @@ -28,11 +26,7 @@ internal delegate IEnumerable CreateDelegateHandlers( /// /// This helper compiles classes to middleware delegates. /// -#if NET6_0_OR_GREATER internal static class MiddlewareCompiler<[DynamicallyAccessedMembers(PublicConstructors | PublicMethods)] TMiddleware> -#else -internal static class MiddlewareCompiler -#endif { private static readonly MethodInfo _awaitHelper = typeof(ExpressionHelper).GetMethod(nameof(ExpressionHelper.AwaitTaskHelper))!; @@ -109,15 +103,9 @@ private static MethodCallExpression CreateInvokeMethodCall( UtilityResources.MiddlewareCompiler_ReturnTypeNotSupported); } -#if NET6_0_OR_GREATER private static NewExpression CreateMiddleware( [DynamicallyAccessedMembers(PublicConstructors)] Type middleware, IReadOnlyList parameterHandlers) -#else - private static NewExpression CreateMiddleware( - Type middleware, - IReadOnlyList parameterHandlers) -#endif { var constructor = CreateConstructor(middleware); var arguments = CreateParameters( @@ -125,13 +113,8 @@ private static NewExpression CreateMiddleware( return Expression.New(constructor, arguments); } -#if NET6_0_OR_GREATER private static ConstructorInfo CreateConstructor( [DynamicallyAccessedMembers(PublicConstructors)] Type middleware) -#else - private static ConstructorInfo CreateConstructor( - Type middleware) -#endif { var constructor = middleware.GetConstructors().SingleOrDefault(t => t.IsPublic); @@ -170,13 +153,8 @@ private static List CreateParameters( return arguments; } -#if NET6_0_OR_GREATER private static MethodInfo? GetInvokeMethod( [DynamicallyAccessedMembers(PublicMethods)] Type middlewareType) -#else - private static MethodInfo? GetInvokeMethod( - Type middlewareType) -#endif => middlewareType.GetMethod("InvokeAsync") ?? middlewareType.GetMethod("Invoke"); private static class ExpressionHelper diff --git a/src/HotChocolate/Utilities/test/Directory.Build.props b/src/HotChocolate/Utilities/test/Directory.Build.props index 69c10f315f7..30c4eb9db77 100644 --- a/src/HotChocolate/Utilities/test/Directory.Build.props +++ b/src/HotChocolate/Utilities/test/Directory.Build.props @@ -2,7 +2,6 @@ - $(TestTargetFrameworks) false false diff --git a/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/IntrospectionClientTests.cs b/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/IntrospectionClientTests.cs index 33cd2da6af6..0b8446e70e5 100644 --- a/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/IntrospectionClientTests.cs +++ b/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/IntrospectionClientTests.cs @@ -53,11 +53,7 @@ public async Task IntrospectServer() var schema = await IntrospectionClient.IntrospectServerAsync(client); // assert -#if NET7_0_OR_GREATER schema.ToString(true).MatchSnapshot(); -#else - schema.ToString(true).MatchSnapshot("NET6"); -#endif } [Fact] diff --git a/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__snapshots__/IntrospectionClientTests.IntrospectServer_NET6.snap b/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__snapshots__/IntrospectionClientTests.IntrospectServer_NET6.snap deleted file mode 100644 index 008f2a5e7ae..00000000000 --- a/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/__snapshots__/IntrospectionClientTests.IntrospectServer_NET6.snap +++ /dev/null @@ -1,125 +0,0 @@ -schema { - query: Query - mutation: Mutation - subscription: Subscription -} - -type Query { - hero(episode: Episode! = NEW_HOPE): Character - heroByTraits(traits: JSON!): Character - heroes(episodes: [Episode!]!): [Character!] - character(characterIds: [String!]!): [Character!]! - search(text: String!): [SearchResult] - human(id: String!): Human - droid(id: String!): Droid - time: Long! - evict: Boolean! - wait(m: Int!): Boolean! - someDeprecatedField(deprecatedArg: String! = "foo" @deprecated(reason: "use something else")): String! @deprecated(reason: "use something else") -} - -type Mutation { - createReview(episode: Episode! review: ReviewInput!): Review! - complete(episode: Episode!): Boolean! -} - -type Subscription { - onReview(episode: Episode!): Review! - onNext: String! - onException: String! - delay(delay: Int! count: Int!): String! -} - -type Human implements Character { - id: ID! - name: String! - appearsIn: [Episode] - friends("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): FriendsConnection - otherHuman: Human - height(unit: Unit): Float - homePlanet: String - traits: JSON -} - -type Droid implements Character { - id: ID! - name: String! - appearsIn: [Episode] - friends("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): FriendsConnection - height(unit: Unit): Float - primaryFunction: String - traits: JSON -} - -enum Episode { - NEW_HOPE - EMPIRE - JEDI -} - -interface Character { - id: ID! - name: String! - friends("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): FriendsConnection - appearsIn: [Episode] - traits: JSON - height(unit: Unit): Float -} - -union SearchResult = Starship | Human | Droid - -type Review { - commentary: String - stars: Int! -} - -input ReviewInput { - stars: Int! - commentary: String -} - -"A connection to a list of items." -type FriendsConnection { - "Information to aid in pagination." - pageInfo: PageInfo! - "A list of edges." - edges: [FriendsEdge!] - "A flattened list of the nodes." - nodes: [Character] -} - -enum Unit { - FOOT - METERS -} - -scalar JSON - -type Starship { - id: ID! - name: String! - length(unit: Unit): Float! -} - -"Information about pagination in a connection." -type PageInfo { - "Indicates whether more edges exist following the set defined by the clients arguments." - hasNextPage: Boolean! - "Indicates whether more edges exist prior the set defined by the clients arguments." - hasPreviousPage: Boolean! - "When paginating backwards, the cursor to continue." - startCursor: String - "When paginating forwards, the cursor to continue." - endCursor: String -} - -"An edge in a connection." -type FriendsEdge { - "A cursor for use in pagination." - cursor: String! - "The item at the end of the edge." - node: Character -} - -"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1." -scalar Long diff --git a/src/Nullable.props b/src/Nullable.props index 86176dbcf12..bcb62c973b1 100644 --- a/src/Nullable.props +++ b/src/Nullable.props @@ -1,9 +1,9 @@ - + $(NoWarn);8600;8601;8602;8603;8604;CS0436 - + diff --git a/src/StrawberryShake/Client/.vscode/tasks.json b/src/StrawberryShake/Client/.vscode/tasks.json deleted file mode 100644 index 31c32bd3457..00000000000 --- a/src/StrawberryShake/Client/.vscode/tasks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "shell", - "args": [ - "build", - // Ask dotnet build to generate full paths for file names. - "/property:GenerateFullPaths=true", - // Do not generate summary otherwise it leads to duplicate errors in Problems panel - "/consoleloggerparameters:NoSummary" - ], - "group": "build", - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/src/StrawberryShake/Client/src/Core/Json/JsonResultPatcher.cs b/src/StrawberryShake/Client/src/Core/Json/JsonResultPatcher.cs index 36a74efc6e0..16f475917a2 100644 --- a/src/StrawberryShake/Client/src/Core/Json/JsonResultPatcher.cs +++ b/src/StrawberryShake/Client/src/Core/Json/JsonResultPatcher.cs @@ -30,7 +30,6 @@ public Response PatchResponse(Response response) _json ??= JsonObject.Create(_response.Body.RootElement); -#if NET5_0_OR_GREATER if (_extensions is null && _response.Extensions is not null) { _extensions = new(_response.Extensions); @@ -40,17 +39,6 @@ public Response PatchResponse(Response response) { _contextData = new(_response.ContextData); } -#else - if (_extensions is null && _response.Extensions is not null) - { - _extensions = _response.Extensions.ToDictionary(t => t.Key, t => t.Value); - } - - if (_contextData is null && _response.ContextData is not null) - { - _contextData = _response.ContextData.ToDictionary(t => t.Key, t => t.Value); - } -#endif var current = _json![Data]!; @@ -76,30 +64,18 @@ public Response PatchResponse(Response response) } } -#if NET5_0_OR_GREATER var last = path[^1]; -#else - var last = path[path.Length - 1]; -#endif if (last.ValueKind is JsonValueKind.String) { current = current[last.GetString()!]!; var patchData = JsonObject.Create(dataProp)!; -#if NET5_0_OR_GREATER foreach ((var key, var value) in patchData.ToArray()) { patchData.Remove(key); current[key] = value; } -#else - foreach (var prop in patchData.ToArray()) - { - patchData.Remove(prop.Key); - current[prop.Key] = prop.Value; - } -#endif } else if (last.ValueKind is JsonValueKind.Number) { @@ -113,19 +89,11 @@ public Response PatchResponse(Response response) } else { -#if NET5_0_OR_GREATER foreach ((var key, var value) in patchData.ToArray()) { patchData.Remove(key); element[key] = value; } -#else - foreach (var prop in patchData.ToArray()) - { - patchData.Remove(prop.Key); - element[prop.Key] = prop.Value; - } -#endif } } else @@ -166,24 +134,13 @@ public Response PatchResponse(Response response) if (target is null) { -#if NET5_0_OR_GREATER return new(source); -#else - return source.ToDictionary(t => t.Key, t => t.Value); -#endif } -#if NET5_0_OR_GREATER foreach (var (key, value) in source) { target[key] = value; } -#else - foreach (var prop in source) - { - target[prop.Key] = prop.Value; - } -#endif return target; } diff --git a/src/StrawberryShake/Client/src/Core/Serialization/SerializerResolver.cs b/src/StrawberryShake/Client/src/Core/Serialization/SerializerResolver.cs index d7e52982385..92973326f96 100644 --- a/src/StrawberryShake/Client/src/Core/Serialization/SerializerResolver.cs +++ b/src/StrawberryShake/Client/src/Core/Serialization/SerializerResolver.cs @@ -26,14 +26,7 @@ public SerializerResolver(IEnumerable serializers) foreach (var serializer in serializers) { -#if NET6_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER _serializers.TryAdd(serializer.TypeName, serializer); -#else - if (!_serializers.ContainsKey(serializer.TypeName)) - { - _serializers[serializer.TypeName] = serializer; - } -#endif } foreach (var serializer in diff --git a/src/StrawberryShake/Client/src/Core/StrawberryShake.Core.csproj b/src/StrawberryShake/Client/src/Core/StrawberryShake.Core.csproj index 74692b74d8e..f56578f9fc1 100644 --- a/src/StrawberryShake/Client/src/Core/StrawberryShake.Core.csproj +++ b/src/StrawberryShake/Client/src/Core/StrawberryShake.Core.csproj @@ -16,17 +16,6 @@ - - - - - - - - - - - diff --git a/src/StrawberryShake/Client/src/Directory.Build.props b/src/StrawberryShake/Client/src/Directory.Build.props index ca3e38c54b6..c6b2da658ca 100644 --- a/src/StrawberryShake/Client/src/Directory.Build.props +++ b/src/StrawberryShake/Client/src/Directory.Build.props @@ -2,7 +2,6 @@ - $(LibraryTargetFrameworks) $(NoWarn);CA1812 diff --git a/src/StrawberryShake/Client/src/Persistence.SQLite/StrawberryShake.Persistence.SQLite.csproj b/src/StrawberryShake/Client/src/Persistence.SQLite/StrawberryShake.Persistence.SQLite.csproj index c69c2eb4a19..20468340029 100644 --- a/src/StrawberryShake/Client/src/Persistence.SQLite/StrawberryShake.Persistence.SQLite.csproj +++ b/src/StrawberryShake/Client/src/Persistence.SQLite/StrawberryShake.Persistence.SQLite.csproj @@ -17,11 +17,6 @@ - - - - - diff --git a/src/StrawberryShake/Client/src/Razor/StrawberryShake.Razor.csproj b/src/StrawberryShake/Client/src/Razor/StrawberryShake.Razor.csproj index eaa1b9ad0f0..0a3c3d5d3f5 100644 --- a/src/StrawberryShake/Client/src/Razor/StrawberryShake.Razor.csproj +++ b/src/StrawberryShake/Client/src/Razor/StrawberryShake.Razor.csproj @@ -5,7 +5,6 @@ StrawberryShake.Razor StrawberryShake.Razor Provides razor components for using StrawberryShake. - net8.0; net7.0; net6.0 diff --git a/src/StrawberryShake/Client/src/Transport.Http/HttpConnection.cs b/src/StrawberryShake/Client/src/Transport.Http/HttpConnection.cs index abb2b4a7c87..a04629d44df 100644 --- a/src/StrawberryShake/Client/src/Transport.Http/HttpConnection.cs +++ b/src/StrawberryShake/Client/src/Transport.Http/HttpConnection.cs @@ -38,11 +38,7 @@ private static GraphQLHttpRequest MapRequest(OperationRequest request) } else { -#if NETSTANDARD2_0 - var body = Encoding.UTF8.GetString(document.Body.ToArray()); -#else var body = Encoding.UTF8.GetString(document.Body); -#endif operation = new HotChocolate.Transport.OperationRequest(body, null, name, variables, extensions); } @@ -74,9 +70,9 @@ private static GraphQLHttpRequest MapRequest(OperationRequest request) // to just have lists here, but in case we have a dictionary this should also just work. if (value is IEnumerable> items) { - copy ??= CreateDictionary(variables); + copy ??= new Dictionary(variables); - value = MapVariables(CreateDictionary(items)); + value = MapVariables(new Dictionary(items)); } else if (value is List list) { @@ -105,7 +101,7 @@ private static void MapVariables(List variables) switch (variables[index]) { case IEnumerable> items: - variables[index] = MapVariables(CreateDictionary(items)); + variables[index] = MapVariables(new Dictionary(items)); break; case List list: @@ -115,23 +111,6 @@ private static void MapVariables(List variables) } } - private static Dictionary CreateDictionary( - IEnumerable> values) - { -#if NETSTANDARD2_0 - var dictionary = new Dictionary(); - - foreach (var value in values) - { - dictionary[value.Key] = value.Value; - } - - return dictionary; -#else - return new Dictionary(values); -#endif - } - private static IReadOnlyDictionary MapFilesToVariables( IReadOnlyDictionary variables, IReadOnlyDictionary files) diff --git a/src/StrawberryShake/Client/src/Transport.Http/ResponseEnumerable.cs b/src/StrawberryShake/Client/src/Transport.Http/ResponseEnumerable.cs index 3f65b412c49..365cd711f4a 100644 --- a/src/StrawberryShake/Client/src/Transport.Http/ResponseEnumerable.cs +++ b/src/StrawberryShake/Client/src/Transport.Http/ResponseEnumerable.cs @@ -124,7 +124,6 @@ private static void WriteProperty(Utf8JsonWriter writer, string propertyName, Js private static Exception CreateError(GraphQLHttpResponse response) { -#if NET5_0_OR_GREATER return new HttpRequestException( string.Format( ResponseEnumerator_HttpNoSuccessStatusCode, @@ -132,14 +131,6 @@ private static Exception CreateError(GraphQLHttpResponse response) response.ReasonPhrase), null, response.StatusCode); -#else - return new HttpRequestException( - string.Format( - ResponseEnumerator_HttpNoSuccessStatusCode, - (int)response.StatusCode, - response.ReasonPhrase), - null); -#endif } internal static JsonDocument CreateBodyFromException(Exception exception) diff --git a/src/StrawberryShake/Client/src/Transport.Http/StrawberryShake.Transport.Http.csproj b/src/StrawberryShake/Client/src/Transport.Http/StrawberryShake.Transport.Http.csproj index ad0ed49f7d8..491098604d9 100644 --- a/src/StrawberryShake/Client/src/Transport.Http/StrawberryShake.Transport.Http.csproj +++ b/src/StrawberryShake/Client/src/Transport.Http/StrawberryShake.Transport.Http.csproj @@ -13,10 +13,6 @@ - - - - diff --git a/src/StrawberryShake/Client/src/Transport.WebSockets/StrawberryShake.Transport.WebSockets.csproj b/src/StrawberryShake/Client/src/Transport.WebSockets/StrawberryShake.Transport.WebSockets.csproj index 02114505a96..54b803fea39 100644 --- a/src/StrawberryShake/Client/src/Transport.WebSockets/StrawberryShake.Transport.WebSockets.csproj +++ b/src/StrawberryShake/Client/src/Transport.WebSockets/StrawberryShake.Transport.WebSockets.csproj @@ -16,10 +16,6 @@ - - - - diff --git a/src/StrawberryShake/Client/test/Directory.Build.props b/src/StrawberryShake/Client/test/Directory.Build.props index 32e12d3aa6d..4a65cc9f69c 100644 --- a/src/StrawberryShake/Client/test/Directory.Build.props +++ b/src/StrawberryShake/Client/test/Directory.Build.props @@ -2,7 +2,6 @@ - $(TestTargetFrameworks) false false diff --git a/src/StrawberryShake/CodeGeneration/.vscode/tasks.json b/src/StrawberryShake/CodeGeneration/.vscode/tasks.json deleted file mode 100644 index 31c32bd3457..00000000000 --- a/src/StrawberryShake/CodeGeneration/.vscode/tasks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "shell", - "args": [ - "build", - // Ask dotnet build to generate full paths for file names. - "/property:GenerateFullPaths=true", - // Do not generate summary otherwise it leads to duplicate errors in Problems panel - "/consoleloggerparameters:NoSummary" - ], - "group": "build", - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/src/StrawberryShake/CodeGeneration/src/CodeGeneration/Analyzers/FieldCollector.cs b/src/StrawberryShake/CodeGeneration/src/CodeGeneration/Analyzers/FieldCollector.cs index 1b1233f53e2..5080b0aa8ad 100644 --- a/src/StrawberryShake/CodeGeneration/src/CodeGeneration/Analyzers/FieldCollector.cs +++ b/src/StrawberryShake/CodeGeneration/src/CodeGeneration/Analyzers/FieldCollector.cs @@ -1,5 +1,7 @@ using HotChocolate; +#if NET8_0 using HotChocolate.Execution; +#endif using HotChocolate.Language; using HotChocolate.Types; using HotChocolate.Utilities; diff --git a/src/StrawberryShake/CodeGeneration/src/CodeGeneration/Analyzers/FragmentHelper.cs b/src/StrawberryShake/CodeGeneration/src/CodeGeneration/Analyzers/FragmentHelper.cs index f1106443220..be1b163270a 100644 --- a/src/StrawberryShake/CodeGeneration/src/CodeGeneration/Analyzers/FragmentHelper.cs +++ b/src/StrawberryShake/CodeGeneration/src/CodeGeneration/Analyzers/FragmentHelper.cs @@ -1,6 +1,8 @@ using System.Text; using HotChocolate; +#if NET8_0 using HotChocolate.Execution; +#endif using HotChocolate.Language; using HotChocolate.Types; using HotChocolate.Utilities; diff --git a/src/StrawberryShake/CodeGeneration/src/Directory.Build.props b/src/StrawberryShake/CodeGeneration/src/Directory.Build.props index bf0bb158c44..c6b2da658ca 100644 --- a/src/StrawberryShake/CodeGeneration/src/Directory.Build.props +++ b/src/StrawberryShake/CodeGeneration/src/Directory.Build.props @@ -2,7 +2,6 @@ - $(ToolingTargetFrameworks) $(NoWarn);CA1812 diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/InputGeneratorTests.cs b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/InputGeneratorTests.cs index 77b2664d1d4..72c24b16c7b 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/InputGeneratorTests.cs +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/InputGeneratorTests.cs @@ -53,7 +53,6 @@ input Bar { "extend schema @key(fields: \"id\")"); } -#if NET5_0 || NET6_0 [Fact] public void Operation_With_Comments_With_Input_Records() { @@ -81,7 +80,6 @@ input Bar { }", "extend schema @key(fields: \"id\")"); } -#endif [Fact] public void Input_Type_Fields_Are_Inspected_For_LeafTypes() diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/AnyScalarDefaultSerializationTest.Client.cs b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/AnyScalarDefaultSerializationTest.Client.cs index 62f42c202d9..07bbb65ca4a 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/AnyScalarDefaultSerializationTest.Client.cs +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/AnyScalarDefaultSerializationTest.Client.cs @@ -189,8 +189,33 @@ private GetJsonQueryDocument() public static GetJsonQueryDocument Instance { get; } = new GetJsonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x4a, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x6a, 0x73, 0x6f, 0x6e, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x4a, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x6a, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "90a00e07ca153decc5937eb356401940e7c6b66a"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -220,6 +245,7 @@ public GetJsonQuery(global::StrawberryShake.IOperationExecutor o } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetJsonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -305,6 +331,7 @@ public GetJsonResultFactory(global::StrawberryShake.IEntityStore entityStore) } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.AnyScalarDefaultSerialization.IGetJsonResult); + public GetJsonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -340,9 +367,9 @@ public GetJsonResultInfo(global::System.Text.Json.JsonElement json, global::Syst } public global::System.Text.Json.JsonElement Json { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetJsonResultInfo(Json, _entityIds, version); @@ -398,7 +425,9 @@ public GetJsonBuilder(global::StrawberryShake.IEntityStore entityStore, global:: public partial class AnyScalarDefaultSerializationClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/EntityIdOrDataTest.Client.cs b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/EntityIdOrDataTest.Client.cs index 43008ab3721..9b9dd5cff68 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/EntityIdOrDataTest.Client.cs +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/EntityIdOrDataTest.Client.cs @@ -519,8 +519,161 @@ private GetFooQueryDocument() public static GetFooQueryDocument Instance { get; } = new GetFooQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x51, 0x75, 0x6f, 0x78, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x32, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x51, 0x75, 0x6f, 0x78, 0x32, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x32, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x46, + 0x6f, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x51, + 0x75, + 0x6f, + 0x78, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x51, + 0x75, + 0x6f, + 0x78, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "43715bb5e8ecbe7659e99dcb33abcf1ffeadff8e"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -570,6 +723,7 @@ public GetFooQuery(global::StrawberryShake.IOperationExecutor ope } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetFooResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -703,6 +857,7 @@ public GetFooResultFactory(global::StrawberryShake.IEntityStore entityStore, glo } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.EntityIdOrData.IGetFooResult); + public GetFooResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -819,9 +974,9 @@ public GetFooResultInfo(global::System.Collections.Generic.IReadOnlyList? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetFooResultInfo(Foo, _entityIds, version); @@ -975,7 +1130,6 @@ public partial class QuoxData : IBarData } public global::System.String __typename { get; } - public global::System.String? Foo { get; } } @@ -990,7 +1144,6 @@ public partial class Quox2Data : IBarData } public global::System.String __typename { get; } - public global::System.String? Foo { get; } } @@ -1041,7 +1194,9 @@ public GetFoo_Foo_Baz2 Map(global::StrawberryShake.CodeGeneration.CSharp.Integra public partial class EntityIdOrDataClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/MultiProfileTest.Client.cs b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/MultiProfileTest.Client.cs index 55d8567b7b5..22e53efd4ee 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/MultiProfileTest.Client.cs +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/MultiProfileTest.Client.cs @@ -278,7 +278,6 @@ public GetHero_Hero_Droid(global::System.String name, global::StrawberryShake.Co } public global::System.String Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.MultiProfile.IGetHero_Hero_Friends? Friends { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Droid? other) @@ -348,7 +347,6 @@ public GetHero_Hero_Human(global::System.String name, global::StrawberryShake.Co } public global::System.String Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.MultiProfile.IGetHero_Hero_Friends? Friends { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Human? other) @@ -621,7 +619,6 @@ public partial interface IGetHeroResult public partial interface IGetHero_Hero { public global::System.String Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.MultiProfile.IGetHero_Hero_Friends? Friends { get; } } @@ -755,9 +752,7 @@ public OnReviewSub_OnReview_Review(global::System.String __typename, global::Sys /// The name of the current Object type at runtime. /// public global::System.String __typename { get; } - public global::System.Int32 Stars { get; } - public global::System.String? Commentary { get; } public virtual global::System.Boolean Equals(OnReviewSub_OnReview_Review? other) @@ -832,9 +827,7 @@ public partial interface IOnReviewSub_OnReview /// The name of the current Object type at runtime. /// public global::System.String __typename { get; } - public global::System.Int32 Stars { get; } - public global::System.String? Commentary { get; } } @@ -917,7 +910,6 @@ public CreateReviewMut_CreateReview_Review(global::System.Int32 stars, global::S } public global::System.Int32 Stars { get; } - public global::System.String? Commentary { get; } public virtual global::System.Boolean Equals(CreateReviewMut_CreateReview_Review? other) @@ -988,7 +980,6 @@ public partial interface ICreateReviewMutResult public partial interface ICreateReviewMut_CreateReview { public global::System.Int32 Stars { get; } - public global::System.String? Commentary { get; } } @@ -1005,6 +996,7 @@ public partial class ReviewInputInputValueFormatter : global::StrawberryShake.Se private global::StrawberryShake.Serialization.IInputValueFormatter _intFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _stringFormatter = default !; public global::System.String TypeName => "ReviewInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _intFormatter = serializerResolver.GetInputValueFormatter("Int"); @@ -1131,6 +1123,7 @@ public partial class ReviewInput : global::StrawberryShake.CodeGeneration.CSharp } global::System.Boolean global::StrawberryShake.CodeGeneration.CSharp.Integration.MultiProfile.State.IReviewInputInfo.IsStarsSet => _set_stars; + public global::System.String? Commentary { get => _value_commentary; @@ -1158,6 +1151,7 @@ public enum Episode public partial class EpisodeSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "Episode"; + public Episode Parse(global::System.String serializedValue) { return serializedValue switch @@ -1219,8 +1213,201 @@ private GetHeroQueryDocument() public static GetHeroQueryDocument Instance { get; } = new GetHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x7b, 0x20, 0x68, 0x65, 0x72, 0x6f, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x4e, 0x45, 0x57, 0x5f, 0x48, 0x4f, 0x50, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x68, + 0x65, + 0x72, + 0x6f, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x4e, + 0x45, + 0x57, + 0x5f, + 0x48, + 0x4f, + 0x50, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x66, + 0x72, + 0x69, + 0x65, + 0x6e, + 0x64, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x6f, + 0x64, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "9f9a72871b1548dfdb9e75702e81c5c5945ff0c3"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -1272,6 +1459,7 @@ public GetHeroQuery(global::StrawberryShake.IOperationExecutor o } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -1360,8 +1548,99 @@ private OnReviewSubSubscriptionDocument() public static OnReviewSubSubscriptionDocument Instance { get; } = new OnReviewSubSubscriptionDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Subscription; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x20, 0x7b, 0x20, 0x6f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x4e, 0x45, 0x57, 0x5f, 0x48, 0x4f, 0x50, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x74, 0x61, 0x72, 0x73, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x73, + 0x75, + 0x62, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x4f, + 0x6e, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x53, + 0x75, + 0x62, + 0x20, + 0x7b, + 0x20, + 0x6f, + 0x6e, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x4e, + 0x45, + 0x57, + 0x5f, + 0x48, + 0x4f, + 0x50, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x74, + 0x61, + 0x72, + 0x73, + 0x20, + 0x63, + 0x6f, + 0x6d, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x61, + 0x72, + 0x79, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "92220fce37342d7ade3d63a2a81342eb1fb14bac"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -1395,6 +1674,7 @@ public OnReviewSubSubscription(global::StrawberryShake.IOperationExecutor typeof(IOnReviewSubResult); + public global::System.IObservable> Watch(global::StrawberryShake.ExecutionStrategy? strategy = null) { var request = CreateRequest(); @@ -1458,8 +1738,163 @@ private CreateReviewMutMutationDocument() public static CreateReviewMutMutationDocument Instance { get; } = new CreateReviewMutMutationDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Mutation; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x4d, 0x75, 0x74, 0x28, 0x24, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x45, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x21, 0x2c, 0x20, 0x24, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x3a, 0x20, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x24, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x3a, 0x20, 0x24, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x74, 0x61, 0x72, 0x73, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x6d, + 0x75, + 0x74, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x43, + 0x72, + 0x65, + 0x61, + 0x74, + 0x65, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x4d, + 0x75, + 0x74, + 0x28, + 0x24, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x45, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x72, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x3a, + 0x20, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x63, + 0x72, + 0x65, + 0x61, + 0x74, + 0x65, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x2c, + 0x20, + 0x72, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x3a, + 0x20, + 0x24, + 0x72, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x74, + 0x61, + 0x72, + 0x73, + 0x20, + 0x63, + 0x6f, + 0x6d, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x61, + 0x72, + 0x79, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "7b7488dce3bce5700fe4fab0d349728a5121c153"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -1497,6 +1932,7 @@ public CreateReviewMutMutation(global::StrawberryShake.IOperationExecutor typeof(ICreateReviewMutResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::StrawberryShake.CodeGeneration.CSharp.Integration.MultiProfile.Episode episode, global::StrawberryShake.CodeGeneration.CSharp.Integration.MultiProfile.ReviewInput review, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(episode, review); @@ -1622,7 +2058,6 @@ public partial class DroidEntity } public global::System.String Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.MultiProfile.State.FriendsConnectionData? Friends { get; } } @@ -1637,7 +2072,6 @@ public partial class HumanEntity } public global::System.String Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.MultiProfile.State.FriendsConnectionData? Friends { get; } } @@ -1656,6 +2090,7 @@ public GetHeroResultFactory(global::StrawberryShake.IEntityStore entityStore, gl } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.MultiProfile.IGetHeroResult); + public GetHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -1711,9 +2146,9 @@ public GetHeroResultInfo(global::StrawberryShake.EntityId? hero, global::System. } public global::StrawberryShake.EntityId? Hero { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetHeroResultInfo(Hero, _entityIds, version); @@ -1731,6 +2166,7 @@ public OnReviewSubResultFactory(global::StrawberryShake.IEntityStore entityStore } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.MultiProfile.IOnReviewSubResult); + public OnReviewSubResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -1781,9 +2217,9 @@ public OnReviewSubResultInfo(global::StrawberryShake.CodeGeneration.CSharp.Integ } public global::StrawberryShake.CodeGeneration.CSharp.Integration.MultiProfile.State.ReviewData OnReview { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new OnReviewSubResultInfo(OnReview, _entityIds, version); @@ -1801,6 +2237,7 @@ public CreateReviewMutResultFactory(global::StrawberryShake.IEntityStore entityS } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.MultiProfile.ICreateReviewMutResult); + public CreateReviewMutResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -1851,9 +2288,9 @@ public CreateReviewMutResultInfo(global::StrawberryShake.CodeGeneration.CSharp.I } public global::StrawberryShake.CodeGeneration.CSharp.Integration.MultiProfile.State.ReviewData CreateReview { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new CreateReviewMutResultInfo(CreateReview, _entityIds, version); @@ -2240,7 +2677,6 @@ public partial class FriendsConnectionData } public global::System.String __typename { get; } - ///A flattened list of the nodes. public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } } @@ -2257,9 +2693,7 @@ public partial class ReviewData } public global::System.String __typename { get; } - public global::System.Int32? Stars { get; } - public global::System.String? Commentary { get; } } @@ -2472,7 +2906,9 @@ public GetHero_Hero_Friends_Nodes_Human Map(global::StrawberryShake.CodeGenerati public partial class MultiProfileClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetFriendsDeferInListTest.Client.cs b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetFriendsDeferInListTest.Client.cs index bfc36c028d0..dcb259cd6f6 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetFriendsDeferInListTest.Client.cs +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetFriendsDeferInListTest.Client.cs @@ -457,6 +457,7 @@ public GetHero_Hero_Friends_Nodes_Droid(ICharacterName? characterName) } public ICharacterName? CharacterName => _characterName; + public virtual global::System.Boolean Equals(GetHero_Hero_Friends_Nodes_Droid? other) { if (ReferenceEquals(null, other)) @@ -529,6 +530,7 @@ public GetHero_Hero_Friends_Nodes_Human(ICharacterName? characterName) } public ICharacterName? CharacterName => _characterName; + public virtual global::System.Boolean Equals(GetHero_Hero_Friends_Nodes_Human? other) { if (ReferenceEquals(null, other)) @@ -710,8 +712,323 @@ private GetHeroQueryDocument() public static GetHeroQueryDocument Instance { get; } = new GetHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x7b, 0x20, 0x68, 0x65, 0x72, 0x6f, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x4e, 0x45, 0x57, 0x5f, 0x48, 0x4f, 0x50, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x20, 0x40, 0x64, 0x65, 0x66, 0x65, 0x72, 0x28, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x29, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x20, 0x7b, 0x20, 0x5f, 0x69, 0x73, 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x46, 0x75, 0x6c, 0x66, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x3a, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x68, + 0x65, + 0x72, + 0x6f, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x4e, + 0x45, + 0x57, + 0x5f, + 0x48, + 0x4f, + 0x50, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x66, + 0x72, + 0x69, + 0x65, + 0x6e, + 0x64, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x6f, + 0x64, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x43, + 0x68, + 0x61, + 0x72, + 0x61, + 0x63, + 0x74, + 0x65, + 0x72, + 0x4e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x40, + 0x64, + 0x65, + 0x66, + 0x65, + 0x72, + 0x28, + 0x6c, + 0x61, + 0x62, + 0x65, + 0x6c, + 0x3a, + 0x20, + 0x22, + 0x43, + 0x68, + 0x61, + 0x72, + 0x61, + 0x63, + 0x74, + 0x65, + 0x72, + 0x4e, + 0x61, + 0x6d, + 0x65, + 0x22, + 0x29, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x43, + 0x68, + 0x61, + 0x72, + 0x61, + 0x63, + 0x74, + 0x65, + 0x72, + 0x4e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x43, + 0x68, + 0x61, + 0x72, + 0x61, + 0x63, + 0x74, + 0x65, + 0x72, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x69, + 0x73, + 0x43, + 0x68, + 0x61, + 0x72, + 0x61, + 0x63, + 0x74, + 0x65, + 0x72, + 0x4e, + 0x61, + 0x6d, + 0x65, + 0x46, + 0x75, + 0x6c, + 0x66, + 0x69, + 0x6c, + 0x6c, + 0x65, + 0x64, + 0x3a, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "ba8d6a590e0613253d74fddd5868d5128efd3185"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -767,6 +1084,7 @@ public GetHeroQuery(global::StrawberryShake.IOperationExecutor o } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -879,9 +1197,7 @@ public partial class DroidEntity } public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetFriendsDeferInList.State.FriendsConnectionData? Friends { get; } - public global::System.Boolean IsCharacterNameFulfilled { get; } - public global::System.String Name { get; } } @@ -897,9 +1213,7 @@ public partial class HumanEntity } public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetFriendsDeferInList.State.FriendsConnectionData? Friends { get; } - public global::System.Boolean IsCharacterNameFulfilled { get; } - public global::System.String Name { get; } } @@ -918,6 +1232,7 @@ public GetHeroResultFactory(global::StrawberryShake.IEntityStore entityStore, gl } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetFriendsDeferInList.IGetHeroResult); + public GetHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -973,9 +1288,9 @@ public GetHeroResultInfo(global::StrawberryShake.EntityId? hero, global::System. } public global::StrawberryShake.EntityId? Hero { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetHeroResultInfo(Hero, _entityIds, version); @@ -1172,7 +1487,6 @@ public partial class FriendsConnectionData } public global::System.String __typename { get; } - ///A flattened list of the nodes. public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } } @@ -1452,7 +1766,9 @@ public CharacterName Map(global::StrawberryShake.CodeGeneration.CSharp.Integrati public partial class StarWarsGetFriendsDeferInListClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetFriendsDeferredTest.Client.cs b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetFriendsDeferredTest.Client.cs index 0003d00bbe4..d57c4b0f98c 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetFriendsDeferredTest.Client.cs +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetFriendsDeferredTest.Client.cs @@ -252,8 +252,8 @@ public GetHero_Hero_Droid(global::System.String name, IFriendsList? friendsListL } public global::System.String Name { get; } - public IFriendsList? FriendsListLabel => _friendsListLabel; + public virtual global::System.Boolean Equals(GetHero_Hero_Droid? other) { if (ReferenceEquals(null, other)) @@ -328,8 +328,8 @@ public GetHero_Hero_Human(global::System.String name, IFriendsList? friendsListL } public global::System.String Name { get; } - public IFriendsList? FriendsListLabel => _friendsListLabel; + public virtual global::System.Boolean Equals(GetHero_Hero_Human? other) { if (ReferenceEquals(null, other)) @@ -613,7 +613,6 @@ public partial interface IFriendsList public partial interface IGetHero_Hero { public global::System.String Name { get; } - public IFriendsList? FriendsListLabel { get; } } @@ -717,8 +716,325 @@ private GetHeroQueryDocument() public static GetHeroQueryDocument Instance { get; } = new GetHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x7b, 0x20, 0x68, 0x65, 0x72, 0x6f, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x4e, 0x45, 0x57, 0x5f, 0x48, 0x4f, 0x50, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x40, 0x64, 0x65, 0x66, 0x65, 0x72, 0x28, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x22, 0x29, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x6e, 0x20, 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x20, 0x7b, 0x20, 0x5f, 0x69, 0x73, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x75, 0x6c, 0x66, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x3a, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x68, + 0x65, + 0x72, + 0x6f, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x4e, + 0x45, + 0x57, + 0x5f, + 0x48, + 0x4f, + 0x50, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x46, + 0x72, + 0x69, + 0x65, + 0x6e, + 0x64, + 0x73, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x20, + 0x40, + 0x64, + 0x65, + 0x66, + 0x65, + 0x72, + 0x28, + 0x6c, + 0x61, + 0x62, + 0x65, + 0x6c, + 0x3a, + 0x20, + 0x22, + 0x46, + 0x72, + 0x69, + 0x65, + 0x6e, + 0x64, + 0x73, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x4c, + 0x61, + 0x62, + 0x65, + 0x6c, + 0x22, + 0x29, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x46, + 0x72, + 0x69, + 0x65, + 0x6e, + 0x64, + 0x73, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x43, + 0x68, + 0x61, + 0x72, + 0x61, + 0x63, + 0x74, + 0x65, + 0x72, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x69, + 0x73, + 0x46, + 0x72, + 0x69, + 0x65, + 0x6e, + 0x64, + 0x73, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x46, + 0x75, + 0x6c, + 0x66, + 0x69, + 0x6c, + 0x6c, + 0x65, + 0x64, + 0x3a, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x66, + 0x72, + 0x69, + 0x65, + 0x6e, + 0x64, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x6f, + 0x64, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "14694ab081258c7d8f3467f90c31653193237401"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -775,6 +1091,7 @@ public GetHeroQuery(global::StrawberryShake.IOperationExecutor o } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -888,9 +1205,7 @@ public partial class DroidEntity } public global::System.String Name { get; } - public global::System.Boolean IsFriendsListFulfilled { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetFriendsDeferred.State.FriendsConnectionData? Friends { get; } } @@ -906,9 +1221,7 @@ public partial class HumanEntity } public global::System.String Name { get; } - public global::System.Boolean IsFriendsListFulfilled { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetFriendsDeferred.State.FriendsConnectionData? Friends { get; } } @@ -927,6 +1240,7 @@ public GetHeroResultFactory(global::StrawberryShake.IEntityStore entityStore, gl } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetFriendsDeferred.IGetHeroResult); + public GetHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -982,9 +1296,9 @@ public GetHeroResultInfo(global::StrawberryShake.EntityId? hero, global::System. } public global::StrawberryShake.EntityId? Hero { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetHeroResultInfo(Hero, _entityIds, version); @@ -1181,7 +1495,6 @@ public partial class FriendsConnectionData } public global::System.String __typename { get; } - ///A flattened list of the nodes. public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } } @@ -1461,7 +1774,9 @@ public GetHero_Hero_Friends_Nodes_Human Map(global::StrawberryShake.CodeGenerati public partial class StarWarsGetFriendsDeferredClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetFriendsNoStoreTest.Client.cs b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetFriendsNoStoreTest.Client.cs index 4ad72c48512..1827aa8f867 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetFriendsNoStoreTest.Client.cs +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetFriendsNoStoreTest.Client.cs @@ -176,7 +176,6 @@ public GetHero_Hero_Droid(global::System.String name, global::StrawberryShake.Co } public global::System.String Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetFriendsNoStore.IGetHero_Hero_Friends? Friends { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Droid? other) @@ -246,7 +245,6 @@ public GetHero_Hero_Human(global::System.String name, global::StrawberryShake.Co } public global::System.String Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetFriendsNoStore.IGetHero_Hero_Friends? Friends { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Human? other) @@ -519,7 +517,6 @@ public partial interface IGetHeroResult public partial interface IGetHero_Hero { public global::System.String Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetFriendsNoStore.IGetHero_Hero_Friends? Friends { get; } } @@ -604,8 +601,121 @@ private GetHeroQueryDocument() public static GetHeroQueryDocument Instance { get; } = new GetHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x7b, 0x20, 0x68, 0x65, 0x72, 0x6f, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x4e, 0x45, 0x57, 0x5f, 0x48, 0x4f, 0x50, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x68, + 0x65, + 0x72, + 0x6f, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x4e, + 0x45, + 0x57, + 0x5f, + 0x48, + 0x4f, + 0x50, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x66, + 0x72, + 0x69, + 0x65, + 0x6e, + 0x64, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x6f, + 0x64, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "e420a6956d7dd75be7471b2fc1d22df41d4c6985"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -645,6 +755,7 @@ public GetHeroQuery(global::StrawberryShake.IOperationExecutor o } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -738,6 +849,7 @@ public GetHeroResultFactory() } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetFriendsNoStore.IGetHeroResult); + public GetHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (dataInfo is GetHeroResultInfo info) @@ -848,9 +960,9 @@ public GetHeroResultInfo(global::StrawberryShake.CodeGeneration.CSharp.Integrati } public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetFriendsNoStore.State.ICharacterData? Hero { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => global::System.Array.Empty(); public global::System.UInt64 Version => 0; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetHeroResultInfo(Hero); @@ -985,9 +1097,7 @@ public partial class DroidData : ISearchResultData, ICharacterData } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetFriendsNoStore.State.FriendsConnectionData? Friends { get; } } @@ -1003,9 +1113,7 @@ public partial class HumanData : ISearchResultData, ICharacterData } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetFriendsNoStore.State.FriendsConnectionData? Friends { get; } } @@ -1021,7 +1129,6 @@ public partial class FriendsConnectionData } public global::System.String __typename { get; } - ///A flattened list of the nodes. public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } } @@ -1033,6 +1140,7 @@ public partial class StarWarsGetFriendsNoStoreClientStoreAccessor : global::Stra public global::StrawberryShake.IOperationStore OperationStore => throw new global::System.NotSupportedException("OperationStore is not supported in store less mode"); public global::StrawberryShake.IEntityStore EntityStore => throw new global::System.NotSupportedException("EntityStore is not supported in store less mode"); public global::StrawberryShake.IEntityIdSerializer EntityIdSerializer => throw new global::System.NotSupportedException("EntityIdSerializer is not supported in store less mode"); + public global::StrawberryShake.IOperationRequestFactory GetOperationRequestFactory(global::System.Type resultType) { throw new global::System.NotSupportedException("GetOperationRequestFactory is not supported in store less mode"); diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetFriendsTest.Client.cs b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetFriendsTest.Client.cs index fc08c657afb..69738c9eb3d 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetFriendsTest.Client.cs +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetFriendsTest.Client.cs @@ -183,7 +183,6 @@ public GetHero_Hero_Droid(global::System.String name, global::StrawberryShake.Co } public global::System.String Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetFriends.IGetHero_Hero_Friends? Friends { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Droid? other) @@ -253,7 +252,6 @@ public GetHero_Hero_Human(global::System.String name, global::StrawberryShake.Co } public global::System.String Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetFriends.IGetHero_Hero_Friends? Friends { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Human? other) @@ -526,7 +524,6 @@ public partial interface IGetHeroResult public partial interface IGetHero_Hero { public global::System.String Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetFriends.IGetHero_Hero_Friends? Friends { get; } } @@ -623,8 +620,201 @@ private GetHeroQueryDocument() public static GetHeroQueryDocument Instance { get; } = new GetHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x7b, 0x20, 0x68, 0x65, 0x72, 0x6f, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x4e, 0x45, 0x57, 0x5f, 0x48, 0x4f, 0x50, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x68, + 0x65, + 0x72, + 0x6f, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x4e, + 0x45, + 0x57, + 0x5f, + 0x48, + 0x4f, + 0x50, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x66, + 0x72, + 0x69, + 0x65, + 0x6e, + 0x64, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x6f, + 0x64, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "9f9a72871b1548dfdb9e75702e81c5c5945ff0c3"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -676,6 +866,7 @@ public GetHeroQuery(global::StrawberryShake.IOperationExecutor o } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -783,7 +974,6 @@ public partial class DroidEntity } public global::System.String Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetFriends.State.FriendsConnectionData? Friends { get; } } @@ -798,7 +988,6 @@ public partial class HumanEntity } public global::System.String Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetFriends.State.FriendsConnectionData? Friends { get; } } @@ -817,6 +1006,7 @@ public GetHeroResultFactory(global::StrawberryShake.IEntityStore entityStore, gl } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetFriends.IGetHeroResult); + public GetHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -872,9 +1062,9 @@ public GetHeroResultInfo(global::StrawberryShake.EntityId? hero, global::System. } public global::StrawberryShake.EntityId? Hero { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetHeroResultInfo(Hero, _entityIds, version); @@ -1071,7 +1261,6 @@ public partial class FriendsConnectionData } public global::System.String __typename { get; } - ///A flattened list of the nodes. public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } } @@ -1285,7 +1474,9 @@ public GetHero_Hero_Friends_Nodes_Human Map(global::StrawberryShake.CodeGenerati public partial class StarWarsGetFriendsClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetHeroTest.Client.cs b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetHeroTest.Client.cs index 9e1f103d79b..ef0deaf393c 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetHeroTest.Client.cs +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetHeroTest.Client.cs @@ -347,8 +347,112 @@ private GetHeroQueryDocument() public static GetHeroQueryDocument Instance { get; } = new GetHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x7b, 0x20, 0x68, 0x65, 0x72, 0x6f, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x4e, 0x45, 0x57, 0x5f, 0x48, 0x4f, 0x50, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x68, + 0x65, + 0x72, + 0x6f, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x4e, + 0x45, + 0x57, + 0x5f, + 0x48, + 0x4f, + 0x50, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "95ca68547e3a55b9ff81efe79b33a417b2f0690b"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -387,6 +491,7 @@ public GetHeroQuery(global::StrawberryShake.IOperationExecutor o } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -509,6 +614,7 @@ public GetHeroResultFactory(global::StrawberryShake.IEntityStore entityStore, gl } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHero.IGetHeroResult); + public GetHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -564,9 +670,9 @@ public GetHeroResultInfo(global::StrawberryShake.EntityId? hero, global::System. } public global::StrawberryShake.EntityId? Hero { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetHeroResultInfo(Hero, _entityIds, version); @@ -711,7 +817,9 @@ public GetHero_Hero_Human Map(global::StrawberryShake.CodeGeneration.CSharp.Inte public partial class StarWarsGetHeroClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetHeroTraitsTest.Client.cs b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetHeroTraitsTest.Client.cs index a37e546f4db..9480da62373 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetHeroTraitsTest.Client.cs +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsGetHeroTraitsTest.Client.cs @@ -182,7 +182,6 @@ public GetHero_Hero_Droid(global::System.String name, global::System.Text.Json.J } public global::System.String Name { get; } - public global::System.Text.Json.JsonElement? Traits { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Droid? other) @@ -252,7 +251,6 @@ public GetHero_Hero_Human(global::System.String name, global::System.Text.Json.J } public global::System.String Name { get; } - public global::System.Text.Json.JsonElement? Traits { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Human? other) @@ -323,7 +321,6 @@ public partial interface IGetHeroResult public partial interface IGetHero_Hero { public global::System.String Name { get; } - public global::System.Text.Json.JsonElement? Traits { get; } } @@ -367,8 +364,119 @@ private GetHeroQueryDocument() public static GetHeroQueryDocument Instance { get; } = new GetHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x7b, 0x20, 0x68, 0x65, 0x72, 0x6f, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x4e, 0x45, 0x57, 0x5f, 0x48, 0x4f, 0x50, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x68, + 0x65, + 0x72, + 0x6f, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x4e, + 0x45, + 0x57, + 0x5f, + 0x48, + 0x4f, + 0x50, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x74, + 0x72, + 0x61, + 0x69, + 0x74, + 0x73, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "87d584157181184f5ad4cb20798faf6281838dd3"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -408,6 +516,7 @@ public GetHeroQuery(global::StrawberryShake.IOperationExecutor o } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -503,7 +612,6 @@ public partial class DroidEntity } public global::System.String Name { get; } - public global::System.Text.Json.JsonElement? Traits { get; } } @@ -518,7 +626,6 @@ public partial class HumanEntity } public global::System.String Name { get; } - public global::System.Text.Json.JsonElement? Traits { get; } } @@ -537,6 +644,7 @@ public GetHeroResultFactory(global::StrawberryShake.IEntityStore entityStore, gl } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroTraits.IGetHeroResult); + public GetHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -592,9 +700,9 @@ public GetHeroResultInfo(global::StrawberryShake.EntityId? hero, global::System. } public global::StrawberryShake.EntityId? Hero { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetHeroResultInfo(Hero, _entityIds, version); @@ -756,7 +864,9 @@ public GetHero_Hero_Human Map(global::StrawberryShake.CodeGeneration.CSharp.Inte public partial class StarWarsGetHeroTraitsClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsIntrospectionTest.Client.cs b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsIntrospectionTest.Client.cs index 53052e60421..e078cbea5e2 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsIntrospectionTest.Client.cs +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsIntrospectionTest.Client.cs @@ -188,22 +188,18 @@ public IntrospectionQuery___schema___Schema(global::StrawberryShake.CodeGenerati /// The type that query operations will be rooted at. /// public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_QueryType QueryType { get; } - /// /// If this server supports mutation, the type that mutation operations will be rooted at. /// public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_MutationType? MutationType { get; } - /// /// If this server support subscription, the type that subscription operations will be rooted at. /// public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_SubscriptionType? SubscriptionType { get; } - /// /// A list of all types supported by this server. /// public global::System.Collections.Generic.IReadOnlyList Types { get; } - /// /// A list of all directives supported by this server. /// @@ -515,19 +511,12 @@ public IntrospectionQuery___schema_Types___Type(global::StrawberryShake.CodeGene } public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::System.String? Description { get; } - public global::System.Collections.Generic.IReadOnlyList? Fields { get; } - public global::System.Collections.Generic.IReadOnlyList? InputFields { get; } - public global::System.Collections.Generic.IReadOnlyList? Interfaces { get; } - public global::System.Collections.Generic.IReadOnlyList? EnumValues { get; } - public global::System.Collections.Generic.IReadOnlyList? PossibleTypes { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types___Type? other) @@ -651,15 +640,10 @@ public IntrospectionQuery___schema_Directives___Directive(global::System.String } public global::System.String Name { get; } - public global::System.String? Description { get; } - public global::System.Collections.Generic.IReadOnlyList Args { get; } - public global::System.Boolean OnOperation { get; } - public global::System.Boolean OnFragment { get; } - public global::System.Boolean OnField { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Directives___Directive? other) @@ -744,15 +728,10 @@ public IntrospectionQuery___schema_Types_Fields___Field(global::System.String na } public global::System.String Name { get; } - public global::System.String? Description { get; } - public global::System.Collections.Generic.IReadOnlyList Args { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_Fields_Type Type { get; } - public global::System.Boolean IsDeprecated { get; } - public global::System.String? DeprecationReason { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_Fields___Field? other) @@ -839,11 +818,8 @@ public IntrospectionQuery___schema_Types_InputFields___InputValue(global::System } public global::System.String Name { get; } - public global::System.String? Description { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_InputFields_Type Type { get; } - /// /// A GraphQL-formatted string representing the default value for this input value. /// @@ -928,9 +904,7 @@ public IntrospectionQuery___schema_Types_Interfaces___Type(global::StrawberrySha } public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_Interfaces_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_Interfaces___Type? other) @@ -1010,11 +984,8 @@ public IntrospectionQuery___schema_Types_EnumValues___EnumValue(global::System.S } public global::System.String Name { get; } - public global::System.String? Description { get; } - public global::System.Boolean IsDeprecated { get; } - public global::System.String? DeprecationReason { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_EnumValues___EnumValue? other) @@ -1096,9 +1067,7 @@ public IntrospectionQuery___schema_Types_PossibleTypes___Type(global::Strawberry } public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_Interfaces_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_PossibleTypes___Type? other) @@ -1178,11 +1147,8 @@ public IntrospectionQuery___schema_Directives_Args___InputValue(global::System.S } public global::System.String Name { get; } - public global::System.String? Description { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_InputFields_Type Type { get; } - /// /// A GraphQL-formatted string representing the default value for this input value. /// @@ -1266,11 +1232,8 @@ public IntrospectionQuery___schema_Types_Fields_Args___InputValue(global::System } public global::System.String Name { get; } - public global::System.String? Description { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_InputFields_Type Type { get; } - /// /// A GraphQL-formatted string representing the default value for this input value. /// @@ -1355,9 +1318,7 @@ public IntrospectionQuery___schema_Types_Fields_Type___Type(global::StrawberrySh } public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_Interfaces_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_Fields_Type___Type? other) @@ -1438,9 +1399,7 @@ public IntrospectionQuery___schema_Types_InputFields_Type___Type(global::Strawbe } public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_Interfaces_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_InputFields_Type___Type? other) @@ -1521,9 +1480,7 @@ public IntrospectionQuery___schema_Types_Interfaces_OfType___Type(global::Strawb } public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_Interfaces_OfType___Type? other) @@ -1604,9 +1561,7 @@ public IntrospectionQuery___schema_Types_PossibleTypes_OfType___Type(global::Str } public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_PossibleTypes_OfType___Type? other) @@ -1687,9 +1642,7 @@ public IntrospectionQuery___schema_Directives_Args_Type___Type(global::Strawberr } public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_Interfaces_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Directives_Args_Type___Type? other) @@ -1770,9 +1723,7 @@ public IntrospectionQuery___schema_Types_Fields_Args_Type___Type(global::Strawbe } public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_Interfaces_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_Fields_Args_Type___Type? other) @@ -1853,9 +1804,7 @@ public IntrospectionQuery___schema_Types_Fields_Type_OfType___Type(global::Straw } public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_Fields_Type_OfType___Type? other) @@ -1936,9 +1885,7 @@ public IntrospectionQuery___schema_Types_InputFields_Type_OfType___Type(global:: } public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_InputFields_Type_OfType___Type? other) @@ -2019,9 +1966,7 @@ public IntrospectionQuery___schema_Types_Interfaces_OfType_OfType___Type(global: } public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_Interfaces_OfType_OfType___Type? other) @@ -2101,7 +2046,6 @@ public IntrospectionQuery___schema_Types_Interfaces_OfType_OfType_OfType___Type( } public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind Kind { get; } - public global::System.String? Name { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_Interfaces_OfType_OfType_OfType___Type? other) @@ -2181,22 +2125,18 @@ public partial interface IIntrospectionQuery___schema /// The type that query operations will be rooted at. /// public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_QueryType QueryType { get; } - /// /// If this server supports mutation, the type that mutation operations will be rooted at. /// public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_MutationType? MutationType { get; } - /// /// If this server support subscription, the type that subscription operations will be rooted at. /// public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_SubscriptionType? SubscriptionType { get; } - /// /// A list of all types supported by this server. /// public global::System.Collections.Generic.IReadOnlyList Types { get; } - /// /// A list of all directives supported by this server. /// @@ -2291,19 +2231,12 @@ public partial interface IIntrospectionQuery___schema_SubscriptionType___Type : public partial interface IFullType { public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::System.String? Description { get; } - public global::System.Collections.Generic.IReadOnlyList? Fields { get; } - public global::System.Collections.Generic.IReadOnlyList? InputFields { get; } - public global::System.Collections.Generic.IReadOnlyList? Interfaces { get; } - public global::System.Collections.Generic.IReadOnlyList? EnumValues { get; } - public global::System.Collections.Generic.IReadOnlyList? PossibleTypes { get; } } @@ -2339,15 +2272,10 @@ public partial interface IIntrospectionQuery___schema_Types___Type : IIntrospect public partial interface IIntrospectionQuery___schema_Directives { public global::System.String Name { get; } - public global::System.String? Description { get; } - public global::System.Collections.Generic.IReadOnlyList Args { get; } - public global::System.Boolean OnOperation { get; } - public global::System.Boolean OnFragment { get; } - public global::System.Boolean OnField { get; } } @@ -2370,15 +2298,10 @@ public partial interface IIntrospectionQuery___schema_Directives___Directive : I public partial interface IIntrospectionQuery___schema_Types_Fields { public global::System.String Name { get; } - public global::System.String? Description { get; } - public global::System.Collections.Generic.IReadOnlyList Args { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_Fields_Type Type { get; } - public global::System.Boolean IsDeprecated { get; } - public global::System.String? DeprecationReason { get; } } @@ -2399,11 +2322,8 @@ public partial interface IIntrospectionQuery___schema_Types_Fields___Field : IIn public partial interface IInputValue { public global::System.String Name { get; } - public global::System.String? Description { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_InputFields_Type Type { get; } - /// /// A GraphQL-formatted string representing the default value for this input value. /// @@ -2438,9 +2358,7 @@ public partial interface IIntrospectionQuery___schema_Types_InputFields___InputV public partial interface ITypeRef { public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_Interfaces_OfType? OfType { get; } } @@ -2474,11 +2392,8 @@ public partial interface IIntrospectionQuery___schema_Types_Interfaces___Type : public partial interface IIntrospectionQuery___schema_Types_EnumValues { public global::System.String Name { get; } - public global::System.String? Description { get; } - public global::System.Boolean IsDeprecated { get; } - public global::System.String? DeprecationReason { get; } } @@ -2603,9 +2518,7 @@ public partial interface IIntrospectionQuery___schema_Types_InputFields_Type___T public partial interface IIntrospectionQuery___schema_Types_Interfaces_OfType { public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType? OfType { get; } } @@ -2630,9 +2543,7 @@ public partial interface IIntrospectionQuery___schema_Types_Interfaces_OfType___ public partial interface IIntrospectionQuery___schema_Types_PossibleTypes_OfType { public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType? OfType { get; } } @@ -2701,9 +2612,7 @@ public partial interface IIntrospectionQuery___schema_Types_Fields_Args_Type___T public partial interface IIntrospectionQuery___schema_Types_Fields_Type_OfType { public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType? OfType { get; } } @@ -2728,9 +2637,7 @@ public partial interface IIntrospectionQuery___schema_Types_Fields_Type_OfType__ public partial interface IIntrospectionQuery___schema_Types_InputFields_Type_OfType { public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType? OfType { get; } } @@ -2755,9 +2662,7 @@ public partial interface IIntrospectionQuery___schema_Types_InputFields_Type_OfT public partial interface IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType { public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType_OfType? OfType { get; } } @@ -2782,7 +2687,6 @@ public partial interface IIntrospectionQuery___schema_Types_Interfaces_OfType_Of public partial interface IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType_OfType { public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind Kind { get; } - public global::System.String? Name { get; } } @@ -2843,6 +2747,7 @@ public enum __TypeKind public partial class __TypeKindSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "__TypeKind"; + public __TypeKind Parse(global::System.String serializedValue) { return serializedValue switch @@ -2992,8 +2897,981 @@ private IntrospectionQueryQueryDocument() public static IntrospectionQueryQueryDocument Instance { get; } = new IntrospectionQueryQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x49, 0x6e, 0x74, 0x72, 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x71, 0x75, 0x65, 0x72, 0x79, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x46, 0x75, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7d, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x7d, 0x20, 0x6f, 0x6e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x46, 0x75, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x5f, 0x5f, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x6b, 0x69, 0x6e, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x28, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x3a, 0x20, 0x74, 0x72, 0x75, 0x65, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x7d, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x66, 0x20, 0x7d, 0x20, 0x69, 0x73, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x20, 0x7d, 0x20, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x7d, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x66, 0x20, 0x7d, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x28, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x3a, 0x20, 0x74, 0x72, 0x75, 0x65, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x20, 0x7d, 0x20, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x66, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x5f, 0x5f, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x66, 0x20, 0x7d, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x66, 0x20, 0x6f, 0x6e, 0x20, 0x5f, 0x5f, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x6b, 0x69, 0x6e, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6b, 0x69, 0x6e, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6b, 0x69, 0x6e, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6b, 0x69, 0x6e, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x49, + 0x6e, + 0x74, + 0x72, + 0x6f, + 0x73, + 0x70, + 0x65, + 0x63, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x51, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x73, + 0x63, + 0x68, + 0x65, + 0x6d, + 0x61, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x6d, + 0x75, + 0x74, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x73, + 0x75, + 0x62, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x74, + 0x79, + 0x70, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x46, + 0x75, + 0x6c, + 0x6c, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x64, + 0x69, + 0x72, + 0x65, + 0x63, + 0x74, + 0x69, + 0x76, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x64, + 0x65, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x61, + 0x72, + 0x67, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x56, + 0x61, + 0x6c, + 0x75, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x6f, + 0x6e, + 0x4f, + 0x70, + 0x65, + 0x72, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x6f, + 0x6e, + 0x46, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x6f, + 0x6e, + 0x46, + 0x69, + 0x65, + 0x6c, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x46, + 0x75, + 0x6c, + 0x6c, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x5f, + 0x5f, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x6b, + 0x69, + 0x6e, + 0x64, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x64, + 0x65, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x66, + 0x69, + 0x65, + 0x6c, + 0x64, + 0x73, + 0x28, + 0x69, + 0x6e, + 0x63, + 0x6c, + 0x75, + 0x64, + 0x65, + 0x44, + 0x65, + 0x70, + 0x72, + 0x65, + 0x63, + 0x61, + 0x74, + 0x65, + 0x64, + 0x3a, + 0x20, + 0x74, + 0x72, + 0x75, + 0x65, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x64, + 0x65, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x61, + 0x72, + 0x67, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x56, + 0x61, + 0x6c, + 0x75, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x74, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x54, + 0x79, + 0x70, + 0x65, + 0x52, + 0x65, + 0x66, + 0x20, + 0x7d, + 0x20, + 0x69, + 0x73, + 0x44, + 0x65, + 0x70, + 0x72, + 0x65, + 0x63, + 0x61, + 0x74, + 0x65, + 0x64, + 0x20, + 0x64, + 0x65, + 0x70, + 0x72, + 0x65, + 0x63, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x52, + 0x65, + 0x61, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7d, + 0x20, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x46, + 0x69, + 0x65, + 0x6c, + 0x64, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x56, + 0x61, + 0x6c, + 0x75, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x69, + 0x6e, + 0x74, + 0x65, + 0x72, + 0x66, + 0x61, + 0x63, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x54, + 0x79, + 0x70, + 0x65, + 0x52, + 0x65, + 0x66, + 0x20, + 0x7d, + 0x20, + 0x65, + 0x6e, + 0x75, + 0x6d, + 0x56, + 0x61, + 0x6c, + 0x75, + 0x65, + 0x73, + 0x28, + 0x69, + 0x6e, + 0x63, + 0x6c, + 0x75, + 0x64, + 0x65, + 0x44, + 0x65, + 0x70, + 0x72, + 0x65, + 0x63, + 0x61, + 0x74, + 0x65, + 0x64, + 0x3a, + 0x20, + 0x74, + 0x72, + 0x75, + 0x65, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x64, + 0x65, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x69, + 0x73, + 0x44, + 0x65, + 0x70, + 0x72, + 0x65, + 0x63, + 0x61, + 0x74, + 0x65, + 0x64, + 0x20, + 0x64, + 0x65, + 0x70, + 0x72, + 0x65, + 0x63, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x52, + 0x65, + 0x61, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7d, + 0x20, + 0x70, + 0x6f, + 0x73, + 0x73, + 0x69, + 0x62, + 0x6c, + 0x65, + 0x54, + 0x79, + 0x70, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x54, + 0x79, + 0x70, + 0x65, + 0x52, + 0x65, + 0x66, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x56, + 0x61, + 0x6c, + 0x75, + 0x65, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x5f, + 0x5f, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x56, + 0x61, + 0x6c, + 0x75, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x64, + 0x65, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x74, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x54, + 0x79, + 0x70, + 0x65, + 0x52, + 0x65, + 0x66, + 0x20, + 0x7d, + 0x20, + 0x64, + 0x65, + 0x66, + 0x61, + 0x75, + 0x6c, + 0x74, + 0x56, + 0x61, + 0x6c, + 0x75, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x54, + 0x79, + 0x70, + 0x65, + 0x52, + 0x65, + 0x66, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x5f, + 0x5f, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x6b, + 0x69, + 0x6e, + 0x64, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6f, + 0x66, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6b, + 0x69, + 0x6e, + 0x64, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6f, + 0x66, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6b, + 0x69, + 0x6e, + 0x64, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6f, + 0x66, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6b, + 0x69, + 0x6e, + 0x64, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "5902e9f9fd92bc2e9785f0821db6ff925e660fde"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -3123,6 +4001,7 @@ public IntrospectionQueryQuery(global::StrawberryShake.IOperationExecutor typeof(IIntrospectionQueryResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -3308,6 +4187,7 @@ public IntrospectionQueryResultFactory(global::StrawberryShake.IEntityStore enti } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.IIntrospectionQueryResult); + public IntrospectionQueryResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -3785,9 +4665,9 @@ public IntrospectionQueryResultInfo(global::StrawberryShake.CodeGeneration.CShar /// Access the current type schema of this server. /// public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.State.__SchemaData __schema { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new IntrospectionQueryResultInfo(__schema, _entityIds, version); @@ -4470,19 +5350,14 @@ public partial class __SchemaData } public global::System.String __typename { get; } - ///The type that query operations will be rooted at. public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.State.__TypeData? QueryType { get; } - ///If this server supports mutation, the type that mutation operations will be rooted at. public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.State.__TypeData? MutationType { get; } - ///If this server support subscription, the type that subscription operations will be rooted at. public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.State.__TypeData? SubscriptionType { get; } - ///A list of all types supported by this server. public global::System.Collections.Generic.IReadOnlyList? Types { get; } - ///A list of all directives supported by this server. public global::System.Collections.Generic.IReadOnlyList? Directives { get; } } @@ -4507,23 +5382,14 @@ public partial class __TypeData } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.__TypeKind? Kind { get; } - public global::System.String? Description { get; } - public global::System.Collections.Generic.IReadOnlyList? Fields { get; } - public global::System.Collections.Generic.IReadOnlyList? InputFields { get; } - public global::System.Collections.Generic.IReadOnlyList? Interfaces { get; } - public global::System.Collections.Generic.IReadOnlyList? EnumValues { get; } - public global::System.Collections.Generic.IReadOnlyList? PossibleTypes { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.State.__TypeData? OfType { get; } } @@ -4544,17 +5410,11 @@ public partial class __DirectiveData } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.String? Description { get; } - public global::System.Collections.Generic.IReadOnlyList? Args { get; } - public global::System.Boolean? OnOperation { get; } - public global::System.Boolean? OnFragment { get; } - public global::System.Boolean? OnField { get; } } @@ -4575,17 +5435,11 @@ public partial class __FieldData } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.String? Description { get; } - public global::System.Collections.Generic.IReadOnlyList? Args { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.State.__TypeData? Type { get; } - public global::System.Boolean? IsDeprecated { get; } - public global::System.String? DeprecationReason { get; } } @@ -4604,13 +5458,9 @@ public partial class __InputValueData } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.String? Description { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsIntrospection.State.__TypeData? Type { get; } - ///A GraphQL-formatted string representing the default value for this input value. public global::System.String? DefaultValue { get; } } @@ -4630,13 +5480,9 @@ public partial class __EnumValueData } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.String? Description { get; } - public global::System.Boolean? IsDeprecated { get; } - public global::System.String? DeprecationReason { get; } } @@ -4645,7 +5491,9 @@ public partial class __EnumValueData public partial class StarWarsIntrospectionClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsIntrospectionTest.cs b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsIntrospectionTest.cs index 58fc3d285a9..33c9963b0c3 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsIntrospectionTest.cs +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsIntrospectionTest.cs @@ -34,11 +34,7 @@ public async Task Execute_StarWarsIntrospection_Test() var result = await client.IntrospectionQuery.ExecuteAsync(ct); // assert -#if NET7_0_OR_GREATER result.MatchSnapshot(); -#else - result.MatchSnapshot("NET6"); -#endif } } } diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsOnReviewSubCompletionTest.Client.cs b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsOnReviewSubCompletionTest.Client.cs index 9c35c5ea9b1..0e10f9080dd 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsOnReviewSubCompletionTest.Client.cs +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsOnReviewSubCompletionTest.Client.cs @@ -227,9 +227,7 @@ public OnReviewSub_OnReview_Review(global::System.String __typename, global::Sys /// The name of the current Object type at runtime. /// public global::System.String __typename { get; } - public global::System.Int32 Stars { get; } - public global::System.String? Commentary { get; } public virtual global::System.Boolean Equals(OnReviewSub_OnReview_Review? other) @@ -304,9 +302,7 @@ public partial interface IOnReviewSub_OnReview /// The name of the current Object type at runtime. /// public global::System.String __typename { get; } - public global::System.Int32 Stars { get; } - public global::System.String? Commentary { get; } } @@ -338,8 +334,99 @@ private OnReviewSubSubscriptionDocument() public static OnReviewSubSubscriptionDocument Instance { get; } = new OnReviewSubSubscriptionDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Subscription; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x20, 0x7b, 0x20, 0x6f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x4e, 0x45, 0x57, 0x5f, 0x48, 0x4f, 0x50, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x74, 0x61, 0x72, 0x73, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x73, + 0x75, + 0x62, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x4f, + 0x6e, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x53, + 0x75, + 0x62, + 0x20, + 0x7b, + 0x20, + 0x6f, + 0x6e, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x4e, + 0x45, + 0x57, + 0x5f, + 0x48, + 0x4f, + 0x50, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x74, + 0x61, + 0x72, + 0x73, + 0x20, + 0x63, + 0x6f, + 0x6d, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x61, + 0x72, + 0x79, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "92220fce37342d7ade3d63a2a81342eb1fb14bac"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -373,6 +460,7 @@ public OnReviewSubSubscription(global::StrawberryShake.IOperationExecutor typeof(IOnReviewSubResult); + public global::System.IObservable> Watch(global::StrawberryShake.ExecutionStrategy? strategy = null) { var request = CreateRequest(); @@ -463,6 +551,7 @@ public OnReviewSubResultFactory(global::StrawberryShake.IEntityStore entityStore } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsOnReviewSubCompletion.IOnReviewSubResult); + public OnReviewSubResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -513,9 +602,9 @@ public OnReviewSubResultInfo(global::StrawberryShake.CodeGeneration.CSharp.Integ } public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsOnReviewSubCompletion.State.ReviewData OnReview { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new OnReviewSubResultInfo(OnReview, _entityIds, version); @@ -631,9 +720,7 @@ public partial class ReviewData } public global::System.String __typename { get; } - public global::System.Int32? Stars { get; } - public global::System.String? Commentary { get; } } @@ -642,7 +729,9 @@ public partial class ReviewData public partial class StarWarsOnReviewSubCompletionClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsOnReviewSubGraphQLSSETest.Client.cs b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsOnReviewSubGraphQLSSETest.Client.cs index a06f7b0e20d..d9e27d509c9 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsOnReviewSubGraphQLSSETest.Client.cs +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsOnReviewSubGraphQLSSETest.Client.cs @@ -179,9 +179,7 @@ public OnReviewSub_OnReview_Review(global::System.String __typename, global::Sys /// The name of the current Object type at runtime. /// public global::System.String __typename { get; } - public global::System.Int32 Stars { get; } - public global::System.String? Commentary { get; } public virtual global::System.Boolean Equals(OnReviewSub_OnReview_Review? other) @@ -256,9 +254,7 @@ public partial interface IOnReviewSub_OnReview /// The name of the current Object type at runtime. /// public global::System.String __typename { get; } - public global::System.Int32 Stars { get; } - public global::System.String? Commentary { get; } } @@ -290,8 +286,99 @@ private OnReviewSubSubscriptionDocument() public static OnReviewSubSubscriptionDocument Instance { get; } = new OnReviewSubSubscriptionDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Subscription; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x20, 0x7b, 0x20, 0x6f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x4e, 0x45, 0x57, 0x5f, 0x48, 0x4f, 0x50, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x74, 0x61, 0x72, 0x73, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x73, + 0x75, + 0x62, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x4f, + 0x6e, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x53, + 0x75, + 0x62, + 0x20, + 0x7b, + 0x20, + 0x6f, + 0x6e, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x4e, + 0x45, + 0x57, + 0x5f, + 0x48, + 0x4f, + 0x50, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x74, + 0x61, + 0x72, + 0x73, + 0x20, + 0x63, + 0x6f, + 0x6d, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x61, + 0x72, + 0x79, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "92220fce37342d7ade3d63a2a81342eb1fb14bac"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -325,6 +412,7 @@ public OnReviewSubSubscription(global::StrawberryShake.IOperationExecutor typeof(IOnReviewSubResult); + public global::System.IObservable> Watch(global::StrawberryShake.ExecutionStrategy? strategy = null) { var request = CreateRequest(); @@ -407,6 +495,7 @@ public OnReviewSubResultFactory(global::StrawberryShake.IEntityStore entityStore } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsOnReviewSubGraphQLSSE.IOnReviewSubResult); + public OnReviewSubResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -457,9 +546,9 @@ public OnReviewSubResultInfo(global::StrawberryShake.CodeGeneration.CSharp.Integ } public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsOnReviewSubGraphQLSSE.State.ReviewData OnReview { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new OnReviewSubResultInfo(OnReview, _entityIds, version); @@ -575,9 +664,7 @@ public partial class ReviewData } public global::System.String __typename { get; } - public global::System.Int32? Stars { get; } - public global::System.String? Commentary { get; } } @@ -586,7 +673,9 @@ public partial class ReviewData public partial class StarWarsOnReviewSubGraphQLSSEClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsOnReviewSubNoStoreTest.Client.cs b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsOnReviewSubNoStoreTest.Client.cs index e4ee0b1b7a7..f33e9ec0610 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsOnReviewSubNoStoreTest.Client.cs +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsOnReviewSubNoStoreTest.Client.cs @@ -176,9 +176,7 @@ public OnReviewSub_OnReview_Review(global::System.String __typename, global::Sys /// The name of the current Object type at runtime. /// public global::System.String __typename { get; } - public global::System.Int32 Stars { get; } - public global::System.String? Commentary { get; } public virtual global::System.Boolean Equals(OnReviewSub_OnReview_Review? other) @@ -253,9 +251,7 @@ public partial interface IOnReviewSub_OnReview /// The name of the current Object type at runtime. /// public global::System.String __typename { get; } - public global::System.Int32 Stars { get; } - public global::System.String? Commentary { get; } } @@ -287,8 +283,99 @@ private OnReviewSubSubscriptionDocument() public static OnReviewSubSubscriptionDocument Instance { get; } = new OnReviewSubSubscriptionDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Subscription; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x20, 0x7b, 0x20, 0x6f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x4e, 0x45, 0x57, 0x5f, 0x48, 0x4f, 0x50, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x74, 0x61, 0x72, 0x73, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x73, + 0x75, + 0x62, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x4f, + 0x6e, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x53, + 0x75, + 0x62, + 0x20, + 0x7b, + 0x20, + 0x6f, + 0x6e, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x4e, + 0x45, + 0x57, + 0x5f, + 0x48, + 0x4f, + 0x50, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x74, + 0x61, + 0x72, + 0x73, + 0x20, + 0x63, + 0x6f, + 0x6d, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x61, + 0x72, + 0x79, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "92220fce37342d7ade3d63a2a81342eb1fb14bac"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -322,6 +409,7 @@ public OnReviewSubSubscription(global::StrawberryShake.IOperationExecutor typeof(IOnReviewSubResult); + public global::System.IObservable> Watch(global::StrawberryShake.ExecutionStrategy? strategy = null) { var request = CreateRequest(); @@ -402,6 +490,7 @@ public OnReviewSubResultFactory() } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsOnReviewSubNoStore.IOnReviewSubResult); + public OnReviewSubResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (dataInfo is OnReviewSubResultInfo info) @@ -443,9 +532,9 @@ public OnReviewSubResultInfo(global::StrawberryShake.CodeGeneration.CSharp.Integ } public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsOnReviewSubNoStore.State.ReviewData OnReview { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => global::System.Array.Empty(); public global::System.UInt64 Version => 0; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new OnReviewSubResultInfo(OnReview); @@ -551,9 +640,7 @@ public partial class ReviewData } public global::System.String __typename { get; } - public global::System.Int32? Stars { get; } - public global::System.String? Commentary { get; } } @@ -564,6 +651,7 @@ public partial class StarWarsOnReviewSubNoStoreClientStoreAccessor : global::Str public global::StrawberryShake.IOperationStore OperationStore => throw new global::System.NotSupportedException("OperationStore is not supported in store less mode"); public global::StrawberryShake.IEntityStore EntityStore => throw new global::System.NotSupportedException("EntityStore is not supported in store less mode"); public global::StrawberryShake.IEntityIdSerializer EntityIdSerializer => throw new global::System.NotSupportedException("EntityIdSerializer is not supported in store less mode"); + public global::StrawberryShake.IOperationRequestFactory GetOperationRequestFactory(global::System.Type resultType) { throw new global::System.NotSupportedException("GetOperationRequestFactory is not supported in store less mode"); diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsTypeNameOnInterfacesTest.Client.cs b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsTypeNameOnInterfacesTest.Client.cs index 34198774cd3..b39670c3508 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsTypeNameOnInterfacesTest.Client.cs +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsTypeNameOnInterfacesTest.Client.cs @@ -352,8 +352,107 @@ private GetHeroQueryDocument() public static GetHeroQueryDocument Instance { get; } = new GetHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x7b, 0x20, 0x68, 0x65, 0x72, 0x6f, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x4e, 0x45, 0x57, 0x5f, 0x48, 0x4f, 0x50, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x68, + 0x65, + 0x72, + 0x6f, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x4e, + 0x45, + 0x57, + 0x5f, + 0x48, + 0x4f, + 0x50, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "f8ce4e3a52ec254e48424fe573eb27a039aece1a"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -391,6 +490,7 @@ public GetHeroQuery(global::StrawberryShake.IOperationExecutor o } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -514,6 +614,7 @@ public GetHeroResultFactory(global::StrawberryShake.IEntityStore entityStore, gl } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsTypeNameOnInterfaces.IGetHeroResult); + public GetHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -569,9 +670,9 @@ public GetHeroResultInfo(global::StrawberryShake.EntityId? hero, global::System. } public global::StrawberryShake.EntityId? Hero { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetHeroResultInfo(Hero, _entityIds, version); @@ -716,7 +817,9 @@ public GetHero_Hero_Human Map(global::StrawberryShake.CodeGeneration.CSharp.Inte public partial class StarWarsTypeNameOnInterfacesClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsTypeNameOnUnionsTest.Client.cs b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsTypeNameOnUnionsTest.Client.cs index 990e8f76394..e5b8a86b6d5 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsTypeNameOnUnionsTest.Client.cs +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsTypeNameOnUnionsTest.Client.cs @@ -433,8 +433,127 @@ private SearchHeroQueryDocument() public static SearchHeroQueryDocument Instance { get; } = new SearchHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x28, 0x74, 0x65, 0x78, 0x74, 0x3a, 0x20, 0x22, 0x6c, 0x22, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x72, 0x73, 0x68, 0x69, 0x70, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x53, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x28, + 0x74, + 0x65, + 0x78, + 0x74, + 0x3a, + 0x20, + 0x22, + 0x6c, + 0x22, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x53, + 0x74, + 0x61, + 0x72, + 0x73, + 0x68, + 0x69, + 0x70, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "e2347e3fc516d7742122125fa68a1aca286f128c"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -475,6 +594,7 @@ public SearchHeroQuery(global::StrawberryShake.IOperationExecutor typeof(ISearchHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -616,6 +736,7 @@ public SearchHeroResultFactory(global::StrawberryShake.IEntityStore entityStore, } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsTypeNameOnUnions.ISearchHeroResult); + public SearchHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -692,9 +813,9 @@ public SearchHeroResultInfo(global::System.Collections.Generic.IReadOnlyList? Search { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new SearchHeroResultInfo(Search, _entityIds, version); @@ -895,7 +1016,9 @@ public SearchHero_Search_Droid Map(global::StrawberryShake.CodeGeneration.CSharp public partial class StarWarsTypeNameOnUnionsClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsUnionListTest.Client.cs b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsUnionListTest.Client.cs index 3758ad08d25..6b7748ac6ad 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsUnionListTest.Client.cs +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsUnionListTest.Client.cs @@ -248,7 +248,6 @@ public SearchHero_Search_Human(global::System.String name, global::StrawberrySha } public global::System.String Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsUnionList.ISearchHero_Search_Friends? Friends { get; } public virtual global::System.Boolean Equals(SearchHero_Search_Human? other) @@ -595,7 +594,6 @@ public partial interface ISearchHero_Search_Starship : ISearchHero_Search public partial interface ISearchHero_Search_Human : ISearchHero_Search { public global::System.String Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsUnionList.ISearchHero_Search_Friends? Friends { get; } } @@ -695,8 +693,260 @@ private SearchHeroQueryDocument() public static SearchHeroQueryDocument Instance { get; } = new SearchHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x28, 0x74, 0x65, 0x78, 0x74, 0x3a, 0x20, 0x22, 0x6c, 0x22, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x72, 0x73, 0x68, 0x69, 0x70, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x53, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x28, + 0x74, + 0x65, + 0x78, + 0x74, + 0x3a, + 0x20, + 0x22, + 0x6c, + 0x22, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x66, + 0x72, + 0x69, + 0x65, + 0x6e, + 0x64, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x6f, + 0x64, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x53, + 0x74, + 0x61, + 0x72, + 0x73, + 0x68, + 0x69, + 0x70, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "ab273d4e301554c50a6325fad57fa04d3744ef1a"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -756,6 +1006,7 @@ public SearchHeroQuery(global::StrawberryShake.IOperationExecutor typeof(ISearchHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -877,7 +1128,6 @@ public partial class HumanEntity } public global::System.String Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsUnionList.State.FriendsConnectionData? Friends { get; } } @@ -910,6 +1160,7 @@ public SearchHeroResultFactory(global::StrawberryShake.IEntityStore entityStore, } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsUnionList.ISearchHeroResult); + public SearchHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -986,9 +1237,9 @@ public SearchHeroResultInfo(global::System.Collections.Generic.IReadOnlyList? Search { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new SearchHeroResultInfo(Search, _entityIds, version); @@ -1220,7 +1471,6 @@ public partial class FriendsConnectionData } public global::System.String __typename { get; } - ///A flattened list of the nodes. public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } } @@ -1395,7 +1645,9 @@ public SearchHero_Search_Friends_Nodes_Human Map(global::StrawberryShake.CodeGen public partial class StarWarsUnionListClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/UploadScalarTest.Client.cs b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/UploadScalarTest.Client.cs index 86f5abb35f5..7ac3a279588 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/UploadScalarTest.Client.cs +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/UploadScalarTest.Client.cs @@ -185,6 +185,7 @@ public partial class TestInputInputValueFormatter : global::StrawberryShake.Seri { private global::StrawberryShake.Serialization.IInputValueFormatter _barInputFormatter = default !; public global::System.String TypeName => "TestInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _barInputFormatter = serializerResolver.GetInputValueFormatter("BarInput"); @@ -305,6 +306,7 @@ public partial class BarInputInputValueFormatter : global::StrawberryShake.Seria { private global::StrawberryShake.Serialization.IInputValueFormatter _bazInputFormatter = default !; public global::System.String TypeName => "BarInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _bazInputFormatter = serializerResolver.GetInputValueFormatter("BazInput"); @@ -425,6 +427,7 @@ public partial class BazInputInputValueFormatter : global::StrawberryShake.Seria { private global::StrawberryShake.Serialization.IInputValueFormatter _uploadFormatter = default !; public global::System.String TypeName => "BazInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _uploadFormatter = serializerResolver.GetInputValueFormatter("Upload"); @@ -557,8 +560,330 @@ private TestUploadQueryDocument() public static TestUploadQueryDocument Instance { get; } = new TestUploadQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x54, 0x65, 0x73, 0x74, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x28, 0x24, 0x6e, 0x6f, 0x6e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x3a, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x24, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x3a, 0x20, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x2c, 0x20, 0x24, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x5b, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5d, 0x2c, 0x20, 0x24, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x3a, 0x20, 0x5b, 0x5b, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5d, 0x5d, 0x2c, 0x20, 0x24, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x54, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x2c, 0x20, 0x24, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x5b, 0x54, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x5d, 0x2c, 0x20, 0x24, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x3a, 0x20, 0x5b, 0x5b, 0x54, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x5d, 0x5d, 0x29, 0x20, 0x7b, 0x20, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x28, 0x6e, 0x6f, 0x6e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x3a, 0x20, 0x24, 0x6e, 0x6f, 0x6e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x2c, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x3a, 0x20, 0x24, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x2c, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x24, 0x6c, 0x69, 0x73, 0x74, 0x2c, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x3a, 0x20, 0x24, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x2c, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x24, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x24, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x2c, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x3a, 0x20, 0x24, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x29, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x54, + 0x65, + 0x73, + 0x74, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x28, + 0x24, + 0x6e, + 0x6f, + 0x6e, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x3a, + 0x20, + 0x53, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x2c, + 0x20, + 0x24, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x2c, + 0x20, + 0x24, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x5b, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x5d, + 0x2c, + 0x20, + 0x24, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x3a, + 0x20, + 0x5b, + 0x5b, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x5d, + 0x5d, + 0x2c, + 0x20, + 0x24, + 0x6f, + 0x62, + 0x6a, + 0x65, + 0x63, + 0x74, + 0x3a, + 0x20, + 0x54, + 0x65, + 0x73, + 0x74, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x2c, + 0x20, + 0x24, + 0x6f, + 0x62, + 0x6a, + 0x65, + 0x63, + 0x74, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x5b, + 0x54, + 0x65, + 0x73, + 0x74, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x5d, + 0x2c, + 0x20, + 0x24, + 0x6f, + 0x62, + 0x6a, + 0x65, + 0x63, + 0x74, + 0x4e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x3a, + 0x20, + 0x5b, + 0x5b, + 0x54, + 0x65, + 0x73, + 0x74, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x5d, + 0x5d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x75, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x28, + 0x6e, + 0x6f, + 0x6e, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x3a, + 0x20, + 0x24, + 0x6e, + 0x6f, + 0x6e, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x2c, + 0x20, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x2c, + 0x20, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x2c, + 0x20, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x3a, + 0x20, + 0x24, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x2c, + 0x20, + 0x6f, + 0x62, + 0x6a, + 0x65, + 0x63, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x6f, + 0x62, + 0x6a, + 0x65, + 0x63, + 0x74, + 0x2c, + 0x20, + 0x6f, + 0x62, + 0x6a, + 0x65, + 0x63, + 0x74, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x6f, + 0x62, + 0x6a, + 0x65, + 0x63, + 0x74, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x2c, + 0x20, + 0x6f, + 0x62, + 0x6a, + 0x65, + 0x63, + 0x74, + 0x4e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x3a, + 0x20, + 0x24, + 0x6f, + 0x62, + 0x6a, + 0x65, + 0x63, + 0x74, + 0x4e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x29, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "7cd8f1db7bb9937a9b48c70ce9dc152f52782f96"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -594,6 +919,7 @@ public TestUploadQuery(global::StrawberryShake.IOperationExecutor typeof(ITestUploadResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.String? nonUpload, global::StrawberryShake.Upload? single, global::System.Collections.Generic.IReadOnlyList? list, global::System.Collections.Generic.IReadOnlyList?>? nested, global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput? @object, global::System.Collections.Generic.IReadOnlyList? objectList, global::System.Collections.Generic.IReadOnlyList?>? objectNested, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(nonUpload, single, list, nested, @object, objectList, objectNested); @@ -970,6 +1296,7 @@ public TestUploadResultFactory(global::StrawberryShake.IEntityStore entityStore) } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadResult); + public TestUploadResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -1005,9 +1332,9 @@ public TestUploadResultInfo(global::System.String? upload, global::System.Collec } public global::System.String? Upload { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new TestUploadResultInfo(Upload, _entityIds, version); @@ -1086,7 +1413,9 @@ public TestUploadBuilder(global::StrawberryShake.IEntityStore entityStore, globa public partial class UploadScalarClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/UploadScalar_InMemoryTest.Client.cs b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/UploadScalar_InMemoryTest.Client.cs index d3dd1553795..80810cc8771 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/UploadScalar_InMemoryTest.Client.cs +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/UploadScalar_InMemoryTest.Client.cs @@ -185,6 +185,7 @@ public partial class TestInputInputValueFormatter : global::StrawberryShake.Seri { private global::StrawberryShake.Serialization.IInputValueFormatter _barInputFormatter = default !; public global::System.String TypeName => "TestInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _barInputFormatter = serializerResolver.GetInputValueFormatter("BarInput"); @@ -305,6 +306,7 @@ public partial class BarInputInputValueFormatter : global::StrawberryShake.Seria { private global::StrawberryShake.Serialization.IInputValueFormatter _bazInputFormatter = default !; public global::System.String TypeName => "BarInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _bazInputFormatter = serializerResolver.GetInputValueFormatter("BazInput"); @@ -425,6 +427,7 @@ public partial class BazInputInputValueFormatter : global::StrawberryShake.Seria { private global::StrawberryShake.Serialization.IInputValueFormatter _uploadFormatter = default !; public global::System.String TypeName => "BazInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _uploadFormatter = serializerResolver.GetInputValueFormatter("Upload"); @@ -557,8 +560,330 @@ private TestUploadQueryDocument() public static TestUploadQueryDocument Instance { get; } = new TestUploadQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x54, 0x65, 0x73, 0x74, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x28, 0x24, 0x6e, 0x6f, 0x6e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x3a, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x24, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x3a, 0x20, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x2c, 0x20, 0x24, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x5b, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5d, 0x2c, 0x20, 0x24, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x3a, 0x20, 0x5b, 0x5b, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5d, 0x5d, 0x2c, 0x20, 0x24, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x54, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x2c, 0x20, 0x24, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x5b, 0x54, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x5d, 0x2c, 0x20, 0x24, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x3a, 0x20, 0x5b, 0x5b, 0x54, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x5d, 0x5d, 0x29, 0x20, 0x7b, 0x20, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x28, 0x6e, 0x6f, 0x6e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x3a, 0x20, 0x24, 0x6e, 0x6f, 0x6e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x2c, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x3a, 0x20, 0x24, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x2c, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x24, 0x6c, 0x69, 0x73, 0x74, 0x2c, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x3a, 0x20, 0x24, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x2c, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x24, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x24, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x2c, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x3a, 0x20, 0x24, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x29, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x54, + 0x65, + 0x73, + 0x74, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x28, + 0x24, + 0x6e, + 0x6f, + 0x6e, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x3a, + 0x20, + 0x53, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x2c, + 0x20, + 0x24, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x2c, + 0x20, + 0x24, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x5b, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x5d, + 0x2c, + 0x20, + 0x24, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x3a, + 0x20, + 0x5b, + 0x5b, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x5d, + 0x5d, + 0x2c, + 0x20, + 0x24, + 0x6f, + 0x62, + 0x6a, + 0x65, + 0x63, + 0x74, + 0x3a, + 0x20, + 0x54, + 0x65, + 0x73, + 0x74, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x2c, + 0x20, + 0x24, + 0x6f, + 0x62, + 0x6a, + 0x65, + 0x63, + 0x74, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x5b, + 0x54, + 0x65, + 0x73, + 0x74, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x5d, + 0x2c, + 0x20, + 0x24, + 0x6f, + 0x62, + 0x6a, + 0x65, + 0x63, + 0x74, + 0x4e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x3a, + 0x20, + 0x5b, + 0x5b, + 0x54, + 0x65, + 0x73, + 0x74, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x5d, + 0x5d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x75, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x28, + 0x6e, + 0x6f, + 0x6e, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x3a, + 0x20, + 0x24, + 0x6e, + 0x6f, + 0x6e, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x2c, + 0x20, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x2c, + 0x20, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x2c, + 0x20, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x3a, + 0x20, + 0x24, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x2c, + 0x20, + 0x6f, + 0x62, + 0x6a, + 0x65, + 0x63, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x6f, + 0x62, + 0x6a, + 0x65, + 0x63, + 0x74, + 0x2c, + 0x20, + 0x6f, + 0x62, + 0x6a, + 0x65, + 0x63, + 0x74, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x6f, + 0x62, + 0x6a, + 0x65, + 0x63, + 0x74, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x2c, + 0x20, + 0x6f, + 0x62, + 0x6a, + 0x65, + 0x63, + 0x74, + 0x4e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x3a, + 0x20, + 0x24, + 0x6f, + 0x62, + 0x6a, + 0x65, + 0x63, + 0x74, + 0x4e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x29, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "7cd8f1db7bb9937a9b48c70ce9dc152f52782f96"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -594,6 +919,7 @@ public TestUploadQuery(global::StrawberryShake.IOperationExecutor typeof(ITestUploadResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.String? nonUpload, global::StrawberryShake.Upload? single, global::System.Collections.Generic.IReadOnlyList? list, global::System.Collections.Generic.IReadOnlyList?>? nested, global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar_InMemory.TestInput? @object, global::System.Collections.Generic.IReadOnlyList? objectList, global::System.Collections.Generic.IReadOnlyList?>? objectNested, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(nonUpload, single, list, nested, @object, objectList, objectNested); @@ -970,6 +1296,7 @@ public TestUploadResultFactory(global::StrawberryShake.IEntityStore entityStore) } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar_InMemory.ITestUploadResult); + public TestUploadResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -1005,9 +1332,9 @@ public TestUploadResultInfo(global::System.String? upload, global::System.Collec } public global::System.String? Upload { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new TestUploadResultInfo(Upload, _entityIds, version); @@ -1086,7 +1413,9 @@ public TestUploadBuilder(global::StrawberryShake.IEntityStore entityStore, globa public partial class UploadScalar_InMemoryClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/__snapshots__/NET6.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/__snapshots__/NET6.snap deleted file mode 100644 index 4787cd967af..00000000000 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/__snapshots__/NET6.snap +++ /dev/null @@ -1,6642 +0,0 @@ -{ - "Data": { - "__schema": { - "QueryType": { - "Name": "Query" - }, - "MutationType": { - "Name": "Mutation" - }, - "SubscriptionType": { - "Name": "Subscription" - }, - "Types": [ - { - "Kind": "Object", - "Name": "__Directive", - "Description": "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", - "Fields": [ - { - "Name": "name", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "description", - "Description": null, - "Args": [], - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "locations", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "List", - "Name": null, - "OfType": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Enum", - "Name": "__DirectiveLocation" - } - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "args", - "Description": null, - "Args": [ - { - "Name": "includeDeprecated", - "Description": null, - "Type": { - "Kind": "Scalar", - "Name": "Boolean", - "OfType": null - }, - "DefaultValue": "false" - } - ], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "List", - "Name": null, - "OfType": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Object", - "Name": "__InputValue" - } - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "isRepeatable", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "Boolean", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "onOperation", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "Boolean", - "OfType": null - } - }, - "IsDeprecated": true, - "DeprecationReason": "Use `locations`." - }, - { - "Name": "onFragment", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "Boolean", - "OfType": null - } - }, - "IsDeprecated": true, - "DeprecationReason": "Use `locations`." - }, - { - "Name": "onField", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "Boolean", - "OfType": null - } - }, - "IsDeprecated": true, - "DeprecationReason": "Use `locations`." - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "Enum", - "Name": "__DirectiveLocation", - "Description": "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": [ - { - "Name": "QUERY", - "Description": "Location adjacent to a query operation.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "MUTATION", - "Description": "Location adjacent to a mutation operation.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "SUBSCRIPTION", - "Description": "Location adjacent to a subscription operation.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "FIELD", - "Description": "Location adjacent to a field.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "FRAGMENT_DEFINITION", - "Description": "Location adjacent to a fragment definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "FRAGMENT_SPREAD", - "Description": "Location adjacent to a fragment spread.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "INLINE_FRAGMENT", - "Description": "Location adjacent to an inline fragment.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "VARIABLE_DEFINITION", - "Description": "Location adjacent to a variable definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "SCHEMA", - "Description": "Location adjacent to a schema definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "SCALAR", - "Description": "Location adjacent to a scalar definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "OBJECT", - "Description": "Location adjacent to an object type definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "FIELD_DEFINITION", - "Description": "Location adjacent to a field definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "ARGUMENT_DEFINITION", - "Description": "Location adjacent to an argument definition", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "INTERFACE", - "Description": "Location adjacent to an interface definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "UNION", - "Description": "Location adjacent to a union definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "ENUM", - "Description": "Location adjacent to an enum definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "ENUM_VALUE", - "Description": "Location adjacent to an enum value definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "INPUT_OBJECT", - "Description": "Location adjacent to an input object type definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "INPUT_FIELD_DEFINITION", - "Description": "Location adjacent to an input object field definition.", - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "PossibleTypes": null - }, - { - "Kind": "Object", - "Name": "__EnumValue", - "Description": "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", - "Fields": [ - { - "Name": "name", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "description", - "Description": null, - "Args": [], - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "isDeprecated", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "Boolean", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "deprecationReason", - "Description": null, - "Args": [], - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "Object", - "Name": "__Field", - "Description": "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", - "Fields": [ - { - "Name": "name", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "description", - "Description": null, - "Args": [], - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "args", - "Description": null, - "Args": [ - { - "Name": "includeDeprecated", - "Description": null, - "Type": { - "Kind": "Scalar", - "Name": "Boolean", - "OfType": null - }, - "DefaultValue": "false" - } - ], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "List", - "Name": null, - "OfType": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Object", - "Name": "__InputValue" - } - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "type", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Object", - "Name": "__Type", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "isDeprecated", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "Boolean", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "deprecationReason", - "Description": null, - "Args": [], - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "Object", - "Name": "__InputValue", - "Description": "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", - "Fields": [ - { - "Name": "name", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "description", - "Description": null, - "Args": [], - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "type", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Object", - "Name": "__Type", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "defaultValue", - "Description": "A GraphQL-formatted string representing the default value for this input value.", - "Args": [], - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "isDeprecated", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "Boolean", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "deprecationReason", - "Description": null, - "Args": [], - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "Object", - "Name": "__Schema", - "Description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.", - "Fields": [ - { - "Name": "description", - "Description": null, - "Args": [], - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "types", - "Description": "A list of all types supported by this server.", - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "List", - "Name": null, - "OfType": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Object", - "Name": "__Type" - } - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "queryType", - "Description": "The type that query operations will be rooted at.", - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Object", - "Name": "__Type", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "mutationType", - "Description": "If this server supports mutation, the type that mutation operations will be rooted at.", - "Args": [], - "Type": { - "Kind": "Object", - "Name": "__Type", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "subscriptionType", - "Description": "If this server support subscription, the type that subscription operations will be rooted at.", - "Args": [], - "Type": { - "Kind": "Object", - "Name": "__Type", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "directives", - "Description": "A list of all directives supported by this server.", - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "List", - "Name": null, - "OfType": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Object", - "Name": "__Directive" - } - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "Object", - "Name": "__Type", - "Description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", - "Fields": [ - { - "Name": "kind", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Enum", - "Name": "__TypeKind", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "name", - "Description": null, - "Args": [], - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "description", - "Description": null, - "Args": [], - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "fields", - "Description": null, - "Args": [ - { - "Name": "includeDeprecated", - "Description": null, - "Type": { - "Kind": "Scalar", - "Name": "Boolean", - "OfType": null - }, - "DefaultValue": "false" - } - ], - "Type": { - "Kind": "List", - "Name": null, - "OfType": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Object", - "Name": "__Field", - "OfType": null - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "interfaces", - "Description": null, - "Args": [], - "Type": { - "Kind": "List", - "Name": null, - "OfType": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Object", - "Name": "__Type", - "OfType": null - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "possibleTypes", - "Description": null, - "Args": [], - "Type": { - "Kind": "List", - "Name": null, - "OfType": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Object", - "Name": "__Type", - "OfType": null - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "enumValues", - "Description": null, - "Args": [ - { - "Name": "includeDeprecated", - "Description": null, - "Type": { - "Kind": "Scalar", - "Name": "Boolean", - "OfType": null - }, - "DefaultValue": "false" - } - ], - "Type": { - "Kind": "List", - "Name": null, - "OfType": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Object", - "Name": "__EnumValue", - "OfType": null - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "inputFields", - "Description": null, - "Args": [ - { - "Name": "includeDeprecated", - "Description": null, - "Type": { - "Kind": "Scalar", - "Name": "Boolean", - "OfType": null - }, - "DefaultValue": "false" - } - ], - "Type": { - "Kind": "List", - "Name": null, - "OfType": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Object", - "Name": "__InputValue", - "OfType": null - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "ofType", - "Description": null, - "Args": [], - "Type": { - "Kind": "Object", - "Name": "__Type", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "specifiedByURL", - "Description": "`specifiedByURL` may return a String (in the form of a URL) for custom scalars, otherwise it will return `null`.", - "Args": [], - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "Enum", - "Name": "__TypeKind", - "Description": "An enum describing what kind of type a given `__Type` is.", - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": [ - { - "Name": "SCALAR", - "Description": "Indicates this type is a scalar.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "OBJECT", - "Description": "Indicates this type is an object. `fields` and `interfaces` are valid fields.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "INTERFACE", - "Description": "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "UNION", - "Description": "Indicates this type is a union. `possibleTypes` is a valid field.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "ENUM", - "Description": "Indicates this type is an enum. `enumValues` is a valid field.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "INPUT_OBJECT", - "Description": "Indicates this type is an input object. `inputFields` is a valid field.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "LIST", - "Description": "Indicates this type is a list. `ofType` is a valid field.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "NON_NULL", - "Description": "Indicates this type is a non-null. `ofType` is a valid field.", - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "PossibleTypes": null - }, - { - "Kind": "Object", - "Name": "Query", - "Description": null, - "Fields": [ - { - "Name": "hero", - "Description": null, - "Args": [ - { - "Name": "episode", - "Description": null, - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Enum", - "Name": "Episode", - "OfType": null - } - }, - "DefaultValue": "NEW_HOPE" - } - ], - "Type": { - "Kind": "Interface", - "Name": "Character", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "heroByTraits", - "Description": null, - "Args": [ - { - "Name": "traits", - "Description": null, - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "JSON", - "OfType": null - } - }, - "DefaultValue": null - } - ], - "Type": { - "Kind": "Interface", - "Name": "Character", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "heroes", - "Description": null, - "Args": [ - { - "Name": "episodes", - "Description": null, - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "List", - "Name": null, - "OfType": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Enum", - "Name": "Episode" - } - } - } - }, - "DefaultValue": null - } - ], - "Type": { - "Kind": "List", - "Name": null, - "OfType": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Interface", - "Name": "Character", - "OfType": null - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "character", - "Description": null, - "Args": [ - { - "Name": "characterIds", - "Description": null, - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "List", - "Name": null, - "OfType": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "String" - } - } - } - }, - "DefaultValue": null - } - ], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "List", - "Name": null, - "OfType": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Interface", - "Name": "Character" - } - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "search", - "Description": null, - "Args": [ - { - "Name": "text", - "Description": null, - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - } - }, - "DefaultValue": null - } - ], - "Type": { - "Kind": "List", - "Name": null, - "OfType": { - "Kind": "Union", - "Name": "SearchResult", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "human", - "Description": null, - "Args": [ - { - "Name": "id", - "Description": null, - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - } - }, - "DefaultValue": null - } - ], - "Type": { - "Kind": "Object", - "Name": "Human", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "droid", - "Description": null, - "Args": [ - { - "Name": "id", - "Description": null, - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - } - }, - "DefaultValue": null - } - ], - "Type": { - "Kind": "Object", - "Name": "Droid", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "Object", - "Name": "Mutation", - "Description": null, - "Fields": [ - { - "Name": "createReview", - "Description": null, - "Args": [ - { - "Name": "episode", - "Description": null, - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Enum", - "Name": "Episode", - "OfType": null - } - }, - "DefaultValue": null - }, - { - "Name": "review", - "Description": null, - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "InputObject", - "Name": "ReviewInput", - "OfType": null - } - }, - "DefaultValue": null - } - ], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Object", - "Name": "Review", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "complete", - "Description": null, - "Args": [ - { - "Name": "episode", - "Description": null, - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Enum", - "Name": "Episode", - "OfType": null - } - }, - "DefaultValue": null - } - ], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "Boolean", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "Object", - "Name": "Subscription", - "Description": null, - "Fields": [ - { - "Name": "onReview", - "Description": null, - "Args": [ - { - "Name": "episode", - "Description": null, - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Enum", - "Name": "Episode", - "OfType": null - } - }, - "DefaultValue": null - } - ], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Object", - "Name": "Review", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "Object", - "Name": "Human", - "Description": null, - "Fields": [ - { - "Name": "id", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "ID", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "name", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "appearsIn", - "Description": null, - "Args": [], - "Type": { - "Kind": "List", - "Name": null, - "OfType": { - "Kind": "Enum", - "Name": "Episode", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "friends", - "Description": null, - "Args": [ - { - "Name": "first", - "Description": "Returns the first _n_ elements from the list.", - "Type": { - "Kind": "Scalar", - "Name": "Int", - "OfType": null - }, - "DefaultValue": null - }, - { - "Name": "after", - "Description": "Returns the elements in the list that come after the specified cursor.", - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "DefaultValue": null - }, - { - "Name": "last", - "Description": "Returns the last _n_ elements from the list.", - "Type": { - "Kind": "Scalar", - "Name": "Int", - "OfType": null - }, - "DefaultValue": null - }, - { - "Name": "before", - "Description": "Returns the elements in the list that come before the specified cursor.", - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "DefaultValue": null - } - ], - "Type": { - "Kind": "Object", - "Name": "FriendsConnection", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "otherHuman", - "Description": null, - "Args": [], - "Type": { - "Kind": "Object", - "Name": "Human", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "height", - "Description": null, - "Args": [ - { - "Name": "unit", - "Description": null, - "Type": { - "Kind": "Enum", - "Name": "Unit", - "OfType": null - }, - "DefaultValue": null - } - ], - "Type": { - "Kind": "Scalar", - "Name": "Float", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "homePlanet", - "Description": null, - "Args": [], - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "traits", - "Description": null, - "Args": [], - "Type": { - "Kind": "Scalar", - "Name": "JSON", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [ - { - "Kind": "Interface", - "Name": "Character", - "OfType": null - } - ], - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "Object", - "Name": "Droid", - "Description": null, - "Fields": [ - { - "Name": "id", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "ID", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "name", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "appearsIn", - "Description": null, - "Args": [], - "Type": { - "Kind": "List", - "Name": null, - "OfType": { - "Kind": "Enum", - "Name": "Episode", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "friends", - "Description": null, - "Args": [ - { - "Name": "first", - "Description": "Returns the first _n_ elements from the list.", - "Type": { - "Kind": "Scalar", - "Name": "Int", - "OfType": null - }, - "DefaultValue": null - }, - { - "Name": "after", - "Description": "Returns the elements in the list that come after the specified cursor.", - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "DefaultValue": null - }, - { - "Name": "last", - "Description": "Returns the last _n_ elements from the list.", - "Type": { - "Kind": "Scalar", - "Name": "Int", - "OfType": null - }, - "DefaultValue": null - }, - { - "Name": "before", - "Description": "Returns the elements in the list that come before the specified cursor.", - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "DefaultValue": null - } - ], - "Type": { - "Kind": "Object", - "Name": "FriendsConnection", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "height", - "Description": null, - "Args": [ - { - "Name": "unit", - "Description": null, - "Type": { - "Kind": "Enum", - "Name": "Unit", - "OfType": null - }, - "DefaultValue": null - } - ], - "Type": { - "Kind": "Scalar", - "Name": "Float", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "primaryFunction", - "Description": null, - "Args": [], - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "traits", - "Description": null, - "Args": [], - "Type": { - "Kind": "Scalar", - "Name": "JSON", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [ - { - "Kind": "Interface", - "Name": "Character", - "OfType": null - } - ], - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "Enum", - "Name": "Episode", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": [ - { - "Name": "NEW_HOPE", - "Description": null, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "EMPIRE", - "Description": null, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "JEDI", - "Description": null, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "PossibleTypes": null - }, - { - "Kind": "Scalar", - "Name": "String", - "Description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "Scalar", - "Name": "Boolean", - "Description": "The `Boolean` scalar type represents `true` or `false`.", - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "Scalar", - "Name": "Int", - "Description": "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.", - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "Interface", - "Name": "Character", - "Description": null, - "Fields": [ - { - "Name": "id", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "ID", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "name", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "friends", - "Description": null, - "Args": [ - { - "Name": "first", - "Description": "Returns the first _n_ elements from the list.", - "Type": { - "Kind": "Scalar", - "Name": "Int", - "OfType": null - }, - "DefaultValue": null - }, - { - "Name": "after", - "Description": "Returns the elements in the list that come after the specified cursor.", - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "DefaultValue": null - }, - { - "Name": "last", - "Description": "Returns the last _n_ elements from the list.", - "Type": { - "Kind": "Scalar", - "Name": "Int", - "OfType": null - }, - "DefaultValue": null - }, - { - "Name": "before", - "Description": "Returns the elements in the list that come before the specified cursor.", - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "DefaultValue": null - } - ], - "Type": { - "Kind": "Object", - "Name": "FriendsConnection", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "appearsIn", - "Description": null, - "Args": [], - "Type": { - "Kind": "List", - "Name": null, - "OfType": { - "Kind": "Enum", - "Name": "Episode", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "traits", - "Description": null, - "Args": [], - "Type": { - "Kind": "Scalar", - "Name": "JSON", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "height", - "Description": null, - "Args": [ - { - "Name": "unit", - "Description": null, - "Type": { - "Kind": "Enum", - "Name": "Unit", - "OfType": null - }, - "DefaultValue": null - } - ], - "Type": { - "Kind": "Scalar", - "Name": "Float", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": [ - { - "Kind": "Object", - "Name": "Human", - "OfType": null - }, - { - "Kind": "Object", - "Name": "Droid", - "OfType": null - } - ] - }, - { - "Kind": "Union", - "Name": "SearchResult", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": [ - { - "Kind": "Object", - "Name": "Starship", - "OfType": null - }, - { - "Kind": "Object", - "Name": "Human", - "OfType": null - }, - { - "Kind": "Object", - "Name": "Droid", - "OfType": null - } - ] - }, - { - "Kind": "Object", - "Name": "Review", - "Description": null, - "Fields": [ - { - "Name": "commentary", - "Description": null, - "Args": [], - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "stars", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "Int", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "InputObject", - "Name": "ReviewInput", - "Description": null, - "Fields": null, - "InputFields": [ - { - "Name": "stars", - "Description": null, - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "Int", - "OfType": null - } - }, - "DefaultValue": null - }, - { - "Name": "commentary", - "Description": null, - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "DefaultValue": null - } - ], - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "Scalar", - "Name": "ID", - "Description": "The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.", - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "Object", - "Name": "FriendsConnection", - "Description": "A connection to a list of items.", - "Fields": [ - { - "Name": "pageInfo", - "Description": "Information to aid in pagination.", - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Object", - "Name": "PageInfo", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "edges", - "Description": "A list of edges.", - "Args": [], - "Type": { - "Kind": "List", - "Name": null, - "OfType": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Object", - "Name": "FriendsEdge", - "OfType": null - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "nodes", - "Description": "A flattened list of the nodes.", - "Args": [], - "Type": { - "Kind": "List", - "Name": null, - "OfType": { - "Kind": "Interface", - "Name": "Character", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "Scalar", - "Name": "Float", - "Description": "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).", - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "Enum", - "Name": "Unit", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": [ - { - "Name": "FOOT", - "Description": null, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "METERS", - "Description": null, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "PossibleTypes": null - }, - { - "Kind": "Scalar", - "Name": "JSON", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "Object", - "Name": "Starship", - "Description": null, - "Fields": [ - { - "Name": "id", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "ID", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "name", - "Description": null, - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "length", - "Description": null, - "Args": [ - { - "Name": "unit", - "Description": null, - "Type": { - "Kind": "Enum", - "Name": "Unit", - "OfType": null - }, - "DefaultValue": null - } - ], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "Float", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "Object", - "Name": "PageInfo", - "Description": "Information about pagination in a connection.", - "Fields": [ - { - "Name": "hasNextPage", - "Description": "Indicates whether more edges exist following the set defined by the clients arguments.", - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "Boolean", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "hasPreviousPage", - "Description": "Indicates whether more edges exist prior the set defined by the clients arguments.", - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "Boolean", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "startCursor", - "Description": "When paginating backwards, the cursor to continue.", - "Args": [], - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "endCursor", - "Description": "When paginating forwards, the cursor to continue.", - "Args": [], - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null - }, - { - "Kind": "Object", - "Name": "FriendsEdge", - "Description": "An edge in a connection.", - "Fields": [ - { - "Name": "cursor", - "Description": "A cursor for use in pagination.", - "Args": [], - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "Name": "node", - "Description": "The item at the end of the edge.", - "Args": [], - "Type": { - "Kind": "Interface", - "Name": "Character", - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null - } - ], - "Directives": [ - { - "Name": "defer", - "Description": "The `@defer` directive may be provided for fragment spreads and inline fragments to inform the executor to delay the execution of the current fragment to indicate deprioritization of the current fragment. A query with `@defer` directive will cause the request to potentially return multiple responses, where non-deferred data is delivered in the initial response and data deferred is delivered in a subsequent response. `@include` and `@skip` take precedence over `@defer`.", - "Args": [ - { - "Name": "label", - "Description": "If this argument label has a value other than null, it will be passed on to the result of this defer directive. This label is intended to give client applications a way to identify to which fragment a deferred result belongs to.", - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "DefaultValue": null - }, - { - "Name": "if", - "Description": "Deferred when true.", - "Type": { - "Kind": "Scalar", - "Name": "Boolean", - "OfType": null - }, - "DefaultValue": null - } - ], - "OnOperation": false, - "OnFragment": true, - "OnField": false - }, - { - "Name": "stream", - "Description": "The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`.", - "Args": [ - { - "Name": "label", - "Description": "If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to.", - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "DefaultValue": null - }, - { - "Name": "initialCount", - "Description": "The initial elements that shall be send down to the consumer.", - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "Int", - "OfType": null - } - }, - "DefaultValue": "0" - }, - { - "Name": "if", - "Description": "Streamed when true.", - "Type": { - "Kind": "Scalar", - "Name": "Boolean", - "OfType": null - }, - "DefaultValue": null - } - ], - "OnOperation": false, - "OnFragment": false, - "OnField": true - }, - { - "Name": "skip", - "Description": "Directs the executor to skip this field or fragment when the `if` argument is true.", - "Args": [ - { - "Name": "if", - "Description": "Skipped when true.", - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "Boolean", - "OfType": null - } - }, - "DefaultValue": null - } - ], - "OnOperation": false, - "OnFragment": true, - "OnField": true - }, - { - "Name": "include", - "Description": "Directs the executor to include this field or fragment only when the `if` argument is true.", - "Args": [ - { - "Name": "if", - "Description": "Included when true.", - "Type": { - "Kind": "NonNull", - "Name": null, - "OfType": { - "Kind": "Scalar", - "Name": "Boolean", - "OfType": null - } - }, - "DefaultValue": null - } - ], - "OnOperation": false, - "OnFragment": true, - "OnField": true - }, - { - "Name": "deprecated", - "Description": "The @deprecated directive is used within the type system definition language to indicate deprecated portions of a GraphQL service’s schema,such as deprecated fields on a type or deprecated enum values.", - "Args": [ - { - "Name": "reason", - "Description": "Deprecations include a reason for why it is deprecated, which is formatted using Markdown syntax (as specified by CommonMark).", - "Type": { - "Kind": "Scalar", - "Name": "String", - "OfType": null - }, - "DefaultValue": "\"No longer supported.\"" - } - ], - "OnOperation": false, - "OnFragment": false, - "OnField": false - } - ] - } - }, - "DataInfo": { - "__schema": { - "__typename": "__Schema", - "QueryType": { - "__typename": "__Type", - "Name": "Query", - "Kind": null, - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "MutationType": { - "__typename": "__Type", - "Name": "Mutation", - "Kind": null, - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "SubscriptionType": { - "__typename": "__Type", - "Name": "Subscription", - "Kind": null, - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "Types": [ - { - "__typename": "__Type", - "Name": "__Directive", - "Kind": "Object", - "Description": "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", - "Fields": [ - { - "__typename": "__Field", - "Name": "name", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "description", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "locations", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "List", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "__DirectiveLocation", - "Kind": "Enum", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "args", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "includeDeprecated", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": "Boolean", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": "false" - } - ], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "List", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "__InputValue", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "isRepeatable", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Boolean", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "onOperation", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Boolean", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": true, - "DeprecationReason": "Use `locations`." - }, - { - "__typename": "__Field", - "Name": "onFragment", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Boolean", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": true, - "DeprecationReason": "Use `locations`." - }, - { - "__typename": "__Field", - "Name": "onField", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Boolean", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": true, - "DeprecationReason": "Use `locations`." - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "__DirectiveLocation", - "Kind": "Enum", - "Description": "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": [ - { - "__typename": "__EnumValue", - "Name": "QUERY", - "Description": "Location adjacent to a query operation.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "MUTATION", - "Description": "Location adjacent to a mutation operation.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "SUBSCRIPTION", - "Description": "Location adjacent to a subscription operation.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "FIELD", - "Description": "Location adjacent to a field.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "FRAGMENT_DEFINITION", - "Description": "Location adjacent to a fragment definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "FRAGMENT_SPREAD", - "Description": "Location adjacent to a fragment spread.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "INLINE_FRAGMENT", - "Description": "Location adjacent to an inline fragment.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "VARIABLE_DEFINITION", - "Description": "Location adjacent to a variable definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "SCHEMA", - "Description": "Location adjacent to a schema definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "SCALAR", - "Description": "Location adjacent to a scalar definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "OBJECT", - "Description": "Location adjacent to an object type definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "FIELD_DEFINITION", - "Description": "Location adjacent to a field definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "ARGUMENT_DEFINITION", - "Description": "Location adjacent to an argument definition", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "INTERFACE", - "Description": "Location adjacent to an interface definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "UNION", - "Description": "Location adjacent to a union definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "ENUM", - "Description": "Location adjacent to an enum definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "ENUM_VALUE", - "Description": "Location adjacent to an enum value definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "INPUT_OBJECT", - "Description": "Location adjacent to an input object type definition.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "INPUT_FIELD_DEFINITION", - "Description": "Location adjacent to an input object field definition.", - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "__EnumValue", - "Kind": "Object", - "Description": "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", - "Fields": [ - { - "__typename": "__Field", - "Name": "name", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "description", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "isDeprecated", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Boolean", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "deprecationReason", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "__Field", - "Kind": "Object", - "Description": "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", - "Fields": [ - { - "__typename": "__Field", - "Name": "name", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "description", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "args", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "includeDeprecated", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": "Boolean", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": "false" - } - ], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "List", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "__InputValue", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "type", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "__Type", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "isDeprecated", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Boolean", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "deprecationReason", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "__InputValue", - "Kind": "Object", - "Description": "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", - "Fields": [ - { - "__typename": "__Field", - "Name": "name", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "description", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "type", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "__Type", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "defaultValue", - "Description": "A GraphQL-formatted string representing the default value for this input value.", - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "isDeprecated", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Boolean", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "deprecationReason", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "__Schema", - "Kind": "Object", - "Description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.", - "Fields": [ - { - "__typename": "__Field", - "Name": "description", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "types", - "Description": "A list of all types supported by this server.", - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "List", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "__Type", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "queryType", - "Description": "The type that query operations will be rooted at.", - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "__Type", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "mutationType", - "Description": "If this server supports mutation, the type that mutation operations will be rooted at.", - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "__Type", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "subscriptionType", - "Description": "If this server support subscription, the type that subscription operations will be rooted at.", - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "__Type", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "directives", - "Description": "A list of all directives supported by this server.", - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "List", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "__Directive", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "__Type", - "Kind": "Object", - "Description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", - "Fields": [ - { - "__typename": "__Field", - "Name": "kind", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "__TypeKind", - "Kind": "Enum", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "name", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "description", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "fields", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "includeDeprecated", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": "Boolean", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": "false" - } - ], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "List", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "__Field", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "interfaces", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "List", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "__Type", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "possibleTypes", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "List", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "__Type", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "enumValues", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "includeDeprecated", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": "Boolean", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": "false" - } - ], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "List", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "__EnumValue", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "inputFields", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "includeDeprecated", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": "Boolean", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": "false" - } - ], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "List", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "__InputValue", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "ofType", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "__Type", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "specifiedByURL", - "Description": "`specifiedByURL` may return a String (in the form of a URL) for custom scalars, otherwise it will return `null`.", - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "__TypeKind", - "Kind": "Enum", - "Description": "An enum describing what kind of type a given `__Type` is.", - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": [ - { - "__typename": "__EnumValue", - "Name": "SCALAR", - "Description": "Indicates this type is a scalar.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "OBJECT", - "Description": "Indicates this type is an object. `fields` and `interfaces` are valid fields.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "INTERFACE", - "Description": "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "UNION", - "Description": "Indicates this type is a union. `possibleTypes` is a valid field.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "ENUM", - "Description": "Indicates this type is an enum. `enumValues` is a valid field.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "INPUT_OBJECT", - "Description": "Indicates this type is an input object. `inputFields` is a valid field.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "LIST", - "Description": "Indicates this type is a list. `ofType` is a valid field.", - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "NON_NULL", - "Description": "Indicates this type is a non-null. `ofType` is a valid field.", - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "Query", - "Kind": "Object", - "Description": null, - "Fields": [ - { - "__typename": "__Field", - "Name": "hero", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "episode", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Episode", - "Kind": "Enum", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "DefaultValue": "NEW_HOPE" - } - ], - "Type": { - "__typename": "__Type", - "Name": "Character", - "Kind": "Interface", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "heroByTraits", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "traits", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "JSON", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "DefaultValue": null - } - ], - "Type": { - "__typename": "__Type", - "Name": "Character", - "Kind": "Interface", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "heroes", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "episodes", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "List", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Episode", - "Kind": "Enum", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - } - } - }, - "DefaultValue": null - } - ], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "List", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Character", - "Kind": "Interface", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "character", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "characterIds", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "List", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - } - } - }, - "DefaultValue": null - } - ], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "List", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Character", - "Kind": "Interface", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "search", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "text", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "DefaultValue": null - } - ], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "List", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "SearchResult", - "Kind": "Union", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "human", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "id", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "DefaultValue": null - } - ], - "Type": { - "__typename": "__Type", - "Name": "Human", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "droid", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "id", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "DefaultValue": null - } - ], - "Type": { - "__typename": "__Type", - "Name": "Droid", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "Mutation", - "Kind": "Object", - "Description": null, - "Fields": [ - { - "__typename": "__Field", - "Name": "createReview", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "episode", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Episode", - "Kind": "Enum", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "DefaultValue": null - }, - { - "__typename": "__InputValue", - "Name": "review", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "ReviewInput", - "Kind": "InputObject", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "DefaultValue": null - } - ], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Review", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "complete", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "episode", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Episode", - "Kind": "Enum", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "DefaultValue": null - } - ], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Boolean", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "Subscription", - "Kind": "Object", - "Description": null, - "Fields": [ - { - "__typename": "__Field", - "Name": "onReview", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "episode", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Episode", - "Kind": "Enum", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "DefaultValue": null - } - ], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Review", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "Human", - "Kind": "Object", - "Description": null, - "Fields": [ - { - "__typename": "__Field", - "Name": "id", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "ID", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "name", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "appearsIn", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "List", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Episode", - "Kind": "Enum", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "friends", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "first", - "Description": "Returns the first _n_ elements from the list.", - "Type": { - "__typename": "__Type", - "Name": "Int", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": null - }, - { - "__typename": "__InputValue", - "Name": "after", - "Description": "Returns the elements in the list that come after the specified cursor.", - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": null - }, - { - "__typename": "__InputValue", - "Name": "last", - "Description": "Returns the last _n_ elements from the list.", - "Type": { - "__typename": "__Type", - "Name": "Int", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": null - }, - { - "__typename": "__InputValue", - "Name": "before", - "Description": "Returns the elements in the list that come before the specified cursor.", - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": null - } - ], - "Type": { - "__typename": "__Type", - "Name": "FriendsConnection", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "otherHuman", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "Human", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "height", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "unit", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": "Unit", - "Kind": "Enum", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": null - } - ], - "Type": { - "__typename": "__Type", - "Name": "Float", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "homePlanet", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "traits", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "JSON", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [ - { - "__typename": "__Type", - "Name": "Character", - "Kind": "Interface", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - ], - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "Droid", - "Kind": "Object", - "Description": null, - "Fields": [ - { - "__typename": "__Field", - "Name": "id", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "ID", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "name", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "appearsIn", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "List", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Episode", - "Kind": "Enum", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "friends", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "first", - "Description": "Returns the first _n_ elements from the list.", - "Type": { - "__typename": "__Type", - "Name": "Int", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": null - }, - { - "__typename": "__InputValue", - "Name": "after", - "Description": "Returns the elements in the list that come after the specified cursor.", - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": null - }, - { - "__typename": "__InputValue", - "Name": "last", - "Description": "Returns the last _n_ elements from the list.", - "Type": { - "__typename": "__Type", - "Name": "Int", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": null - }, - { - "__typename": "__InputValue", - "Name": "before", - "Description": "Returns the elements in the list that come before the specified cursor.", - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": null - } - ], - "Type": { - "__typename": "__Type", - "Name": "FriendsConnection", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "height", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "unit", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": "Unit", - "Kind": "Enum", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": null - } - ], - "Type": { - "__typename": "__Type", - "Name": "Float", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "primaryFunction", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "traits", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "JSON", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [ - { - "__typename": "__Type", - "Name": "Character", - "Kind": "Interface", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - ], - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "Episode", - "Kind": "Enum", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": [ - { - "__typename": "__EnumValue", - "Name": "NEW_HOPE", - "Description": null, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "EMPIRE", - "Description": null, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "JEDI", - "Description": null, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "Boolean", - "Kind": "Scalar", - "Description": "The `Boolean` scalar type represents `true` or `false`.", - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "Int", - "Kind": "Scalar", - "Description": "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.", - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "Character", - "Kind": "Interface", - "Description": null, - "Fields": [ - { - "__typename": "__Field", - "Name": "id", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "ID", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "name", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "friends", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "first", - "Description": "Returns the first _n_ elements from the list.", - "Type": { - "__typename": "__Type", - "Name": "Int", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": null - }, - { - "__typename": "__InputValue", - "Name": "after", - "Description": "Returns the elements in the list that come after the specified cursor.", - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": null - }, - { - "__typename": "__InputValue", - "Name": "last", - "Description": "Returns the last _n_ elements from the list.", - "Type": { - "__typename": "__Type", - "Name": "Int", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": null - }, - { - "__typename": "__InputValue", - "Name": "before", - "Description": "Returns the elements in the list that come before the specified cursor.", - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": null - } - ], - "Type": { - "__typename": "__Type", - "Name": "FriendsConnection", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "appearsIn", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "List", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Episode", - "Kind": "Enum", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "traits", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "JSON", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "height", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "unit", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": "Unit", - "Kind": "Enum", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": null - } - ], - "Type": { - "__typename": "__Type", - "Name": "Float", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": [ - { - "__typename": "__Type", - "Name": "Human", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "Droid", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - ], - "OfType": null - }, - { - "__typename": "__Type", - "Name": "SearchResult", - "Kind": "Union", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": [ - { - "__typename": "__Type", - "Name": "Starship", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "Human", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "Droid", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - ], - "OfType": null - }, - { - "__typename": "__Type", - "Name": "Review", - "Kind": "Object", - "Description": null, - "Fields": [ - { - "__typename": "__Field", - "Name": "commentary", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "stars", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Int", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "ReviewInput", - "Kind": "InputObject", - "Description": null, - "Fields": null, - "InputFields": [ - { - "__typename": "__InputValue", - "Name": "stars", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Int", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "DefaultValue": null - }, - { - "__typename": "__InputValue", - "Name": "commentary", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": null - } - ], - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "ID", - "Kind": "Scalar", - "Description": "The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.", - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "FriendsConnection", - "Kind": "Object", - "Description": "A connection to a list of items.", - "Fields": [ - { - "__typename": "__Field", - "Name": "pageInfo", - "Description": "Information to aid in pagination.", - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "PageInfo", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "edges", - "Description": "A list of edges.", - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "List", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "FriendsEdge", - "Kind": "Object", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "nodes", - "Description": "A flattened list of the nodes.", - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "List", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Character", - "Kind": "Interface", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "Float", - "Kind": "Scalar", - "Description": "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).", - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "Unit", - "Kind": "Enum", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": [ - { - "__typename": "__EnumValue", - "Name": "FOOT", - "Description": null, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__EnumValue", - "Name": "METERS", - "Description": null, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "JSON", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "Starship", - "Kind": "Object", - "Description": null, - "Fields": [ - { - "__typename": "__Field", - "Name": "id", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "ID", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "name", - "Description": null, - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "length", - "Description": null, - "Args": [ - { - "__typename": "__InputValue", - "Name": "unit", - "Description": null, - "Type": { - "__typename": "__Type", - "Name": "Unit", - "Kind": "Enum", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": null - } - ], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Float", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "PageInfo", - "Kind": "Object", - "Description": "Information about pagination in a connection.", - "Fields": [ - { - "__typename": "__Field", - "Name": "hasNextPage", - "Description": "Indicates whether more edges exist following the set defined by the clients arguments.", - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Boolean", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "hasPreviousPage", - "Description": "Indicates whether more edges exist prior the set defined by the clients arguments.", - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Boolean", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "startCursor", - "Description": "When paginating backwards, the cursor to continue.", - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "endCursor", - "Description": "When paginating forwards, the cursor to continue.", - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - { - "__typename": "__Type", - "Name": "FriendsEdge", - "Kind": "Object", - "Description": "An edge in a connection.", - "Fields": [ - { - "__typename": "__Field", - "Name": "cursor", - "Description": "A cursor for use in pagination.", - "Args": [], - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "IsDeprecated": false, - "DeprecationReason": null - }, - { - "__typename": "__Field", - "Name": "node", - "Description": "The item at the end of the edge.", - "Args": [], - "Type": { - "__typename": "__Type", - "Name": "Character", - "Kind": "Interface", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "IsDeprecated": false, - "DeprecationReason": null - } - ], - "InputFields": null, - "Interfaces": [], - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - ], - "Directives": [ - { - "__typename": "__Directive", - "Name": "defer", - "Description": "The `@defer` directive may be provided for fragment spreads and inline fragments to inform the executor to delay the execution of the current fragment to indicate deprioritization of the current fragment. A query with `@defer` directive will cause the request to potentially return multiple responses, where non-deferred data is delivered in the initial response and data deferred is delivered in a subsequent response. `@include` and `@skip` take precedence over `@defer`.", - "Args": [ - { - "__typename": "__InputValue", - "Name": "label", - "Description": "If this argument label has a value other than null, it will be passed on to the result of this defer directive. This label is intended to give client applications a way to identify to which fragment a deferred result belongs to.", - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": null - }, - { - "__typename": "__InputValue", - "Name": "if", - "Description": "Deferred when true.", - "Type": { - "__typename": "__Type", - "Name": "Boolean", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": null - } - ], - "OnOperation": false, - "OnFragment": true, - "OnField": false - }, - { - "__typename": "__Directive", - "Name": "stream", - "Description": "The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`.", - "Args": [ - { - "__typename": "__InputValue", - "Name": "label", - "Description": "If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to.", - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": null - }, - { - "__typename": "__InputValue", - "Name": "initialCount", - "Description": "The initial elements that shall be send down to the consumer.", - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Int", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "DefaultValue": "0" - }, - { - "__typename": "__InputValue", - "Name": "if", - "Description": "Streamed when true.", - "Type": { - "__typename": "__Type", - "Name": "Boolean", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": null - } - ], - "OnOperation": false, - "OnFragment": false, - "OnField": true - }, - { - "__typename": "__Directive", - "Name": "skip", - "Description": "Directs the executor to skip this field or fragment when the `if` argument is true.", - "Args": [ - { - "__typename": "__InputValue", - "Name": "if", - "Description": "Skipped when true.", - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Boolean", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "DefaultValue": null - } - ], - "OnOperation": false, - "OnFragment": true, - "OnField": true - }, - { - "__typename": "__Directive", - "Name": "include", - "Description": "Directs the executor to include this field or fragment only when the `if` argument is true.", - "Args": [ - { - "__typename": "__InputValue", - "Name": "if", - "Description": "Included when true.", - "Type": { - "__typename": "__Type", - "Name": null, - "Kind": "NonNull", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": { - "__typename": "__Type", - "Name": "Boolean", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - } - }, - "DefaultValue": null - } - ], - "OnOperation": false, - "OnFragment": true, - "OnField": true - }, - { - "__typename": "__Directive", - "Name": "deprecated", - "Description": "The @deprecated directive is used within the type system definition language to indicate deprecated portions of a GraphQL service’s schema,such as deprecated fields on a type or deprecated enum values.", - "Args": [ - { - "__typename": "__InputValue", - "Name": "reason", - "Description": "Deprecations include a reason for why it is deprecated, which is formatted using Markdown syntax (as specified by CommonMark).", - "Type": { - "__typename": "__Type", - "Name": "String", - "Kind": "Scalar", - "Description": null, - "Fields": null, - "InputFields": null, - "Interfaces": null, - "EnumValues": null, - "PossibleTypes": null, - "OfType": null - }, - "DefaultValue": "\"No longer supported.\"" - } - ], - "OnOperation": false, - "OnFragment": false, - "OnField": false - } - ] - }, - "EntityIds": [], - "Version": 1 - }, - "DataFactory": {}, - "Errors": [], - "Extensions": {}, - "ContextData": {} -} diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_Combined.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_Combined.snap index 82f59346438..9c7b7755a02 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_Combined.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_Combined.snap @@ -485,8 +485,78 @@ namespace Foo.Bar public static GetPersonQueryDocument Instance { get; } = new GetPersonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "c11160a60d74905834b4c99aa93c6523954df324"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -522,6 +592,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -596,8 +667,86 @@ namespace Foo.Bar public static OnPersonSubscriptionDocument Instance { get; } = new OnPersonSubscriptionDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Subscription; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4f, 0x6e, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x73, + 0x75, + 0x62, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x4f, + 0x6e, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x6f, + 0x6e, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "c3ed517156362cb7471bdf5a8737d05dae09940c"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -633,6 +782,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IOnPersonResult); + public global::System.IObservable> Watch(global::StrawberryShake.ExecutionStrategy? strategy = null) { var request = CreateRequest(); @@ -700,8 +850,97 @@ namespace Foo.Bar public static CreatePersonMutationDocument Instance { get; } = new CreatePersonMutationDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Mutation; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x28, 0x69, 0x64, 0x3a, 0x20, 0x31, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x6d, + 0x75, + 0x74, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x43, + 0x72, + 0x65, + 0x61, + 0x74, + 0x65, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x63, + 0x72, + 0x65, + 0x61, + 0x74, + 0x65, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x28, + 0x69, + 0x64, + 0x3a, + 0x20, + 0x31, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "36eb0176de845ee1b1deda2d3edd28d5debbc50a"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -737,6 +976,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ICreatePersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -852,6 +1092,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPersonResult); + public GetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -902,9 +1143,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPersonResultInfo(Person, _entityIds, version); @@ -924,6 +1165,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IOnPersonResult); + public OnPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -974,9 +1216,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? OnPerson { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new OnPersonResultInfo(OnPerson, _entityIds, version); @@ -996,6 +1238,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ICreatePersonResult); + public CreatePersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -1046,9 +1289,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? CreatePerson { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new CreatePersonResultInfo(CreatePerson, _entityIds, version); @@ -1354,7 +1597,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_DifferentTransportMethods.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_DifferentTransportMethods.snap index b7224a9fb5c..79d958bb52c 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_DifferentTransportMethods.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_DifferentTransportMethods.snap @@ -485,8 +485,78 @@ namespace Foo.Bar public static GetPersonQueryDocument Instance { get; } = new GetPersonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "c11160a60d74905834b4c99aa93c6523954df324"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -522,6 +592,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -596,8 +667,86 @@ namespace Foo.Bar public static OnPersonSubscriptionDocument Instance { get; } = new OnPersonSubscriptionDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Subscription; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4f, 0x6e, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x73, + 0x75, + 0x62, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x4f, + 0x6e, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x6f, + 0x6e, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "c3ed517156362cb7471bdf5a8737d05dae09940c"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -633,6 +782,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IOnPersonResult); + public global::System.IObservable> Watch(global::StrawberryShake.ExecutionStrategy? strategy = null) { var request = CreateRequest(); @@ -700,8 +850,97 @@ namespace Foo.Bar public static CreatePersonMutationDocument Instance { get; } = new CreatePersonMutationDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Mutation; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x28, 0x69, 0x64, 0x3a, 0x20, 0x31, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x6d, + 0x75, + 0x74, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x43, + 0x72, + 0x65, + 0x61, + 0x74, + 0x65, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x63, + 0x72, + 0x65, + 0x61, + 0x74, + 0x65, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x28, + 0x69, + 0x64, + 0x3a, + 0x20, + 0x31, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "36eb0176de845ee1b1deda2d3edd28d5debbc50a"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -737,6 +976,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ICreatePersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -852,6 +1092,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPersonResult); + public GetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -902,9 +1143,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPersonResultInfo(Person, _entityIds, version); @@ -924,6 +1165,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IOnPersonResult); + public OnPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -974,9 +1216,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? OnPerson { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new OnPersonResultInfo(OnPerson, _entityIds, version); @@ -996,6 +1238,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ICreatePersonResult); + public CreatePersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -1046,9 +1289,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? CreatePerson { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new CreatePersonResultInfo(CreatePerson, _entityIds, version); @@ -1354,7 +1597,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_InMemory.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_InMemory.snap index e5349ab831d..32a28fba6d4 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_InMemory.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_InMemory.snap @@ -485,8 +485,78 @@ namespace Foo.Bar public static GetPersonQueryDocument Instance { get; } = new GetPersonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "c11160a60d74905834b4c99aa93c6523954df324"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -522,6 +592,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -596,8 +667,86 @@ namespace Foo.Bar public static OnPersonSubscriptionDocument Instance { get; } = new OnPersonSubscriptionDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Subscription; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4f, 0x6e, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x73, + 0x75, + 0x62, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x4f, + 0x6e, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x6f, + 0x6e, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "c3ed517156362cb7471bdf5a8737d05dae09940c"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -633,6 +782,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IOnPersonResult); + public global::System.IObservable> Watch(global::StrawberryShake.ExecutionStrategy? strategy = null) { var request = CreateRequest(); @@ -700,8 +850,97 @@ namespace Foo.Bar public static CreatePersonMutationDocument Instance { get; } = new CreatePersonMutationDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Mutation; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x28, 0x69, 0x64, 0x3a, 0x20, 0x31, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x6d, + 0x75, + 0x74, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x43, + 0x72, + 0x65, + 0x61, + 0x74, + 0x65, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x63, + 0x72, + 0x65, + 0x61, + 0x74, + 0x65, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x28, + 0x69, + 0x64, + 0x3a, + 0x20, + 0x31, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "36eb0176de845ee1b1deda2d3edd28d5debbc50a"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -737,6 +976,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ICreatePersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -852,6 +1092,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPersonResult); + public GetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -902,9 +1143,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPersonResultInfo(Person, _entityIds, version); @@ -924,6 +1165,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IOnPersonResult); + public OnPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -974,9 +1216,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? OnPerson { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new OnPersonResultInfo(OnPerson, _entityIds, version); @@ -996,6 +1238,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ICreatePersonResult); + public CreatePersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -1046,9 +1289,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? CreatePerson { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new CreatePersonResultInfo(CreatePerson, _entityIds, version); @@ -1354,7 +1597,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_MultiProfile.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_MultiProfile.snap index 5dffef6c87b..2a9a722f895 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_MultiProfile.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_MultiProfile.snap @@ -485,8 +485,78 @@ namespace Foo.Bar public static GetPersonQueryDocument Instance { get; } = new GetPersonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "c11160a60d74905834b4c99aa93c6523954df324"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -522,6 +592,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -596,8 +667,86 @@ namespace Foo.Bar public static OnPersonSubscriptionDocument Instance { get; } = new OnPersonSubscriptionDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Subscription; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4f, 0x6e, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x73, + 0x75, + 0x62, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x4f, + 0x6e, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x6f, + 0x6e, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "c3ed517156362cb7471bdf5a8737d05dae09940c"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -633,6 +782,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IOnPersonResult); + public global::System.IObservable> Watch(global::StrawberryShake.ExecutionStrategy? strategy = null) { var request = CreateRequest(); @@ -700,8 +850,97 @@ namespace Foo.Bar public static CreatePersonMutationDocument Instance { get; } = new CreatePersonMutationDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Mutation; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x28, 0x69, 0x64, 0x3a, 0x20, 0x31, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x6d, + 0x75, + 0x74, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x43, + 0x72, + 0x65, + 0x61, + 0x74, + 0x65, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x63, + 0x72, + 0x65, + 0x61, + 0x74, + 0x65, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x28, + 0x69, + 0x64, + 0x3a, + 0x20, + 0x31, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "36eb0176de845ee1b1deda2d3edd28d5debbc50a"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -737,6 +976,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ICreatePersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -860,6 +1100,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPersonResult); + public GetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -910,9 +1151,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPersonResultInfo(Person, _entityIds, version); @@ -932,6 +1173,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IOnPersonResult); + public OnPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -982,9 +1224,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? OnPerson { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new OnPersonResultInfo(OnPerson, _entityIds, version); @@ -1004,6 +1246,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ICreatePersonResult); + public CreatePersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -1054,9 +1297,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? CreatePerson { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new CreatePersonResultInfo(CreatePerson, _entityIds, version); @@ -1362,7 +1605,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_Mutation.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_Mutation.snap index 357546b92f2..6a6a27bb320 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_Mutation.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_Mutation.snap @@ -189,8 +189,97 @@ namespace Foo.Bar public static CreatePersonMutationDocument Instance { get; } = new CreatePersonMutationDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Mutation; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x28, 0x69, 0x64, 0x3a, 0x20, 0x31, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x6d, + 0x75, + 0x74, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x43, + 0x72, + 0x65, + 0x61, + 0x74, + 0x65, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x63, + 0x72, + 0x65, + 0x61, + 0x74, + 0x65, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x28, + 0x69, + 0x64, + 0x3a, + 0x20, + 0x31, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "36eb0176de845ee1b1deda2d3edd28d5debbc50a"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -226,6 +315,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ICreatePersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -331,6 +421,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ICreatePersonResult); + public CreatePersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -381,9 +472,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? CreatePerson { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new CreatePersonResultInfo(CreatePerson, _entityIds, version); @@ -493,7 +584,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_Query.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_Query.snap index 2b3ff6357cb..b1b924ed4cc 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_Query.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_Query.snap @@ -189,8 +189,78 @@ namespace Foo.Bar public static GetPersonQueryDocument Instance { get; } = new GetPersonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "c11160a60d74905834b4c99aa93c6523954df324"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -226,6 +296,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -331,6 +402,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPersonResult); + public GetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -381,9 +453,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPersonResultInfo(Person, _entityIds, version); @@ -493,7 +565,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_Subscription.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_Subscription.snap index 57a4c94efaa..4ad4ad1d72b 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_Subscription.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/DependencyInjectionGeneratorTests.Default_Subscription.snap @@ -189,8 +189,86 @@ namespace Foo.Bar public static OnPersonSubscriptionDocument Instance { get; } = new OnPersonSubscriptionDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Subscription; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4f, 0x6e, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x73, + 0x75, + 0x62, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x4f, + 0x6e, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x6f, + 0x6e, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "c3ed517156362cb7471bdf5a8737d05dae09940c"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -226,6 +304,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IOnPersonResult); + public global::System.IObservable> Watch(global::StrawberryShake.ExecutionStrategy? strategy = null) { var request = CreateRequest(); @@ -324,6 +403,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IOnPersonResult); + public OnPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -374,9 +454,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? OnPerson { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new OnPersonResultInfo(OnPerson, _entityIds, version); @@ -486,7 +566,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataInEntity_UnionDataTypes.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataInEntity_UnionDataTypes.snap index e799f6eed4a..8e026e628f0 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataInEntity_UnionDataTypes.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataInEntity_UnionDataTypes.snap @@ -91,9 +91,7 @@ namespace Foo.Bar } public global::System.String Id { get; } - public global::System.Collections.Generic.IReadOnlyList? Books { get; } - public global::Foo.Bar.IGetStore2_SearchableStore_Search? Search { get; } public virtual global::System.Boolean Equals(GetStore2_SearchableStore_SearchableStore? other) @@ -174,7 +172,6 @@ namespace Foo.Bar } public global::System.String Isbn { get; } - public global::System.String Title { get; } public virtual global::System.Boolean Equals(GetStore2_SearchableStore_Books_Book? other) @@ -298,7 +295,6 @@ namespace Foo.Bar } public global::System.String Title { get; } - public global::System.String Isbn { get; } public virtual global::System.Boolean Equals(GetStore2_SearchableStore_Search_Book? other) @@ -365,9 +361,7 @@ namespace Foo.Bar public partial interface IGetStore2_SearchableStore { public global::System.String Id { get; } - public global::System.Collections.Generic.IReadOnlyList? Books { get; } - public global::Foo.Bar.IGetStore2_SearchableStore_Search? Search { get; } } @@ -382,7 +376,6 @@ namespace Foo.Bar public partial interface IGetStore2_SearchableStore_Books { public global::System.String Isbn { get; } - public global::System.String Title { get; } } @@ -409,7 +402,6 @@ namespace Foo.Bar public partial interface IGetStore2_SearchableStore_Search_Book : IGetStore2_SearchableStore_Search { public global::System.String Title { get; } - public global::System.String Isbn { get; } } @@ -449,8 +441,175 @@ namespace Foo.Bar public static GetStore2QueryDocument Instance { get; } = new GetStore2QueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x32, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x64, 0x20, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x73, 0x62, 0x6e, 0x20, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x20, 0x7d, 0x20, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x6f, 0x6f, 0x6b, 0x20, 0x7b, 0x20, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x20, 0x69, 0x73, 0x62, 0x6e, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x53, + 0x74, + 0x6f, + 0x72, + 0x65, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x61, + 0x62, + 0x6c, + 0x65, + 0x53, + 0x74, + 0x6f, + 0x72, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x64, + 0x20, + 0x62, + 0x6f, + 0x6f, + 0x6b, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x73, + 0x62, + 0x6e, + 0x20, + 0x74, + 0x69, + 0x74, + 0x6c, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x73, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x6f, + 0x6f, + 0x6b, + 0x20, + 0x7b, + 0x20, + 0x74, + 0x69, + 0x74, + 0x6c, + 0x65, + 0x20, + 0x69, + 0x73, + 0x62, + 0x6e, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x53, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x61, + 0x62, + 0x6c, + 0x65, + 0x53, + 0x74, + 0x6f, + 0x72, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "3319c32a6efc271a924c607e95150aabe701c260"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -498,6 +657,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetStore2Result); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -602,9 +762,7 @@ namespace Foo.Bar.State } public global::System.String Id { get; } - public global::System.Collections.Generic.IReadOnlyList? Books { get; } - public global::Foo.Bar.State.ISearchResultData? Search { get; } } @@ -621,6 +779,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetStore2Result); + public GetStore2Result Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -666,9 +825,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId SearchableStore { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetStore2ResultInfo(SearchableStore, _entityIds, version); @@ -846,9 +1005,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Isbn { get; } - public global::System.String? Title { get; } } @@ -950,7 +1107,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataInEntity_UnionDataTypes_With_Records.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataInEntity_UnionDataTypes_With_Records.snap index 1ecf4510ccd..70fa62c3bda 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataInEntity_UnionDataTypes_With_Records.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataInEntity_UnionDataTypes_With_Records.snap @@ -91,9 +91,7 @@ namespace Foo.Bar } public global::System.String Id { get; } - public global::System.Collections.Generic.IReadOnlyList? Books { get; } - public global::Foo.Bar.IGetStore2_SearchableStore_Search? Search { get; } public virtual global::System.Boolean Equals(GetStore2_SearchableStore_SearchableStore? other) @@ -174,7 +172,6 @@ namespace Foo.Bar } public global::System.String Isbn { get; } - public global::System.String Title { get; } public virtual global::System.Boolean Equals(GetStore2_SearchableStore_Books_Book? other) @@ -298,7 +295,6 @@ namespace Foo.Bar } public global::System.String Title { get; } - public global::System.String Isbn { get; } public virtual global::System.Boolean Equals(GetStore2_SearchableStore_Search_Book? other) @@ -365,9 +361,7 @@ namespace Foo.Bar public partial interface IGetStore2_SearchableStore { public global::System.String Id { get; } - public global::System.Collections.Generic.IReadOnlyList? Books { get; } - public global::Foo.Bar.IGetStore2_SearchableStore_Search? Search { get; } } @@ -382,7 +376,6 @@ namespace Foo.Bar public partial interface IGetStore2_SearchableStore_Books { public global::System.String Isbn { get; } - public global::System.String Title { get; } } @@ -409,7 +402,6 @@ namespace Foo.Bar public partial interface IGetStore2_SearchableStore_Search_Book : IGetStore2_SearchableStore_Search { public global::System.String Title { get; } - public global::System.String Isbn { get; } } @@ -449,8 +441,175 @@ namespace Foo.Bar public static GetStore2QueryDocument Instance { get; } = new GetStore2QueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x32, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x64, 0x20, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x73, 0x62, 0x6e, 0x20, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x20, 0x7d, 0x20, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x6f, 0x6f, 0x6b, 0x20, 0x7b, 0x20, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x20, 0x69, 0x73, 0x62, 0x6e, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x53, + 0x74, + 0x6f, + 0x72, + 0x65, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x61, + 0x62, + 0x6c, + 0x65, + 0x53, + 0x74, + 0x6f, + 0x72, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x64, + 0x20, + 0x62, + 0x6f, + 0x6f, + 0x6b, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x73, + 0x62, + 0x6e, + 0x20, + 0x74, + 0x69, + 0x74, + 0x6c, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x73, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x6f, + 0x6f, + 0x6b, + 0x20, + 0x7b, + 0x20, + 0x74, + 0x69, + 0x74, + 0x6c, + 0x65, + 0x20, + 0x69, + 0x73, + 0x62, + 0x6e, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x53, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x61, + 0x62, + 0x6c, + 0x65, + 0x53, + 0x74, + 0x6f, + 0x72, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "3319c32a6efc271a924c607e95150aabe701c260"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -498,6 +657,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetStore2Result); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -602,9 +762,7 @@ namespace Foo.Bar.State } public global::System.String Id { get; init; } - public global::System.Collections.Generic.IReadOnlyList? Books { get; init; } - public global::Foo.Bar.State.ISearchResultData? Search { get; init; } } @@ -621,6 +779,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetStore2Result); + public GetStore2Result Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -666,9 +825,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId SearchableStore { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetStore2ResultInfo(SearchableStore, _entityIds, version); @@ -846,9 +1005,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; init; } - public global::System.String? Isbn { get; init; } - public global::System.String? Title { get; init; } } @@ -950,7 +1107,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataOnly_InterfaceDataTypes.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataOnly_InterfaceDataTypes.snap index fda2d7b7f62..cb278441956 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataOnly_InterfaceDataTypes.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataOnly_InterfaceDataTypes.snap @@ -100,7 +100,6 @@ namespace Foo.Bar } public global::System.String Isbn { get; } - public global::System.String Title { get; } public virtual global::System.Boolean Equals(SearchSomething_Prints_Book? other) @@ -166,7 +165,6 @@ namespace Foo.Bar } public global::System.String Isbn { get; } - public global::System.String? CoverImageUrl { get; } public virtual global::System.Boolean Equals(SearchSomething_Prints_Magazine? other) @@ -280,8 +278,119 @@ namespace Foo.Bar public static SearchSomethingQueryDocument Instance { get; } = new SearchSomethingQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x20, 0x7b, 0x20, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x73, 0x62, 0x6e, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x6f, 0x6f, 0x6b, 0x20, 0x7b, 0x20, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x4d, 0x61, 0x67, 0x61, 0x7a, 0x69, 0x6e, 0x65, 0x20, 0x7b, 0x20, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x53, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x53, + 0x6f, + 0x6d, + 0x65, + 0x74, + 0x68, + 0x69, + 0x6e, + 0x67, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x72, + 0x69, + 0x6e, + 0x74, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x73, + 0x62, + 0x6e, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x6f, + 0x6f, + 0x6b, + 0x20, + 0x7b, + 0x20, + 0x74, + 0x69, + 0x74, + 0x6c, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4d, + 0x61, + 0x67, + 0x61, + 0x7a, + 0x69, + 0x6e, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x63, + 0x6f, + 0x76, + 0x65, + 0x72, + 0x49, + 0x6d, + 0x61, + 0x67, + 0x65, + 0x55, + 0x72, + 0x6c, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "7a4fedad68dbe533ab701426db5e156d911a5b2f"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -320,6 +429,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ISearchSomethingResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -414,6 +524,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ISearchSomethingResult); + public SearchSomethingResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -489,9 +600,9 @@ namespace Foo.Bar.State } public global::System.Collections.Generic.IReadOnlyList? Prints { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new SearchSomethingResultInfo(Prints, _entityIds, version); @@ -630,9 +741,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Isbn { get; } - public global::System.String? Title { get; } } @@ -648,9 +757,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Isbn { get; } - public global::System.String? CoverImageUrl { get; } } @@ -659,7 +766,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataOnly_InterfaceDataTypes_With_Records.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataOnly_InterfaceDataTypes_With_Records.snap index d7bcb7e78b1..19d4a9a60fa 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataOnly_InterfaceDataTypes_With_Records.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataOnly_InterfaceDataTypes_With_Records.snap @@ -100,7 +100,6 @@ namespace Foo.Bar } public global::System.String Isbn { get; } - public global::System.String Title { get; } public virtual global::System.Boolean Equals(SearchSomething_Prints_Book? other) @@ -166,7 +165,6 @@ namespace Foo.Bar } public global::System.String Isbn { get; } - public global::System.String? CoverImageUrl { get; } public virtual global::System.Boolean Equals(SearchSomething_Prints_Magazine? other) @@ -280,8 +278,119 @@ namespace Foo.Bar public static SearchSomethingQueryDocument Instance { get; } = new SearchSomethingQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x20, 0x7b, 0x20, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x73, 0x62, 0x6e, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x6f, 0x6f, 0x6b, 0x20, 0x7b, 0x20, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x4d, 0x61, 0x67, 0x61, 0x7a, 0x69, 0x6e, 0x65, 0x20, 0x7b, 0x20, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x53, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x53, + 0x6f, + 0x6d, + 0x65, + 0x74, + 0x68, + 0x69, + 0x6e, + 0x67, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x72, + 0x69, + 0x6e, + 0x74, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x73, + 0x62, + 0x6e, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x6f, + 0x6f, + 0x6b, + 0x20, + 0x7b, + 0x20, + 0x74, + 0x69, + 0x74, + 0x6c, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4d, + 0x61, + 0x67, + 0x61, + 0x7a, + 0x69, + 0x6e, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x63, + 0x6f, + 0x76, + 0x65, + 0x72, + 0x49, + 0x6d, + 0x61, + 0x67, + 0x65, + 0x55, + 0x72, + 0x6c, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "7a4fedad68dbe533ab701426db5e156d911a5b2f"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -320,6 +429,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ISearchSomethingResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -414,6 +524,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ISearchSomethingResult); + public SearchSomethingResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -489,9 +600,9 @@ namespace Foo.Bar.State } public global::System.Collections.Generic.IReadOnlyList? Prints { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new SearchSomethingResultInfo(Prints, _entityIds, version); @@ -630,9 +741,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; init; } - public global::System.String? Isbn { get; init; } - public global::System.String? Title { get; init; } } @@ -648,9 +757,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; init; } - public global::System.String? Isbn { get; init; } - public global::System.String? CoverImageUrl { get; init; } } @@ -659,7 +766,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataOnly_UnionDataTypes.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataOnly_UnionDataTypes.snap index b39b224f724..ff611ac3ee8 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataOnly_UnionDataTypes.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataOnly_UnionDataTypes.snap @@ -260,8 +260,103 @@ namespace Foo.Bar public static SearchSomethingQueryDocument Instance { get; } = new SearchSomethingQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x6f, 0x6f, 0x6b, 0x20, 0x7b, 0x20, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x53, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x53, + 0x6f, + 0x6d, + 0x65, + 0x74, + 0x68, + 0x69, + 0x6e, + 0x67, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x41, + 0x75, + 0x74, + 0x68, + 0x6f, + 0x72, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x6f, + 0x6f, + 0x6b, + 0x20, + 0x7b, + 0x20, + 0x74, + 0x69, + 0x74, + 0x6c, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "66043ca93911dbadcf22907978f9c38f3cc096ae"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -299,6 +394,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ISearchSomethingResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -392,6 +488,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ISearchSomethingResult); + public SearchSomethingResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -451,9 +548,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.ISearchResultData? Search { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new SearchSomethingResultInfo(Search, _entityIds, version); @@ -548,7 +645,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } } @@ -570,7 +666,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Title { get; } } @@ -579,7 +674,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataOnly_UnionDataTypes_With_Records.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataOnly_UnionDataTypes_With_Records.snap index 4f7650b1d54..dedd4e913a9 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataOnly_UnionDataTypes_With_Records.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_BookClient_DataOnly_UnionDataTypes_With_Records.snap @@ -260,8 +260,103 @@ namespace Foo.Bar public static SearchSomethingQueryDocument Instance { get; } = new SearchSomethingQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x6f, 0x6f, 0x6b, 0x20, 0x7b, 0x20, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x53, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x53, + 0x6f, + 0x6d, + 0x65, + 0x74, + 0x68, + 0x69, + 0x6e, + 0x67, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x41, + 0x75, + 0x74, + 0x68, + 0x6f, + 0x72, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x6f, + 0x6f, + 0x6b, + 0x20, + 0x7b, + 0x20, + 0x74, + 0x69, + 0x74, + 0x6c, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "66043ca93911dbadcf22907978f9c38f3cc096ae"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -299,6 +394,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ISearchSomethingResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -392,6 +488,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ISearchSomethingResult); + public SearchSomethingResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -451,9 +548,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.ISearchResultData? Search { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new SearchSomethingResultInfo(Search, _entityIds, version); @@ -548,7 +645,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; init; } - public global::System.String? Name { get; init; } } @@ -570,7 +666,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; init; } - public global::System.String? Title { get; init; } } @@ -579,7 +674,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_ChatClient_ConnectionNotAnEntity.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_ChatClient_ConnectionNotAnEntity.snap index df8bbcbf38e..67043ed1e37 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_ChatClient_ConnectionNotAnEntity.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_ChatClient_ConnectionNotAnEntity.snap @@ -185,12 +185,10 @@ namespace Foo.Bar /// Field name /// public global::System.String Name { get; } - /// /// Field email /// public global::System.String Email { get; } - /// /// Field isOnline /// @@ -295,12 +293,10 @@ namespace Foo.Bar /// Field name /// public global::System.String Name { get; } - /// /// Field email /// public global::System.String Email { get; } - /// /// Field isOnline /// @@ -345,8 +341,139 @@ namespace Foo.Bar public static GetPeopleQueryDocument Instance { get; } = new GetPeopleQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x28, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x3a, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x41, 0x53, 0x43, 0x20, 0x7d, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x69, 0x73, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x28, + 0x6f, + 0x72, + 0x64, + 0x65, + 0x72, + 0x5f, + 0x62, + 0x79, + 0x3a, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x3a, + 0x20, + 0x41, + 0x53, + 0x43, + 0x20, + 0x7d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x6f, + 0x64, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x20, + 0x69, + 0x73, + 0x4f, + 0x6e, + 0x6c, + 0x69, + 0x6e, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "4b9666a143384a9c7ccc4410ea4026c9b68ee86c"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -387,6 +514,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPeopleResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -486,10 +614,8 @@ namespace Foo.Bar.State ///Field name public global::System.String Name { get; } - ///Field email public global::System.String Email { get; } - ///Field isOnline public global::System.Boolean IsOnline { get; } } @@ -507,6 +633,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPeopleResult); + public GetPeopleResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -596,9 +723,9 @@ namespace Foo.Bar.State /// Gets access to all the people known to this service. /// public global::Foo.Bar.State.PersonConnectionData? People { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPeopleResultInfo(People, _entityIds, version); @@ -753,7 +880,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - ///A flattened list of the nodes. public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } } @@ -784,7 +910,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_ChatClient_ConnectionNotAnEntity_With_Records.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_ChatClient_ConnectionNotAnEntity_With_Records.snap index 991563eab3b..d6485d5452a 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_ChatClient_ConnectionNotAnEntity_With_Records.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_ChatClient_ConnectionNotAnEntity_With_Records.snap @@ -185,12 +185,10 @@ namespace Foo.Bar /// Field name /// public global::System.String Name { get; } - /// /// Field email /// public global::System.String Email { get; } - /// /// Field isOnline /// @@ -295,12 +293,10 @@ namespace Foo.Bar /// Field name /// public global::System.String Name { get; } - /// /// Field email /// public global::System.String Email { get; } - /// /// Field isOnline /// @@ -345,8 +341,139 @@ namespace Foo.Bar public static GetPeopleQueryDocument Instance { get; } = new GetPeopleQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x28, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x3a, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x41, 0x53, 0x43, 0x20, 0x7d, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x69, 0x73, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x28, + 0x6f, + 0x72, + 0x64, + 0x65, + 0x72, + 0x5f, + 0x62, + 0x79, + 0x3a, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x3a, + 0x20, + 0x41, + 0x53, + 0x43, + 0x20, + 0x7d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x6f, + 0x64, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x20, + 0x69, + 0x73, + 0x4f, + 0x6e, + 0x6c, + 0x69, + 0x6e, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "4b9666a143384a9c7ccc4410ea4026c9b68ee86c"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -387,6 +514,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPeopleResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -486,10 +614,8 @@ namespace Foo.Bar.State ///Field name public global::System.String Name { get; init; } - ///Field email public global::System.String Email { get; init; } - ///Field isOnline public global::System.Boolean IsOnline { get; init; } } @@ -507,6 +633,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPeopleResult); + public GetPeopleResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -596,9 +723,9 @@ namespace Foo.Bar.State /// Gets access to all the people known to this service. /// public global::Foo.Bar.State.PersonConnectionData? People { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPeopleResultInfo(People, _entityIds, version); @@ -753,7 +880,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; init; } - ///A flattened list of the nodes. public global::System.Collections.Generic.IReadOnlyList? Nodes { get; init; } } @@ -784,7 +910,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_ChatClient_MapperMapsEntityOnRootCorrectly.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_ChatClient_MapperMapsEntityOnRootCorrectly.snap index 16e8f4c39ca..1c170967b0f 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_ChatClient_MapperMapsEntityOnRootCorrectly.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_ChatClient_MapperMapsEntityOnRootCorrectly.snap @@ -184,7 +184,6 @@ namespace Foo.Bar /// Field name /// public global::System.String Name { get; } - /// /// Field messages /// @@ -341,7 +340,6 @@ namespace Foo.Bar /// Field sender /// public global::Foo.Bar.IGetPeople_People_Nodes_Messages_Nodes_Sender Sender { get; } - /// /// Field text /// @@ -570,7 +568,6 @@ namespace Foo.Bar /// Field sender /// public global::Foo.Bar.IGetPeople_People_Nodes_Messages_Nodes_Sender Sender { get; } - /// /// Field text /// @@ -766,7 +763,6 @@ namespace Foo.Bar /// Field sender /// public global::Foo.Bar.IGetPeople_People_Nodes_Messages_Nodes_Sender Sender { get; } - /// /// Field text /// @@ -1015,8 +1011,335 @@ namespace Foo.Bar public static GetPeopleQueryDocument Instance { get; } = new GetPeopleQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x28, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x3a, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x41, 0x53, 0x43, 0x20, 0x7d, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x28, + 0x6f, + 0x72, + 0x64, + 0x65, + 0x72, + 0x5f, + 0x62, + 0x79, + 0x3a, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x3a, + 0x20, + 0x41, + 0x53, + 0x43, + 0x20, + 0x7d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x6f, + 0x64, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x6d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x6f, + 0x64, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x65, + 0x6e, + 0x64, + 0x65, + 0x72, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x74, + 0x65, + 0x78, + 0x74, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "0967ca09947e3a18370454229ece650b8ba8e2ef"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -1080,6 +1403,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPeopleResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -1200,8 +1524,331 @@ namespace Foo.Bar public static WriteMessageMutationDocument Instance { get; } = new WriteMessageMutationDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Mutation; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x28, 0x24, 0x74, 0x65, 0x78, 0x74, 0x3a, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x21, 0x2c, 0x20, 0x24, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x28, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x20, 0x7b, 0x20, 0x74, 0x65, 0x78, 0x74, 0x3a, 0x20, 0x24, 0x74, 0x65, 0x78, 0x74, 0x2c, 0x20, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x3a, 0x20, 0x24, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x7d, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x6d, + 0x75, + 0x74, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x57, + 0x72, + 0x69, + 0x74, + 0x65, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x28, + 0x24, + 0x74, + 0x65, + 0x78, + 0x74, + 0x3a, + 0x20, + 0x53, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x61, + 0x64, + 0x64, + 0x72, + 0x65, + 0x73, + 0x73, + 0x3a, + 0x20, + 0x53, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x65, + 0x6e, + 0x64, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x28, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x3a, + 0x20, + 0x7b, + 0x20, + 0x74, + 0x65, + 0x78, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x74, + 0x65, + 0x78, + 0x74, + 0x2c, + 0x20, + 0x72, + 0x65, + 0x63, + 0x69, + 0x70, + 0x69, + 0x65, + 0x6e, + 0x74, + 0x45, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x3a, + 0x20, + 0x24, + 0x61, + 0x64, + 0x64, + 0x72, + 0x65, + 0x73, + 0x73, + 0x20, + 0x7d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x65, + 0x6e, + 0x64, + 0x65, + 0x72, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x74, + 0x65, + 0x78, + 0x74, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "5b649ed10b73d2f35595b9d5f11fee8759ac4d72"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -1257,6 +1904,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IWriteMessageResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.String text, global::System.String address, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(text, address); @@ -1396,7 +2044,6 @@ namespace Foo.Bar.State ///Field name public global::System.String Name { get; } - ///Field messages public global::Foo.Bar.State.MessageConnectionData? Messages { get; } } @@ -1414,7 +2061,6 @@ namespace Foo.Bar.State ///Field sender public global::StrawberryShake.EntityId Sender { get; } - ///Field text public global::System.String Text { get; } } @@ -1436,6 +2082,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPeopleResult); + public GetPeopleResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -1586,9 +2233,9 @@ namespace Foo.Bar.State /// Gets access to all the people known to this service. /// public global::Foo.Bar.State.PersonConnectionData? People { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPeopleResultInfo(People, _entityIds, version); @@ -1610,6 +2257,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IWriteMessageResult); + public WriteMessageResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -1683,9 +2331,9 @@ namespace Foo.Bar.State /// Field sendMessage /// public global::Foo.Bar.State.SendMessagePayloadData SendMessage { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new WriteMessageResultInfo(SendMessage, _entityIds, version); @@ -2056,7 +2704,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - ///A flattened list of the nodes. public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } } @@ -2073,7 +2720,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - ///A flattened list of the nodes. public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } } @@ -2090,7 +2736,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - ///Field message public global::StrawberryShake.EntityId? Message { get; } } @@ -2294,7 +2939,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_ChatClient_MapperMapsEntityOnRootCorrectly_With_Records.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_ChatClient_MapperMapsEntityOnRootCorrectly_With_Records.snap index 58203f18130..bcaf7003074 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_ChatClient_MapperMapsEntityOnRootCorrectly_With_Records.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityGeneratorTests.Generate_ChatClient_MapperMapsEntityOnRootCorrectly_With_Records.snap @@ -184,7 +184,6 @@ namespace Foo.Bar /// Field name /// public global::System.String Name { get; } - /// /// Field messages /// @@ -341,7 +340,6 @@ namespace Foo.Bar /// Field sender /// public global::Foo.Bar.IGetPeople_People_Nodes_Messages_Nodes_Sender Sender { get; } - /// /// Field text /// @@ -570,7 +568,6 @@ namespace Foo.Bar /// Field sender /// public global::Foo.Bar.IGetPeople_People_Nodes_Messages_Nodes_Sender Sender { get; } - /// /// Field text /// @@ -766,7 +763,6 @@ namespace Foo.Bar /// Field sender /// public global::Foo.Bar.IGetPeople_People_Nodes_Messages_Nodes_Sender Sender { get; } - /// /// Field text /// @@ -1015,8 +1011,335 @@ namespace Foo.Bar public static GetPeopleQueryDocument Instance { get; } = new GetPeopleQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x28, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x3a, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x41, 0x53, 0x43, 0x20, 0x7d, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x28, + 0x6f, + 0x72, + 0x64, + 0x65, + 0x72, + 0x5f, + 0x62, + 0x79, + 0x3a, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x3a, + 0x20, + 0x41, + 0x53, + 0x43, + 0x20, + 0x7d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x6f, + 0x64, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x6d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x6f, + 0x64, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x65, + 0x6e, + 0x64, + 0x65, + 0x72, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x74, + 0x65, + 0x78, + 0x74, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "0967ca09947e3a18370454229ece650b8ba8e2ef"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -1080,6 +1403,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPeopleResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -1200,8 +1524,331 @@ namespace Foo.Bar public static WriteMessageMutationDocument Instance { get; } = new WriteMessageMutationDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Mutation; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x28, 0x24, 0x74, 0x65, 0x78, 0x74, 0x3a, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x21, 0x2c, 0x20, 0x24, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x28, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x20, 0x7b, 0x20, 0x74, 0x65, 0x78, 0x74, 0x3a, 0x20, 0x24, 0x74, 0x65, 0x78, 0x74, 0x2c, 0x20, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x3a, 0x20, 0x24, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x7d, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x6d, + 0x75, + 0x74, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x57, + 0x72, + 0x69, + 0x74, + 0x65, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x28, + 0x24, + 0x74, + 0x65, + 0x78, + 0x74, + 0x3a, + 0x20, + 0x53, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x61, + 0x64, + 0x64, + 0x72, + 0x65, + 0x73, + 0x73, + 0x3a, + 0x20, + 0x53, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x65, + 0x6e, + 0x64, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x28, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x3a, + 0x20, + 0x7b, + 0x20, + 0x74, + 0x65, + 0x78, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x74, + 0x65, + 0x78, + 0x74, + 0x2c, + 0x20, + 0x72, + 0x65, + 0x63, + 0x69, + 0x70, + 0x69, + 0x65, + 0x6e, + 0x74, + 0x45, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x3a, + 0x20, + 0x24, + 0x61, + 0x64, + 0x64, + 0x72, + 0x65, + 0x73, + 0x73, + 0x20, + 0x7d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x65, + 0x6e, + 0x64, + 0x65, + 0x72, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x74, + 0x65, + 0x78, + 0x74, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "5b649ed10b73d2f35595b9d5f11fee8759ac4d72"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -1257,6 +1904,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IWriteMessageResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.String text, global::System.String address, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(text, address); @@ -1396,7 +2044,6 @@ namespace Foo.Bar.State ///Field name public global::System.String Name { get; init; } - ///Field messages public global::Foo.Bar.State.MessageConnectionData? Messages { get; init; } } @@ -1414,7 +2061,6 @@ namespace Foo.Bar.State ///Field sender public global::StrawberryShake.EntityId Sender { get; init; } - ///Field text public global::System.String Text { get; init; } } @@ -1436,6 +2082,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPeopleResult); + public GetPeopleResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -1586,9 +2233,9 @@ namespace Foo.Bar.State /// Gets access to all the people known to this service. /// public global::Foo.Bar.State.PersonConnectionData? People { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPeopleResultInfo(People, _entityIds, version); @@ -1610,6 +2257,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IWriteMessageResult); + public WriteMessageResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -1683,9 +2331,9 @@ namespace Foo.Bar.State /// Field sendMessage /// public global::Foo.Bar.State.SendMessagePayloadData SendMessage { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new WriteMessageResultInfo(SendMessage, _entityIds, version); @@ -2056,7 +2704,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; init; } - ///A flattened list of the nodes. public global::System.Collections.Generic.IReadOnlyList? Nodes { get; init; } } @@ -2073,7 +2720,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; init; } - ///A flattened list of the nodes. public global::System.Collections.Generic.IReadOnlyList? Nodes { get; init; } } @@ -2090,7 +2736,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; init; } - ///Field message public global::StrawberryShake.EntityId? Message { get; init; } } @@ -2294,7 +2939,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityIdFactoryGeneratorTests.Simple_ComplexEntity.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityIdFactoryGeneratorTests.Simple_ComplexEntity.snap index facf039c360..36342b97d0b 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityIdFactoryGeneratorTests.Simple_ComplexEntity.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityIdFactoryGeneratorTests.Simple_ComplexEntity.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.String Id { get; } - public global::System.String? Email { get; } public virtual global::System.Boolean Equals(GetPerson_Person_Person? other) @@ -165,7 +164,6 @@ namespace Foo.Bar public partial interface IGetPerson_Person { public global::System.String Id { get; } - public global::System.String? Email { get; } } @@ -201,8 +199,88 @@ namespace Foo.Bar public static GetPersonQueryDocument Instance { get; } = new GetPersonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x64, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x64, + 0x20, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "2c3e7c825b50ee7a8f7072749b64372a61a8ffc0"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -240,6 +318,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -333,7 +412,6 @@ namespace Foo.Bar.State } public global::System.String Id { get; } - public global::System.String? Email { get; } } @@ -350,6 +428,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPersonResult); + public GetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -400,9 +479,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPersonResultInfo(Person, _entityIds, version); @@ -527,7 +606,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityIdFactoryGeneratorTests.Simple_DateTimeOffset_Entity.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityIdFactoryGeneratorTests.Simple_DateTimeOffset_Entity.snap index af9fb487ac5..6d2291164e8 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityIdFactoryGeneratorTests.Simple_DateTimeOffset_Entity.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityIdFactoryGeneratorTests.Simple_DateTimeOffset_Entity.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.DateTimeOffset Id { get; } - public global::System.String? Email { get; } public virtual global::System.Boolean Equals(GetPerson_Person_Person? other) @@ -165,7 +164,6 @@ namespace Foo.Bar public partial interface IGetPerson_Person { public global::System.DateTimeOffset Id { get; } - public global::System.String? Email { get; } } @@ -200,8 +198,82 @@ namespace Foo.Bar public static GetPersonQueryDocument Instance { get; } = new GetPersonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x64, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x64, + 0x20, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "3181904b8c35da1f034a61ae48a1e3c875d69cbf"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -238,6 +310,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -330,7 +403,6 @@ namespace Foo.Bar.State } public global::System.DateTimeOffset Id { get; } - public global::System.String? Email { get; } } @@ -347,6 +419,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPersonResult); + public GetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -397,9 +470,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPersonResultInfo(Person, _entityIds, version); @@ -526,7 +599,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityIdFactoryGeneratorTests.Simple_IdEntity.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityIdFactoryGeneratorTests.Simple_IdEntity.snap index 0fc1f07af95..cb56faf44f3 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityIdFactoryGeneratorTests.Simple_IdEntity.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityIdFactoryGeneratorTests.Simple_IdEntity.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.String Id { get; } - public global::System.String? Email { get; } public virtual global::System.Boolean Equals(GetPerson_Person_Person? other) @@ -165,7 +164,6 @@ namespace Foo.Bar public partial interface IGetPerson_Person { public global::System.String Id { get; } - public global::System.String? Email { get; } } @@ -200,8 +198,82 @@ namespace Foo.Bar public static GetPersonQueryDocument Instance { get; } = new GetPersonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x64, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x64, + 0x20, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "3181904b8c35da1f034a61ae48a1e3c875d69cbf"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -238,6 +310,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -330,7 +403,6 @@ namespace Foo.Bar.State } public global::System.String Id { get; } - public global::System.String? Email { get; } } @@ -347,6 +419,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPersonResult); + public GetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -397,9 +470,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPersonResultInfo(Person, _entityIds, version); @@ -524,7 +597,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityIdFactoryGeneratorTests.Simple_NoEntity.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityIdFactoryGeneratorTests.Simple_NoEntity.snap index 70f5adbf91f..22563544a76 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityIdFactoryGeneratorTests.Simple_NoEntity.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityIdFactoryGeneratorTests.Simple_NoEntity.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.String? Email { get; } public virtual global::System.Boolean Equals(GetPerson_Person_Person? other) @@ -165,7 +164,6 @@ namespace Foo.Bar public partial interface IGetPerson_Person { public global::System.String Name { get; } - public global::System.String? Email { get; } } @@ -197,8 +195,63 @@ namespace Foo.Bar public static GetPersonQueryDocument Instance { get; } = new GetPersonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "90e3850be405988debbddcbd8810ef6e54f016e5"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -232,6 +285,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -321,6 +375,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPersonResult); + public GetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -376,9 +431,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.PersonData? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPersonResultInfo(Person, _entityIds, version); @@ -477,9 +532,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.String? Email { get; } } @@ -488,7 +541,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityIdFactoryGeneratorTests.Simple_Uuid_Entity.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityIdFactoryGeneratorTests.Simple_Uuid_Entity.snap index f55550fc4c8..f97d7b61eac 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityIdFactoryGeneratorTests.Simple_Uuid_Entity.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityIdFactoryGeneratorTests.Simple_Uuid_Entity.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.Guid Id { get; } - public global::System.String? Email { get; } public virtual global::System.Boolean Equals(GetPerson_Person_Person? other) @@ -165,7 +164,6 @@ namespace Foo.Bar public partial interface IGetPerson_Person { public global::System.Guid Id { get; } - public global::System.String? Email { get; } } @@ -200,8 +198,82 @@ namespace Foo.Bar public static GetPersonQueryDocument Instance { get; } = new GetPersonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x64, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x64, + 0x20, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "3181904b8c35da1f034a61ae48a1e3c875d69cbf"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -238,6 +310,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -330,7 +403,6 @@ namespace Foo.Bar.State } public global::System.Guid Id { get; } - public global::System.String? Email { get; } } @@ -347,6 +419,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPersonResult); + public GetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -397,9 +470,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPersonResultInfo(Person, _entityIds, version); @@ -526,7 +599,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.InterfaceField.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.InterfaceField.snap index 7b3e7b570cb..6eac4747958 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.InterfaceField.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.InterfaceField.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.String? Foo { get; } - public global::System.String? Id { get; } public virtual global::System.Boolean Equals(GetFoo_Foo_Baz? other) @@ -168,7 +167,6 @@ namespace Foo.Bar } public global::System.String? Foo { get; } - public global::System.String? Id { get; } public virtual global::System.Boolean Equals(GetFoo_Foo_Baz2? other) @@ -242,7 +240,6 @@ namespace Foo.Bar } public global::System.String? Foo { get; } - public global::System.String? Baz { get; } public virtual global::System.Boolean Equals(GetFoo_Foo_Quox? other) @@ -316,7 +313,6 @@ namespace Foo.Bar } public global::System.String? Foo { get; } - public global::System.String? Bar { get; } public virtual global::System.Boolean Equals(GetFoo_Foo_Quox2? other) @@ -460,8 +456,165 @@ namespace Foo.Bar public static GetFooQueryDocument Instance { get; } = new GetFooQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x51, 0x75, 0x6f, 0x78, 0x20, 0x7b, 0x20, 0x62, 0x61, 0x7a, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x32, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x51, 0x75, 0x6f, 0x78, 0x32, 0x20, 0x7b, 0x20, 0x62, 0x61, 0x72, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x32, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x46, + 0x6f, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x51, + 0x75, + 0x6f, + 0x78, + 0x20, + 0x7b, + 0x20, + 0x62, + 0x61, + 0x7a, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x51, + 0x75, + 0x6f, + 0x78, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x62, + 0x61, + 0x72, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "4da3763dd1c1e9a34ce3bc150614ec228c54879d"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -512,6 +665,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetFooResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -618,7 +772,6 @@ namespace Foo.Bar.State } public global::System.String? Foo { get; } - public global::System.String? Id { get; } } @@ -633,7 +786,6 @@ namespace Foo.Bar.State } public global::System.String? Foo { get; } - public global::System.String? Id { get; } } @@ -652,6 +804,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetFooResult); + public GetFooResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -752,9 +905,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityIdOrData? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetFooResultInfo(Foo, _entityIds, version); @@ -888,9 +1041,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Foo { get; } - public global::System.String? Baz { get; } } @@ -906,9 +1057,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Foo { get; } - public global::System.String? Bar { get; } } @@ -959,7 +1108,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.InterfaceList.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.InterfaceList.snap index 1ab0319c14f..8f7d346bac7 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.InterfaceList.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.InterfaceList.snap @@ -100,7 +100,6 @@ namespace Foo.Bar } public global::System.String? Foo { get; } - public global::System.String? Id { get; } public virtual global::System.Boolean Equals(GetFoo_Foo_Baz? other) @@ -174,7 +173,6 @@ namespace Foo.Bar } public global::System.String? Foo { get; } - public global::System.String? Id { get; } public virtual global::System.Boolean Equals(GetFoo_Foo_Baz2? other) @@ -248,7 +246,6 @@ namespace Foo.Bar } public global::System.String? Foo { get; } - public global::System.String? Baz { get; } public virtual global::System.Boolean Equals(GetFoo_Foo_Quox? other) @@ -322,7 +319,6 @@ namespace Foo.Bar } public global::System.String? Foo { get; } - public global::System.String? Bar { get; } public virtual global::System.Boolean Equals(GetFoo_Foo_Quox2? other) @@ -466,8 +462,165 @@ namespace Foo.Bar public static GetFooQueryDocument Instance { get; } = new GetFooQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x51, 0x75, 0x6f, 0x78, 0x20, 0x7b, 0x20, 0x62, 0x61, 0x7a, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x32, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x51, 0x75, 0x6f, 0x78, 0x32, 0x20, 0x7b, 0x20, 0x62, 0x61, 0x72, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x32, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x46, + 0x6f, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x51, + 0x75, + 0x6f, + 0x78, + 0x20, + 0x7b, + 0x20, + 0x62, + 0x61, + 0x7a, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x51, + 0x75, + 0x6f, + 0x78, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x62, + 0x61, + 0x72, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "4da3763dd1c1e9a34ce3bc150614ec228c54879d"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -518,6 +671,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetFooResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -624,7 +778,6 @@ namespace Foo.Bar.State } public global::System.String? Foo { get; } - public global::System.String? Id { get; } } @@ -639,7 +792,6 @@ namespace Foo.Bar.State } public global::System.String? Foo { get; } - public global::System.String? Id { get; } } @@ -658,6 +810,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetFooResult); + public GetFooResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -774,9 +927,9 @@ namespace Foo.Bar.State } public global::System.Collections.Generic.IReadOnlyList? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetFooResultInfo(Foo, _entityIds, version); @@ -931,9 +1084,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Foo { get; } - public global::System.String? Baz { get; } } @@ -949,9 +1100,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Foo { get; } - public global::System.String? Bar { get; } } @@ -1002,7 +1151,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.NonNullableValueTypeId.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.NonNullableValueTypeId.snap index 391cadd628d..131a13a1031 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.NonNullableValueTypeId.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.NonNullableValueTypeId.snap @@ -416,8 +416,161 @@ namespace Foo.Bar public static GetFooQueryDocument Instance { get; } = new GetFooQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x51, 0x75, 0x6f, 0x78, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x32, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x51, 0x75, 0x6f, 0x78, 0x32, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x32, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x46, + 0x6f, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x51, + 0x75, + 0x6f, + 0x78, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x51, + 0x75, + 0x6f, + 0x78, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "43715bb5e8ecbe7659e99dcb33abcf1ffeadff8e"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -467,6 +620,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetFooResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -600,6 +754,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetFooResult); + public GetFooResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -726,9 +881,9 @@ namespace Foo.Bar.State } public global::System.Collections.Generic.IReadOnlyList? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetFooResultInfo(Foo, _entityIds, version); @@ -882,7 +1037,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Int32? Foo { get; } } @@ -897,7 +1051,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Int32? Foo { get; } } @@ -948,7 +1101,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.UnionField.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.UnionField.snap index e05a86030a5..cb6e4f33554 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.UnionField.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.UnionField.snap @@ -426,8 +426,161 @@ namespace Foo.Bar public static GetFooQueryDocument Instance { get; } = new GetFooQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x51, 0x75, 0x6f, 0x78, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x32, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x51, 0x75, 0x6f, 0x78, 0x32, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x32, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x46, + 0x6f, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x51, + 0x75, + 0x6f, + 0x78, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x51, + 0x75, + 0x6f, + 0x78, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "43715bb5e8ecbe7659e99dcb33abcf1ffeadff8e"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -477,6 +630,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetFooResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -610,6 +764,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetFooResult); + public GetFooResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -710,9 +865,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityIdOrData? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetFooResultInfo(Foo, _entityIds, version); @@ -845,7 +1000,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Foo { get; } } @@ -860,7 +1014,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Foo { get; } } @@ -911,7 +1064,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.UnionList.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.UnionList.snap index c66bfe66966..a39df85a7fb 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.UnionList.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.UnionList.snap @@ -432,8 +432,161 @@ namespace Foo.Bar public static GetFooQueryDocument Instance { get; } = new GetFooQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x51, 0x75, 0x6f, 0x78, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x32, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x51, 0x75, 0x6f, 0x78, 0x32, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x32, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x46, + 0x6f, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x51, + 0x75, + 0x6f, + 0x78, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x51, + 0x75, + 0x6f, + 0x78, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "43715bb5e8ecbe7659e99dcb33abcf1ffeadff8e"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -483,6 +636,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetFooResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -616,6 +770,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetFooResult); + public GetFooResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -732,9 +887,9 @@ namespace Foo.Bar.State } public global::System.Collections.Generic.IReadOnlyList? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetFooResultInfo(Foo, _entityIds, version); @@ -888,7 +1043,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Foo { get; } } @@ -903,7 +1057,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Foo { get; } } @@ -954,7 +1107,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.UnionListInEntity.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.UnionListInEntity.snap index 00dfa43b5ac..d100887235f 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.UnionListInEntity.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.UnionListInEntity.snap @@ -517,8 +517,200 @@ namespace Foo.Bar public static GetFooQueryDocument Instance { get; } = new GetFooQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x20, 0x7b, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x51, 0x75, 0x6f, 0x78, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x32, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x51, 0x75, 0x6f, 0x78, 0x32, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x7a, 0x32, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x46, + 0x6f, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x74, + 0x65, + 0x73, + 0x74, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x51, + 0x75, + 0x6f, + 0x78, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x51, + 0x75, + 0x6f, + 0x78, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x7a, + 0x32, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x54, + 0x65, + 0x73, + 0x74, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "37a8a7754957a9a3183a938a539273990e84c894"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -574,6 +766,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetFooResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -723,6 +916,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetFooResult); + public GetFooResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -773,9 +967,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? Test { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetFooResultInfo(Test, _entityIds, version); @@ -960,7 +1154,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Foo { get; } } @@ -975,7 +1168,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Foo { get; } } @@ -1132,7 +1324,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.UnionWithNestedObject.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.UnionWithNestedObject.snap index 639785d611f..a94a3f81595 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.UnionWithNestedObject.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/EntityOrIdGeneratorTests.UnionWithNestedObject.snap @@ -218,7 +218,6 @@ namespace Foo.Bar } public global::Foo.Bar.ErrorCode? Code { get; } - public global::System.String? Message { get; } public virtual global::System.Boolean Equals(StoreUserSettingFor_StoreUserSettingFor_Errors_ErrorNode? other) @@ -313,7 +312,6 @@ namespace Foo.Bar public partial interface IStoreUserSettingFor_StoreUserSettingFor_Errors { public global::Foo.Bar.ErrorCode? Code { get; } - public global::System.String? Message { get; } } @@ -329,6 +327,7 @@ namespace Foo.Bar { private global::StrawberryShake.Serialization.IInputValueFormatter _stringFormatter = default !; public global::System.String TypeName => "StoreUserSettingForInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _stringFormatter = serializerResolver.GetInputValueFormatter("String"); @@ -465,6 +464,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IStoreUserSettingForInputInfo.IsPortalSet => _set_portal; + public global::System.String? Mobile { get => _value_mobile; @@ -493,6 +493,7 @@ namespace Foo.Bar public partial class ErrorCodeSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "ErrorCode"; + public ErrorCode Parse(global::System.String serializedValue) { return serializedValue switch @@ -549,8 +550,333 @@ namespace Foo.Bar public static StoreUserSettingForMutationDocument Instance { get; } = new StoreUserSettingForMutationDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Mutation; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x46, 0x6f, 0x72, 0x28, 0x24, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x3a, 0x20, 0x49, 0x6e, 0x74, 0x21, 0x2c, 0x20, 0x24, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x3a, 0x20, 0x49, 0x6e, 0x74, 0x21, 0x2c, 0x20, 0x24, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x20, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x46, 0x6f, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x46, 0x6f, 0x72, 0x28, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x3a, 0x20, 0x24, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x2c, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x3a, 0x20, 0x24, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x2c, 0x20, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x20, 0x24, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x7b, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x6d, + 0x75, + 0x74, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x53, + 0x74, + 0x6f, + 0x72, + 0x65, + 0x55, + 0x73, + 0x65, + 0x72, + 0x53, + 0x65, + 0x74, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x46, + 0x6f, + 0x72, + 0x28, + 0x24, + 0x75, + 0x73, + 0x65, + 0x72, + 0x49, + 0x64, + 0x3a, + 0x20, + 0x49, + 0x6e, + 0x74, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x63, + 0x75, + 0x73, + 0x74, + 0x6f, + 0x6d, + 0x65, + 0x72, + 0x49, + 0x64, + 0x3a, + 0x20, + 0x49, + 0x6e, + 0x74, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x3a, + 0x20, + 0x53, + 0x74, + 0x6f, + 0x72, + 0x65, + 0x55, + 0x73, + 0x65, + 0x72, + 0x53, + 0x65, + 0x74, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x46, + 0x6f, + 0x72, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x74, + 0x6f, + 0x72, + 0x65, + 0x55, + 0x73, + 0x65, + 0x72, + 0x53, + 0x65, + 0x74, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x46, + 0x6f, + 0x72, + 0x28, + 0x75, + 0x73, + 0x65, + 0x72, + 0x49, + 0x64, + 0x3a, + 0x20, + 0x24, + 0x75, + 0x73, + 0x65, + 0x72, + 0x49, + 0x64, + 0x2c, + 0x20, + 0x63, + 0x75, + 0x73, + 0x74, + 0x6f, + 0x6d, + 0x65, + 0x72, + 0x49, + 0x64, + 0x3a, + 0x20, + 0x24, + 0x63, + 0x75, + 0x73, + 0x74, + 0x6f, + 0x6d, + 0x65, + 0x72, + 0x49, + 0x64, + 0x2c, + 0x20, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x55, + 0x73, + 0x65, + 0x72, + 0x53, + 0x65, + 0x74, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x53, + 0x75, + 0x63, + 0x63, + 0x65, + 0x73, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x55, + 0x73, + 0x65, + 0x72, + 0x53, + 0x65, + 0x74, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x45, + 0x72, + 0x72, + 0x6f, + 0x72, + 0x20, + 0x7b, + 0x20, + 0x65, + 0x72, + 0x72, + 0x6f, + 0x72, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x63, + 0x6f, + 0x64, + 0x65, + 0x20, + 0x6d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x55, + 0x73, + 0x65, + 0x72, + 0x53, + 0x65, + 0x74, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x53, + 0x75, + 0x63, + 0x63, + 0x65, + 0x73, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "f33df9abf35b15407c80896d34adc22dd9dc8695"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -599,6 +925,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IStoreUserSettingForResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Int32 userId, global::System.Int32 customerId, global::Foo.Bar.StoreUserSettingForInput input, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(userId, customerId, input); @@ -737,6 +1064,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IStoreUserSettingForResult); + public StoreUserSettingForResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -844,9 +1172,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityIdOrData StoreUserSettingFor { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new StoreUserSettingForResultInfo(StoreUserSettingFor, _entityIds, version); @@ -1041,7 +1369,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Collections.Generic.IReadOnlyList? Errors { get; } } @@ -1057,9 +1384,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::Foo.Bar.ErrorCode? Code { get; } - public global::System.String? Message { get; } } @@ -1089,7 +1414,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ErrorGeneratorTests.Generate_ChatClient_InvalidNullCheck.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ErrorGeneratorTests.Generate_ChatClient_InvalidNullCheck.snap index 38c37ae14df..20cc6f65df3 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ErrorGeneratorTests.Generate_ChatClient_InvalidNullCheck.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ErrorGeneratorTests.Generate_ChatClient_InvalidNullCheck.snap @@ -253,12 +253,10 @@ namespace Foo.Bar /// Field name /// public global::System.String Name { get; } - /// /// Field email /// public global::System.String Email { get; } - /// /// Field isOnline /// @@ -385,12 +383,10 @@ namespace Foo.Bar /// Field name /// public global::System.String Name { get; } - /// /// Field email /// public global::System.String Email { get; } - /// /// Field isOnline /// @@ -441,8 +437,154 @@ namespace Foo.Bar public static GetPeopleQueryDocument Instance { get; } = new GetPeopleQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x20, 0x7b, 0x20, 0x6d, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x69, 0x73, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x6d, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x66, + 0x72, + 0x69, + 0x65, + 0x6e, + 0x64, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x6f, + 0x64, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x20, + 0x69, + 0x73, + 0x4f, + 0x6e, + 0x6c, + 0x69, + 0x6e, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "5565200bdba96e58d993331c3b46aa68011088b8"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -489,6 +631,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPeopleResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -595,13 +738,10 @@ namespace Foo.Bar.State ///Field friends public global::Foo.Bar.State.PersonConnectionData? Friends { get; } - ///Field name public global::System.String Name { get; } - ///Field email public global::System.String Email { get; } - ///Field isOnline public global::System.Boolean IsOnline { get; } } @@ -619,6 +759,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPeopleResult); + public GetPeopleResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -667,9 +808,9 @@ namespace Foo.Bar.State /// Gets the currently logged in user. /// public global::StrawberryShake.EntityId Me { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPeopleResultInfo(Me, _entityIds, version); @@ -855,7 +996,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - ///A flattened list of the nodes. public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } } @@ -960,7 +1100,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ErrorGeneratorTests.Generate_NoErrors.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ErrorGeneratorTests.Generate_NoErrors.snap index 83a9b304cc9..2ff4ceef1fa 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ErrorGeneratorTests.Generate_NoErrors.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ErrorGeneratorTests.Generate_NoErrors.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Droid? other) @@ -170,7 +169,6 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Human? other) @@ -247,7 +245,6 @@ namespace Foo.Bar public partial interface IGetHero_Hero { public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } } @@ -277,6 +274,7 @@ namespace Foo.Bar public partial class EpisodeSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "Episode"; + public Episode Parse(global::System.String serializedValue) { return serializedValue switch @@ -326,8 +324,122 @@ namespace Foo.Bar public static GetHeroQueryDocument Instance { get; } = new GetHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x7b, 0x20, 0x68, 0x65, 0x72, 0x6f, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x4e, 0x45, 0x57, 0x5f, 0x48, 0x4f, 0x50, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x73, 0x49, 0x6e, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x68, + 0x65, + 0x72, + 0x6f, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x4e, + 0x45, + 0x57, + 0x5f, + 0x48, + 0x4f, + 0x50, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x61, + 0x70, + 0x70, + 0x65, + 0x61, + 0x72, + 0x73, + 0x49, + 0x6e, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "a0ab93285495bb156c6c436ef4b49a3922666647"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -367,6 +479,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -462,7 +575,6 @@ namespace Foo.Bar.State } public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } } @@ -477,7 +589,6 @@ namespace Foo.Bar.State } public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } } @@ -496,6 +607,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetHeroResult); + public GetHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -551,9 +663,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? Hero { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetHeroResultInfo(Hero, _entityIds, version); @@ -736,7 +848,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Input_Type_Fields_Are_Inspected_For_LeafTypes.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Input_Type_Fields_Are_Inspected_For_LeafTypes.snap index 41d4df86e86..61cf39b31f6 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Input_Type_Fields_Are_Inspected_For_LeafTypes.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Input_Type_Fields_Are_Inspected_For_LeafTypes.snap @@ -262,6 +262,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _intFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _stringFormatter = default !; public global::System.String TypeName => "ChangeHomePlanetInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _intFormatter = serializerResolver.GetInputValueFormatter("Int"); @@ -382,6 +383,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IChangeHomePlanetInputInfo.IsIdSet => _set_id; + public global::System.String HomePlanet { get => _value_homePlanet; @@ -422,8 +424,171 @@ namespace Foo.Bar public static ChangeHomePlanetMutationDocument Instance { get; } = new ChangeHomePlanetMutationDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Mutation; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x6f, 0x6d, 0x65, 0x50, 0x6c, 0x61, 0x6e, 0x65, 0x74, 0x28, 0x24, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x20, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x6f, 0x6d, 0x65, 0x50, 0x6c, 0x61, 0x6e, 0x65, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x6f, 0x6d, 0x65, 0x50, 0x6c, 0x61, 0x6e, 0x65, 0x74, 0x28, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x20, 0x24, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x68, 0x6f, 0x6d, 0x65, 0x50, 0x6c, 0x61, 0x6e, 0x65, 0x74, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x6d, + 0x75, + 0x74, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x43, + 0x68, + 0x61, + 0x6e, + 0x67, + 0x65, + 0x48, + 0x6f, + 0x6d, + 0x65, + 0x50, + 0x6c, + 0x61, + 0x6e, + 0x65, + 0x74, + 0x28, + 0x24, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x3a, + 0x20, + 0x43, + 0x68, + 0x61, + 0x6e, + 0x67, + 0x65, + 0x48, + 0x6f, + 0x6d, + 0x65, + 0x50, + 0x6c, + 0x61, + 0x6e, + 0x65, + 0x74, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x63, + 0x68, + 0x61, + 0x6e, + 0x67, + 0x65, + 0x48, + 0x6f, + 0x6d, + 0x65, + 0x50, + 0x6c, + 0x61, + 0x6e, + 0x65, + 0x74, + 0x28, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x68, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x68, + 0x6f, + 0x6d, + 0x65, + 0x50, + 0x6c, + 0x61, + 0x6e, + 0x65, + 0x74, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "45cbc2ae79f3f3a850a21ba472689a46f0cc19c4"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -464,6 +629,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IChangeHomePlanetResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.ChangeHomePlanetInput input, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(input); @@ -586,6 +752,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IChangeHomePlanetResult); + public ChangeHomePlanetResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -646,9 +813,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.ChangeHomePlanetPayloadData ChangeHomePlanet { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new ChangeHomePlanetResultInfo(ChangeHomePlanet, _entityIds, version); @@ -775,7 +942,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::StrawberryShake.EntityId? Human { get; } } @@ -805,7 +971,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.KeywordCollisions.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.KeywordCollisions.snap index e3f3fc72f38..959eaa45b2a 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.KeywordCollisions.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.KeywordCollisions.snap @@ -28,7 +28,6 @@ namespace Foo.Bar } public global::Foo.Bar.IReadonly_Readonly? Readonly { get; } - public global::Foo.Bar.IReadonly_ReadonlyEntity? ReadonlyEntity { get; } public virtual global::System.Boolean Equals(ReadonlyResult? other) @@ -168,7 +167,6 @@ namespace Foo.Bar } public global::System.String? Id { get; } - public global::System.String? Abstract { get; } public virtual global::System.Boolean Equals(Readonly_ReadonlyEntity_readonlyEntity? other) @@ -236,7 +234,6 @@ namespace Foo.Bar public partial interface IReadonlyResult { public global::Foo.Bar.IReadonly_Readonly? Readonly { get; } - public global::Foo.Bar.IReadonly_ReadonlyEntity? ReadonlyEntity { get; } } @@ -258,7 +255,6 @@ namespace Foo.Bar public partial interface IReadonly_ReadonlyEntity { public global::System.String? Id { get; } - public global::System.String? Abstract { get; } } @@ -274,6 +270,7 @@ namespace Foo.Bar { private global::StrawberryShake.Serialization.IInputValueFormatter _stringFormatter = default !; public global::System.String TypeName => "abstract"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _stringFormatter = serializerResolver.GetInputValueFormatter("String"); @@ -417,8 +414,170 @@ namespace Foo.Bar public static ReadonlyQueryDocument Instance { get; } = new ReadonlyQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x52, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x28, 0x24, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x20, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x28, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x3a, 0x20, 0x24, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x20, 0x7d, 0x20, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x64, 0x20, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x52, + 0x65, + 0x61, + 0x64, + 0x6f, + 0x6e, + 0x6c, + 0x79, + 0x28, + 0x24, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x3a, + 0x20, + 0x61, + 0x62, + 0x73, + 0x74, + 0x72, + 0x61, + 0x63, + 0x74, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x72, + 0x65, + 0x61, + 0x64, + 0x6f, + 0x6e, + 0x6c, + 0x79, + 0x28, + 0x72, + 0x65, + 0x61, + 0x64, + 0x6f, + 0x6e, + 0x6c, + 0x79, + 0x3a, + 0x20, + 0x24, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x61, + 0x62, + 0x73, + 0x74, + 0x72, + 0x61, + 0x63, + 0x74, + 0x20, + 0x7d, + 0x20, + 0x72, + 0x65, + 0x61, + 0x64, + 0x6f, + 0x6e, + 0x6c, + 0x79, + 0x45, + 0x6e, + 0x74, + 0x69, + 0x74, + 0x79, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x64, + 0x20, + 0x61, + 0x62, + 0x73, + 0x74, + 0x72, + 0x61, + 0x63, + 0x74, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x72, + 0x65, + 0x61, + 0x64, + 0x6f, + 0x6e, + 0x6c, + 0x79, + 0x45, + 0x6e, + 0x74, + 0x69, + 0x74, + 0x79, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "4d47a790915012cc300f474c2c7cf0e7663d0911"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -461,6 +620,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IReadonlyResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.@abstract input, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(input); @@ -569,7 +729,6 @@ namespace Foo.Bar.State } public global::System.String? Id { get; } - public global::System.String? Abstract { get; } } @@ -586,6 +745,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IReadonlyResult); + public ReadonlyResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -657,11 +817,10 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.readonlyData? Readonly { get; } - public global::StrawberryShake.EntityId? ReadonlyEntity { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new ReadonlyResultInfo(Readonly, ReadonlyEntity, _entityIds, version); @@ -786,7 +945,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Abstract { get; } } @@ -816,7 +974,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_Comments.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_Comments.snap index 641768c478f..93ca9124a72 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_Comments.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_Comments.snap @@ -97,6 +97,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _stringFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _barFormatter = default !; public global::System.String TypeName => "Bar"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _stringFormatter = serializerResolver.GetInputValueFormatter("String"); @@ -349,6 +350,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBarInfo.IsStrSet => _set_str; + ///Field strNonNullable public global::System.String StrNonNullable { @@ -361,6 +363,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBarInfo.IsStrNonNullableSet => _set_strNonNullable; + ///Field nested public global::Foo.Bar.Bar? Nested { @@ -373,6 +376,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBarInfo.IsNestedSet => _set_nested; + ///Field nestedList public global::System.Collections.Generic.IReadOnlyList NestedList { @@ -385,6 +389,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBarInfo.IsNestedListSet => _set_nestedList; + ///Field nestedMatrix public global::System.Collections.Generic.IReadOnlyList?>? NestedMatrix { @@ -417,8 +422,138 @@ namespace Foo.Bar public static TestQueryDocument Instance { get; } = new TestQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x54, 0x65, 0x73, 0x74, 0x28, 0x24, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x3a, 0x20, 0x42, 0x61, 0x72, 0x21, 0x2c, 0x20, 0x24, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x5b, 0x42, 0x61, 0x72, 0x21, 0x5d, 0x21, 0x2c, 0x20, 0x24, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x5b, 0x5b, 0x42, 0x61, 0x72, 0x21, 0x5d, 0x5d, 0x29, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x28, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x3a, 0x20, 0x24, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x2c, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x24, 0x6c, 0x69, 0x73, 0x74, 0x2c, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x24, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x29, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x54, + 0x65, + 0x73, + 0x74, + 0x28, + 0x24, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x42, + 0x61, + 0x72, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x5b, + 0x42, + 0x61, + 0x72, + 0x21, + 0x5d, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x5b, + 0x5b, + 0x42, + 0x61, + 0x72, + 0x21, + 0x5d, + 0x5d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x28, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x2c, + 0x20, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x2c, + 0x20, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x29, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "dbfdc9d76b5dee9c878b782cdb27dc4b2c339cdd"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -450,6 +585,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ITestResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.Bar single, global::System.Collections.Generic.IReadOnlyList list, global::System.Collections.Generic.IReadOnlyList?>? nestedList, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(single, list, nestedList); @@ -606,6 +742,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ITestResult); + public TestResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -641,9 +778,9 @@ namespace Foo.Bar.State } public global::System.String? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new TestResultInfo(Foo, _entityIds, version); @@ -714,7 +851,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_Comments_With_Input_Records.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_Comments_With_Input_Records.snap index c217cb07cbb..8e8041d4639 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_Comments_With_Input_Records.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_Comments_With_Input_Records.snap @@ -97,6 +97,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _stringFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _barFormatter = default !; public global::System.String TypeName => "Bar"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _stringFormatter = serializerResolver.GetInputValueFormatter("String"); @@ -329,6 +330,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBarInfo.IsStrSet => _set_str; + ///Field strNonNullable public global::System.String StrNonNullable { @@ -341,6 +343,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBarInfo.IsStrNonNullableSet => _set_strNonNullable; + ///Field nested public global::Foo.Bar.Bar? Nested { @@ -353,6 +356,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBarInfo.IsNestedSet => _set_nested; + ///Field nestedList public global::System.Collections.Generic.IReadOnlyList NestedList { @@ -365,6 +369,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBarInfo.IsNestedListSet => _set_nestedList; + ///Field nestedMatrix public global::System.Collections.Generic.IReadOnlyList?>? NestedMatrix { @@ -397,8 +402,138 @@ namespace Foo.Bar public static TestQueryDocument Instance { get; } = new TestQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x54, 0x65, 0x73, 0x74, 0x28, 0x24, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x3a, 0x20, 0x42, 0x61, 0x72, 0x21, 0x2c, 0x20, 0x24, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x5b, 0x42, 0x61, 0x72, 0x21, 0x5d, 0x21, 0x2c, 0x20, 0x24, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x5b, 0x5b, 0x42, 0x61, 0x72, 0x21, 0x5d, 0x5d, 0x29, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x28, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x3a, 0x20, 0x24, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x2c, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x24, 0x6c, 0x69, 0x73, 0x74, 0x2c, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x24, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x29, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x54, + 0x65, + 0x73, + 0x74, + 0x28, + 0x24, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x42, + 0x61, + 0x72, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x5b, + 0x42, + 0x61, + 0x72, + 0x21, + 0x5d, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x5b, + 0x5b, + 0x42, + 0x61, + 0x72, + 0x21, + 0x5d, + 0x5d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x28, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x2c, + 0x20, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x2c, + 0x20, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x29, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "dbfdc9d76b5dee9c878b782cdb27dc4b2c339cdd"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -430,6 +565,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ITestResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.Bar single, global::System.Collections.Generic.IReadOnlyList list, global::System.Collections.Generic.IReadOnlyList?>? nestedList, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(single, list, nestedList); @@ -586,6 +722,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ITestResult); + public TestResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -621,9 +758,9 @@ namespace Foo.Bar.State } public global::System.String? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new TestResultInfo(Foo, _entityIds, version); @@ -694,7 +831,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_ComplexInputTypes.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_ComplexInputTypes.snap index aeaeb3098a4..c1e987386bb 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_ComplexInputTypes.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_ComplexInputTypes.snap @@ -99,6 +99,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _uploadFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _photoFormatter = default !; public global::System.String TypeName => "User"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _stringFormatter = serializerResolver.GetInputValueFormatter("String"); @@ -282,6 +283,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IUserInfo.IsUsernameSet => _set_username; + public global::Foo.Bar.Address Address { get => _value_address; @@ -293,6 +295,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IUserInfo.IsAddressSet => _set_address; + public global::StrawberryShake.Upload ProfilePicture { get => _value_profilePicture; @@ -304,6 +307,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IUserInfo.IsProfilePictureSet => _set_profilePicture; + public global::System.Collections.Generic.IReadOnlyList? Photos { get => _value_photos; @@ -323,6 +327,7 @@ namespace Foo.Bar { private global::StrawberryShake.Serialization.IInputValueFormatter _stringFormatter = default !; public global::System.String TypeName => "Address"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _stringFormatter = serializerResolver.GetInputValueFormatter("String"); @@ -438,6 +443,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _uploadFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _photoMetadataFormatter = default !; public global::System.String TypeName => "Photo"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _uploadFormatter = serializerResolver.GetInputValueFormatter("Upload"); @@ -564,6 +570,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IPhotoInfo.IsDataSet => _set_data; + public global::Foo.Bar.PhotoMetadata? Metadata { get => _value_metadata; @@ -583,6 +590,7 @@ namespace Foo.Bar { private global::StrawberryShake.Serialization.IInputValueFormatter _uploadFormatter = default !; public global::System.String TypeName => "PhotoMetadata"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _uploadFormatter = serializerResolver.GetInputValueFormatter("Upload"); @@ -704,8 +712,59 @@ namespace Foo.Bar public static TestQueryDocument Instance { get; } = new TestQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x54, 0x65, 0x73, 0x74, 0x28, 0x24, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x20, 0x55, 0x73, 0x65, 0x72, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x28, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x20, 0x24, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x29, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x54, + 0x65, + 0x73, + 0x74, + 0x28, + 0x24, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x3a, + 0x20, + 0x55, + 0x73, + 0x65, + 0x72, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x28, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x29, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "7b9a0178a8a9bf466cf7d2111c420bf1a948b822"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -737,6 +796,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ITestResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.User input, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(input); @@ -885,6 +945,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ITestResult); + public TestResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -920,9 +981,9 @@ namespace Foo.Bar.State } public global::System.String? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new TestResultInfo(Foo, _entityIds, version); @@ -1016,7 +1077,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_Complex_Arguments.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_Complex_Arguments.snap index fd32ce3ca52..dd4359d668a 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_Complex_Arguments.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_Complex_Arguments.snap @@ -97,6 +97,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _stringFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _barFormatter = default !; public global::System.String TypeName => "Bar"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _stringFormatter = serializerResolver.GetInputValueFormatter("String"); @@ -347,6 +348,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBarInfo.IsStrSet => _set_str; + public global::System.String StrNonNullable { get => _value_strNonNullable; @@ -358,6 +360,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBarInfo.IsStrNonNullableSet => _set_strNonNullable; + public global::Foo.Bar.Bar? Nested { get => _value_nested; @@ -369,6 +372,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBarInfo.IsNestedSet => _set_nested; + public global::System.Collections.Generic.IReadOnlyList NestedList { get => _value_nestedList; @@ -380,6 +384,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBarInfo.IsNestedListSet => _set_nestedList; + public global::System.Collections.Generic.IReadOnlyList?>? NestedMatrix { get => _value_nestedMatrix; @@ -411,8 +416,138 @@ namespace Foo.Bar public static TestQueryDocument Instance { get; } = new TestQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x54, 0x65, 0x73, 0x74, 0x28, 0x24, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x3a, 0x20, 0x42, 0x61, 0x72, 0x21, 0x2c, 0x20, 0x24, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x5b, 0x42, 0x61, 0x72, 0x21, 0x5d, 0x21, 0x2c, 0x20, 0x24, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x5b, 0x5b, 0x42, 0x61, 0x72, 0x21, 0x5d, 0x5d, 0x29, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x28, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x3a, 0x20, 0x24, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x2c, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x24, 0x6c, 0x69, 0x73, 0x74, 0x2c, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x24, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x29, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x54, + 0x65, + 0x73, + 0x74, + 0x28, + 0x24, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x42, + 0x61, + 0x72, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x5b, + 0x42, + 0x61, + 0x72, + 0x21, + 0x5d, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x5b, + 0x5b, + 0x42, + 0x61, + 0x72, + 0x21, + 0x5d, + 0x5d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x28, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x2c, + 0x20, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x2c, + 0x20, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x29, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "dbfdc9d76b5dee9c878b782cdb27dc4b2c339cdd"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -444,6 +579,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ITestResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.Bar single, global::System.Collections.Generic.IReadOnlyList list, global::System.Collections.Generic.IReadOnlyList?>? nestedList, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(single, list, nestedList); @@ -600,6 +736,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ITestResult); + public TestResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -635,9 +772,9 @@ namespace Foo.Bar.State } public global::System.String? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new TestResultInfo(Foo, _entityIds, version); @@ -708,7 +845,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_FirstNonUpload.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_FirstNonUpload.snap index 93d11231eef..9a22b1c52bb 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_FirstNonUpload.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_FirstNonUpload.snap @@ -108,8 +108,99 @@ namespace Foo.Bar public static TestQueryDocument Instance { get; } = new TestQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x54, 0x65, 0x73, 0x74, 0x28, 0x24, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x21, 0x2c, 0x20, 0x24, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x3a, 0x20, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x28, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x24, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x3a, 0x20, 0x24, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x29, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x54, + 0x65, + 0x73, + 0x74, + 0x28, + 0x24, + 0x73, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x3a, + 0x20, + 0x53, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x75, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x3a, + 0x20, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x28, + 0x73, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x3a, + 0x20, + 0x24, + 0x73, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x2c, + 0x20, + 0x75, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x3a, + 0x20, + 0x24, + 0x75, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x29, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "35fd86e6fe5db1cabaf4a986a0976560add8afcd"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -143,6 +234,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ITestResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.String @string, global::StrawberryShake.Upload upload, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(@string, upload); @@ -253,6 +345,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ITestResult); + public TestResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -288,9 +381,9 @@ namespace Foo.Bar.State } public global::System.String? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new TestResultInfo(Foo, _entityIds, version); @@ -348,7 +441,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_LastNonUpload.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_LastNonUpload.snap index 32ef5ec10cf..0e4f4acf01c 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_LastNonUpload.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_LastNonUpload.snap @@ -108,8 +108,99 @@ namespace Foo.Bar public static TestQueryDocument Instance { get; } = new TestQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x54, 0x65, 0x73, 0x74, 0x28, 0x24, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x3a, 0x20, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x21, 0x2c, 0x20, 0x24, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x28, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x24, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x3a, 0x20, 0x24, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x29, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x54, + 0x65, + 0x73, + 0x74, + 0x28, + 0x24, + 0x75, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x3a, + 0x20, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x73, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x3a, + 0x20, + 0x53, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x28, + 0x73, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x3a, + 0x20, + 0x24, + 0x73, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x2c, + 0x20, + 0x75, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x3a, + 0x20, + 0x24, + 0x75, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x29, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "923286e3634ae4122c172e158505589d75ff1363"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -143,6 +234,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ITestResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::StrawberryShake.Upload upload, global::System.String @string, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(upload, @string); @@ -253,6 +345,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ITestResult); + public TestResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -288,9 +381,9 @@ namespace Foo.Bar.State } public global::System.String? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new TestResultInfo(Foo, _entityIds, version); @@ -348,7 +441,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_UploadAsArg.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_UploadAsArg.snap index 8890a57cb85..0ed186152f1 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_UploadAsArg.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_UploadAsArg.snap @@ -108,8 +108,337 @@ namespace Foo.Bar public static TestQueryDocument Instance { get; } = new TestQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x54, 0x65, 0x73, 0x74, 0x28, 0x24, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x3a, 0x20, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x21, 0x2c, 0x20, 0x24, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x3a, 0x20, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x2c, 0x20, 0x24, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x5b, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x21, 0x5d, 0x21, 0x2c, 0x20, 0x24, 0x6c, 0x69, 0x73, 0x74, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x3a, 0x20, 0x5b, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x21, 0x5d, 0x2c, 0x20, 0x24, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x5b, 0x5b, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x21, 0x5d, 0x21, 0x5d, 0x21, 0x2c, 0x20, 0x24, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x3a, 0x20, 0x5b, 0x5b, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x21, 0x5d, 0x5d, 0x29, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x28, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x3a, 0x20, 0x24, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x2c, 0x20, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x3a, 0x20, 0x24, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2c, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x24, 0x6c, 0x69, 0x73, 0x74, 0x2c, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x3a, 0x20, 0x24, 0x6c, 0x69, 0x73, 0x74, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2c, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x24, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x2c, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x3a, 0x20, 0x24, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x29, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x54, + 0x65, + 0x73, + 0x74, + 0x28, + 0x24, + 0x75, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x3a, + 0x20, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x75, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x4e, + 0x75, + 0x6c, + 0x6c, + 0x61, + 0x62, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x2c, + 0x20, + 0x24, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x5b, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x21, + 0x5d, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x4e, + 0x75, + 0x6c, + 0x6c, + 0x61, + 0x62, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x5b, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x21, + 0x5d, + 0x2c, + 0x20, + 0x24, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x5b, + 0x5b, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x21, + 0x5d, + 0x21, + 0x5d, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x4e, + 0x75, + 0x6c, + 0x6c, + 0x61, + 0x62, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x5b, + 0x5b, + 0x55, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x21, + 0x5d, + 0x5d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x28, + 0x75, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x3a, + 0x20, + 0x24, + 0x75, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x2c, + 0x20, + 0x75, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x4e, + 0x75, + 0x6c, + 0x6c, + 0x61, + 0x62, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x75, + 0x70, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x4e, + 0x75, + 0x6c, + 0x6c, + 0x61, + 0x62, + 0x6c, + 0x65, + 0x2c, + 0x20, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x2c, + 0x20, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x4e, + 0x75, + 0x6c, + 0x6c, + 0x61, + 0x62, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x4e, + 0x75, + 0x6c, + 0x6c, + 0x61, + 0x62, + 0x6c, + 0x65, + 0x2c, + 0x20, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x2c, + 0x20, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x4e, + 0x75, + 0x6c, + 0x6c, + 0x61, + 0x62, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x4e, + 0x75, + 0x6c, + 0x6c, + 0x61, + 0x62, + 0x6c, + 0x65, + 0x29, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "dd7323e985f8e99eb299dff04bcbef6ee01dcec9"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -141,6 +470,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ITestResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::StrawberryShake.Upload upload, global::StrawberryShake.Upload? uploadNullable, global::System.Collections.Generic.IReadOnlyList list, global::System.Collections.Generic.IReadOnlyList? listNullable, global::System.Collections.Generic.IReadOnlyList> nestedList, global::System.Collections.Generic.IReadOnlyList?>? nestedListNullable, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(upload, uploadNullable, list, listNullable, nestedList, nestedListNullable); @@ -412,6 +742,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ITestResult); + public TestResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -447,9 +778,9 @@ namespace Foo.Bar.State } public global::System.String? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new TestResultInfo(Foo, _entityIds, version); @@ -507,7 +838,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_UploadInDeepInputObject.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_UploadInDeepInputObject.snap index edea5105178..53d22a6ec27 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_UploadInDeepInputObject.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_UploadInDeepInputObject.snap @@ -96,6 +96,7 @@ namespace Foo.Bar { private global::StrawberryShake.Serialization.IInputValueFormatter _barFormatter = default !; public global::System.String TypeName => "Test"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _barFormatter = serializerResolver.GetInputValueFormatter("Bar"); @@ -210,6 +211,7 @@ namespace Foo.Bar { private global::StrawberryShake.Serialization.IInputValueFormatter _bazFormatter = default !; public global::System.String TypeName => "Bar"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _bazFormatter = serializerResolver.GetInputValueFormatter("Baz"); @@ -324,6 +326,7 @@ namespace Foo.Bar { private global::StrawberryShake.Serialization.IInputValueFormatter _quxFormatter = default !; public global::System.String TypeName => "Baz"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _quxFormatter = serializerResolver.GetInputValueFormatter("Qux"); @@ -438,6 +441,7 @@ namespace Foo.Bar { private global::StrawberryShake.Serialization.IInputValueFormatter _uploadFormatter = default !; public global::System.String TypeName => "Qux"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _uploadFormatter = serializerResolver.GetInputValueFormatter("Upload"); @@ -559,8 +563,59 @@ namespace Foo.Bar public static TestQueryDocument Instance { get; } = new TestQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x54, 0x65, 0x73, 0x74, 0x28, 0x24, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x20, 0x54, 0x65, 0x73, 0x74, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x28, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x20, 0x24, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x29, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x54, + 0x65, + 0x73, + 0x74, + 0x28, + 0x24, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x3a, + 0x20, + 0x54, + 0x65, + 0x73, + 0x74, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x28, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x29, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "752fe96425b2cd20ad0beb97fb2d8ebe909c0ace"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -592,6 +647,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ITestResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.Test input, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(input); @@ -736,6 +792,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ITestResult); + public Test_1Result Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -771,9 +828,9 @@ namespace Foo.Bar.State } public global::System.String? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new Test_1ResultInfo(Foo, _entityIds, version); @@ -859,7 +916,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_UploadInInputObject.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_UploadInInputObject.snap index 673aaf91318..4cf653f331f 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_UploadInInputObject.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/InputGeneratorTests.Operation_With_UploadInInputObject.snap @@ -96,6 +96,7 @@ namespace Foo.Bar { private global::StrawberryShake.Serialization.IInputValueFormatter _uploadFormatter = default !; public global::System.String TypeName => "Test"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _uploadFormatter = serializerResolver.GetInputValueFormatter("Upload"); @@ -217,8 +218,59 @@ namespace Foo.Bar public static TestQueryDocument Instance { get; } = new TestQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x54, 0x65, 0x73, 0x74, 0x28, 0x24, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x20, 0x54, 0x65, 0x73, 0x74, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x28, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x20, 0x24, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x29, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x54, + 0x65, + 0x73, + 0x74, + 0x28, + 0x24, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x3a, + 0x20, + 0x54, + 0x65, + 0x73, + 0x74, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x28, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x29, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "752fe96425b2cd20ad0beb97fb2d8ebe909c0ace"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -250,6 +302,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ITestResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.Test input, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(input); @@ -364,6 +417,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ITestResult); + public Test_1Result Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -399,9 +453,9 @@ namespace Foo.Bar.State } public global::System.String? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new Test_1ResultInfo(Foo, _entityIds, version); @@ -466,7 +520,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Generate_StarWarsIntegrationTest.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Generate_StarWarsIntegrationTest.snap index db14cc06dc2..72a5fe09bf1 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Generate_StarWarsIntegrationTest.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Generate_StarWarsIntegrationTest.snap @@ -326,8 +326,148 @@ namespace Foo.Bar public static CreateReviewMutationDocument Instance { get; } = new CreateReviewMutationDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Mutation; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x28, 0x24, 0x73, 0x74, 0x61, 0x72, 0x73, 0x3a, 0x20, 0x49, 0x6e, 0x74, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x45, 0x4d, 0x50, 0x49, 0x52, 0x45, 0x2c, 0x20, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x3a, 0x20, 0x7b, 0x20, 0x73, 0x74, 0x61, 0x72, 0x73, 0x3a, 0x20, 0x24, 0x73, 0x74, 0x61, 0x72, 0x73, 0x2c, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x3a, 0x20, 0x22, 0x67, 0x6f, 0x6f, 0x64, 0x22, 0x20, 0x7d, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x74, 0x61, 0x72, 0x73, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x6d, + 0x75, + 0x74, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x43, + 0x72, + 0x65, + 0x61, + 0x74, + 0x65, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x28, + 0x24, + 0x73, + 0x74, + 0x61, + 0x72, + 0x73, + 0x3a, + 0x20, + 0x49, + 0x6e, + 0x74, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x63, + 0x72, + 0x65, + 0x61, + 0x74, + 0x65, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x45, + 0x4d, + 0x50, + 0x49, + 0x52, + 0x45, + 0x2c, + 0x20, + 0x72, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x3a, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x74, + 0x61, + 0x72, + 0x73, + 0x3a, + 0x20, + 0x24, + 0x73, + 0x74, + 0x61, + 0x72, + 0x73, + 0x2c, + 0x20, + 0x63, + 0x6f, + 0x6d, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x61, + 0x72, + 0x79, + 0x3a, + 0x20, + 0x22, + 0x67, + 0x6f, + 0x6f, + 0x64, + 0x22, + 0x20, + 0x7d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x74, + 0x61, + 0x72, + 0x73, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "409320ca8b7539016115e55a6bbeceeae0184bdf"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -362,6 +502,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ICreateReviewResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Int32 stars, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(stars); @@ -437,8 +578,83 @@ namespace Foo.Bar public static OnReviewSubscriptionDocument Instance { get; } = new OnReviewSubscriptionDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Subscription; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x20, 0x7b, 0x20, 0x6f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x45, 0x4d, 0x50, 0x49, 0x52, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x74, 0x61, 0x72, 0x73, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x73, + 0x75, + 0x62, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x4f, + 0x6e, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x20, + 0x7b, + 0x20, + 0x6f, + 0x6e, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x45, + 0x4d, + 0x50, + 0x49, + 0x52, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x74, + 0x61, + 0x72, + 0x73, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "57bd8aa0a7a43840c2b938fb5b484014327cf406"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -471,6 +687,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IOnReviewResult); + public global::System.IObservable> Watch(global::StrawberryShake.ExecutionStrategy? strategy = null) { var request = CreateRequest(); @@ -555,6 +772,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ICreateReviewResult); + public CreateReviewResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (dataInfo is CreateReviewResultInfo info) @@ -596,9 +814,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.ReviewData CreateReview { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => global::System.Array.Empty(); public global::System.UInt64 Version => 0; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new CreateReviewResultInfo(CreateReview); @@ -614,6 +832,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IOnReviewResult); + public OnReviewResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (dataInfo is OnReviewResultInfo info) @@ -655,9 +874,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.ReviewData OnReview { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => global::System.Array.Empty(); public global::System.UInt64 Version => 0; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new OnReviewResultInfo(OnReview); @@ -785,7 +1004,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Int32? Stars { get; } } @@ -796,6 +1014,7 @@ namespace Foo.Bar.State public global::StrawberryShake.IOperationStore OperationStore => throw new global::System.NotSupportedException("OperationStore is not supported in store less mode"); public global::StrawberryShake.IEntityStore EntityStore => throw new global::System.NotSupportedException("EntityStore is not supported in store less mode"); public global::StrawberryShake.IEntityIdSerializer EntityIdSerializer => throw new global::System.NotSupportedException("EntityIdSerializer is not supported in store less mode"); + public global::StrawberryShake.IOperationRequestFactory GetOperationRequestFactory(global::System.Type resultType) { throw new global::System.NotSupportedException("GetOperationRequestFactory is not supported in store less mode"); diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Interface_With_Default_Names.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Interface_With_Default_Names.snap index 88e8b2ddb17..152c54c80e5 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Interface_With_Default_Names.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Interface_With_Default_Names.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Droid? other) @@ -170,7 +169,6 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Human? other) @@ -247,7 +245,6 @@ namespace Foo.Bar public partial interface IGetHero_Hero { public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } } @@ -277,6 +274,7 @@ namespace Foo.Bar public partial class EpisodeSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "Episode"; + public Episode Parse(global::System.String serializedValue) { return serializedValue switch @@ -320,8 +318,82 @@ namespace Foo.Bar public static GetHeroQueryDocument Instance { get; } = new GetHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x7b, 0x20, 0x68, 0x65, 0x72, 0x6f, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x4e, 0x45, 0x57, 0x5f, 0x48, 0x4f, 0x50, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x73, 0x49, 0x6e, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x68, + 0x65, + 0x72, + 0x6f, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x4e, + 0x45, + 0x57, + 0x5f, + 0x48, + 0x4f, + 0x50, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x61, + 0x70, + 0x70, + 0x65, + 0x61, + 0x72, + 0x73, + 0x49, + 0x6e, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "3af8162f0dd3bae23cda79298068608839991c65"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -355,6 +427,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -442,6 +515,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetHeroResult); + public GetHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (dataInfo is GetHeroResultInfo info) @@ -492,9 +566,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.ICharacterData? Hero { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => global::System.Array.Empty(); public global::System.UInt64 Version => 0; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetHeroResultInfo(Hero); @@ -625,9 +699,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } } @@ -643,9 +715,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } } @@ -656,6 +726,7 @@ namespace Foo.Bar.State public global::StrawberryShake.IOperationStore OperationStore => throw new global::System.NotSupportedException("OperationStore is not supported in store less mode"); public global::StrawberryShake.IEntityStore EntityStore => throw new global::System.NotSupportedException("EntityStore is not supported in store less mode"); public global::StrawberryShake.IEntityIdSerializer EntityIdSerializer => throw new global::System.NotSupportedException("EntityIdSerializer is not supported in store less mode"); + public global::StrawberryShake.IOperationRequestFactory GetOperationRequestFactory(global::System.Type resultType) { throw new global::System.NotSupportedException("GetOperationRequestFactory is not supported in store less mode"); diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Interface_With_Fragment_Definition_Two_Models.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Interface_With_Fragment_Definition_Two_Models.snap index b297b415594..cc00be0bd08 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Interface_With_Fragment_Definition_Two_Models.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Interface_With_Fragment_Definition_Two_Models.snap @@ -95,9 +95,7 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.String? PrimaryFunction { get; } - public global::Foo.Bar.IGetHero_Hero_Friends? Friends { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Droid? other) @@ -173,9 +171,7 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.String? HomePlanet { get; } - public global::Foo.Bar.IGetHero_Hero_Friends? Friends { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Human? other) @@ -453,7 +449,6 @@ namespace Foo.Bar public partial interface IHero { public global::System.String Name { get; } - public global::Foo.Bar.IGetHero_Hero_Friends? Friends { get; } } @@ -475,7 +470,6 @@ namespace Foo.Bar public partial interface IHero_Droid : IDroid { public global::System.String Name { get; } - public global::Foo.Bar.IGetHero_Hero_Friends? Friends { get; } } @@ -497,7 +491,6 @@ namespace Foo.Bar public partial interface IHero_Human : IHuman { public global::System.String Name { get; } - public global::Foo.Bar.IGetHero_Hero_Friends? Friends { get; } } @@ -590,8 +583,264 @@ namespace Foo.Bar public static GetHeroQueryDocument Instance { get; } = new GetHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x7b, 0x20, 0x68, 0x65, 0x72, 0x6f, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x4e, 0x45, 0x57, 0x5f, 0x48, 0x4f, 0x50, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x6f, 0x6e, 0x20, 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x68, 0x6f, 0x6d, 0x65, 0x50, 0x6c, 0x61, 0x6e, 0x65, 0x74, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x68, + 0x65, + 0x72, + 0x6f, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x4e, + 0x45, + 0x57, + 0x5f, + 0x48, + 0x4f, + 0x50, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x43, + 0x68, + 0x61, + 0x72, + 0x61, + 0x63, + 0x74, + 0x65, + 0x72, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x66, + 0x72, + 0x69, + 0x65, + 0x6e, + 0x64, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x6f, + 0x64, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x68, + 0x6f, + 0x6d, + 0x65, + 0x50, + 0x6c, + 0x61, + 0x6e, + 0x65, + 0x74, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x72, + 0x69, + 0x6d, + 0x61, + 0x72, + 0x79, + 0x46, + 0x75, + 0x6e, + 0x63, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "7659b8661f962a731bed9124abcb483f2ea17ca7"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -645,6 +894,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -752,6 +1002,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetHeroResult); + public GetHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (dataInfo is GetHeroResultInfo info) @@ -862,9 +1113,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.ICharacterData? Hero { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => global::System.Array.Empty(); public global::System.UInt64 Version => 0; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetHeroResultInfo(Hero); @@ -1015,11 +1266,8 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.String? PrimaryFunction { get; } - public global::Foo.Bar.State.FriendsConnectionData? Friends { get; } } @@ -1036,11 +1284,8 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.String? HomePlanet { get; } - public global::Foo.Bar.State.FriendsConnectionData? Friends { get; } } @@ -1056,7 +1301,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - ///A flattened list of the nodes. public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } } @@ -1068,6 +1312,7 @@ namespace Foo.Bar.State public global::StrawberryShake.IOperationStore OperationStore => throw new global::System.NotSupportedException("OperationStore is not supported in store less mode"); public global::StrawberryShake.IEntityStore EntityStore => throw new global::System.NotSupportedException("EntityStore is not supported in store less mode"); public global::StrawberryShake.IEntityIdSerializer EntityIdSerializer => throw new global::System.NotSupportedException("EntityIdSerializer is not supported in store less mode"); + public global::StrawberryShake.IOperationRequestFactory GetOperationRequestFactory(global::System.Type resultType) { throw new global::System.NotSupportedException("GetOperationRequestFactory is not supported in store less mode"); diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Operation_With_Leaf_Argument.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Operation_With_Leaf_Argument.snap index 78fd6c54ffe..c26c1837b81 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Operation_With_Leaf_Argument.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Operation_With_Leaf_Argument.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Droid? other) @@ -170,7 +169,6 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Human? other) @@ -247,7 +245,6 @@ namespace Foo.Bar public partial interface IGetHero_Hero { public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } } @@ -277,6 +274,7 @@ namespace Foo.Bar public partial class EpisodeSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "Episode"; + public Episode Parse(global::System.String serializedValue) { return serializedValue switch @@ -320,8 +318,101 @@ namespace Foo.Bar public static GetHeroQueryDocument Instance { get; } = new GetHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x48, 0x65, 0x72, 0x6f, 0x28, 0x24, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x45, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x29, 0x20, 0x7b, 0x20, 0x68, 0x65, 0x72, 0x6f, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x24, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x73, 0x49, 0x6e, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x28, + 0x24, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x45, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x68, + 0x65, + 0x72, + 0x6f, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x61, + 0x70, + 0x70, + 0x65, + 0x61, + 0x72, + 0x73, + 0x49, + 0x6e, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "25b97a7cb87d66116635786c695e1e7f868dc0ee"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -357,6 +448,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.Episode? episode, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(episode); @@ -458,6 +550,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetHeroResult); + public GetHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (dataInfo is GetHeroResultInfo info) @@ -508,9 +601,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.ICharacterData? Hero { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => global::System.Array.Empty(); public global::System.UInt64 Version => 0; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetHeroResultInfo(Hero); @@ -641,9 +734,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } } @@ -659,9 +750,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } } @@ -672,6 +761,7 @@ namespace Foo.Bar.State public global::StrawberryShake.IOperationStore OperationStore => throw new global::System.NotSupportedException("OperationStore is not supported in store less mode"); public global::StrawberryShake.IEntityStore EntityStore => throw new global::System.NotSupportedException("EntityStore is not supported in store less mode"); public global::StrawberryShake.IEntityIdSerializer EntityIdSerializer => throw new global::System.NotSupportedException("EntityIdSerializer is not supported in store less mode"); + public global::StrawberryShake.IOperationRequestFactory GetOperationRequestFactory(global::System.Type resultType) { throw new global::System.NotSupportedException("GetOperationRequestFactory is not supported in store less mode"); diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Operation_With_Type_Argument.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Operation_With_Type_Argument.snap index 48c0739972b..6583e360d34 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Operation_With_Type_Argument.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Operation_With_Type_Argument.snap @@ -90,7 +90,6 @@ namespace Foo.Bar } public global::System.Int32 Stars { get; } - public global::System.String? Commentary { get; } public virtual global::System.Boolean Equals(CreateReviewMut_CreateReview_Review? other) @@ -161,7 +160,6 @@ namespace Foo.Bar public partial interface ICreateReviewMut_CreateReview { public global::System.Int32 Stars { get; } - public global::System.String? Commentary { get; } } @@ -178,6 +176,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _intFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _stringFormatter = default !; public global::System.String TypeName => "ReviewInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _intFormatter = serializerResolver.GetInputValueFormatter("Int"); @@ -304,6 +303,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IReviewInputInfo.IsStarsSet => _set_stars; + public global::System.String? Commentary { get => _value_commentary; @@ -331,6 +331,7 @@ namespace Foo.Bar public partial class EpisodeSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "Episode"; + public Episode Parse(global::System.String serializedValue) { return serializedValue switch @@ -374,8 +375,163 @@ namespace Foo.Bar public static CreateReviewMutMutationDocument Instance { get; } = new CreateReviewMutMutationDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Mutation; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x4d, 0x75, 0x74, 0x28, 0x24, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x45, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x21, 0x2c, 0x20, 0x24, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x3a, 0x20, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x24, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x3a, 0x20, 0x24, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x74, 0x61, 0x72, 0x73, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x6d, + 0x75, + 0x74, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x43, + 0x72, + 0x65, + 0x61, + 0x74, + 0x65, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x4d, + 0x75, + 0x74, + 0x28, + 0x24, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x45, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x72, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x3a, + 0x20, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x63, + 0x72, + 0x65, + 0x61, + 0x74, + 0x65, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x2c, + 0x20, + 0x72, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x3a, + 0x20, + 0x24, + 0x72, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x74, + 0x61, + 0x72, + 0x73, + 0x20, + 0x63, + 0x6f, + 0x6d, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x61, + 0x72, + 0x79, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "7b7488dce3bce5700fe4fab0d349728a5121c153"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -413,6 +569,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ICreateReviewMutResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.Episode episode, global::Foo.Bar.ReviewInput review, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(episode, review); @@ -518,6 +675,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ICreateReviewMutResult); + public CreateReviewMutResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (dataInfo is CreateReviewMutResultInfo info) @@ -559,9 +717,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.ReviewData CreateReview { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => global::System.Array.Empty(); public global::System.UInt64 Version => 0; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new CreateReviewMutResultInfo(CreateReview); @@ -663,9 +821,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Int32? Stars { get; } - public global::System.String? Commentary { get; } } @@ -676,6 +832,7 @@ namespace Foo.Bar.State public global::StrawberryShake.IOperationStore OperationStore => throw new global::System.NotSupportedException("OperationStore is not supported in store less mode"); public global::StrawberryShake.IEntityStore EntityStore => throw new global::System.NotSupportedException("EntityStore is not supported in store less mode"); public global::StrawberryShake.IEntityIdSerializer EntityIdSerializer => throw new global::System.NotSupportedException("EntityIdSerializer is not supported in store less mode"); + public global::StrawberryShake.IOperationRequestFactory GetOperationRequestFactory(global::System.Type resultType) { throw new global::System.NotSupportedException("GetOperationRequestFactory is not supported in store less mode"); diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.StarWarsTypeNameOnUnions.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.StarWarsTypeNameOnUnions.snap index e45c34b977f..21eb46a3b03 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.StarWarsTypeNameOnUnions.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.StarWarsTypeNameOnUnions.snap @@ -336,8 +336,64 @@ namespace Foo.Bar public static SearchHeroQueryDocument Instance { get; } = new SearchHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x28, 0x74, 0x65, 0x78, 0x74, 0x3a, 0x20, 0x22, 0x6c, 0x22, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x53, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x28, + 0x74, + 0x65, + 0x78, + 0x74, + 0x3a, + 0x20, + 0x22, + 0x6c, + 0x22, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "a7b73fff8132c809064a1f07d9a51ad34a90b3ff"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -369,6 +425,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ISearchHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -454,6 +511,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ISearchHeroResult); + public SearchHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (dataInfo is SearchHeroResultInfo info) @@ -524,9 +582,9 @@ namespace Foo.Bar.State } public global::System.Collections.Generic.IReadOnlyList? Search { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => global::System.Array.Empty(); public global::System.UInt64 Version => 0; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new SearchHeroResultInfo(Search); @@ -676,6 +734,7 @@ namespace Foo.Bar.State public global::StrawberryShake.IOperationStore OperationStore => throw new global::System.NotSupportedException("OperationStore is not supported in store less mode"); public global::StrawberryShake.IEntityStore EntityStore => throw new global::System.NotSupportedException("EntityStore is not supported in store less mode"); public global::StrawberryShake.IEntityIdSerializer EntityIdSerializer => throw new global::System.NotSupportedException("EntityIdSerializer is not supported in store less mode"); + public global::StrawberryShake.IOperationRequestFactory GetOperationRequestFactory(global::System.Type resultType) { throw new global::System.NotSupportedException("GetOperationRequestFactory is not supported in store less mode"); diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.StarWarsUnionList.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.StarWarsUnionList.snap index c7a17208f2a..f26cbfdc318 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.StarWarsUnionList.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.StarWarsUnionList.snap @@ -330,8 +330,108 @@ namespace Foo.Bar public static SearchHeroQueryDocument Instance { get; } = new SearchHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x28, 0x74, 0x65, 0x78, 0x74, 0x3a, 0x20, 0x22, 0x6c, 0x22, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x53, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x28, + 0x74, + 0x65, + 0x78, + 0x74, + 0x3a, + 0x20, + 0x22, + 0x6c, + 0x22, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "2918628297e45b19c18b1edaf728b18d712f8db1"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -369,6 +469,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ISearchHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -460,6 +561,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ISearchHeroResult); + public SearchHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (dataInfo is SearchHeroResultInfo info) @@ -530,9 +632,9 @@ namespace Foo.Bar.State } public global::System.Collections.Generic.IReadOnlyList? Search { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => global::System.Array.Empty(); public global::System.UInt64 Version => 0; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new SearchHeroResultInfo(Search); @@ -662,7 +764,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } } @@ -677,7 +778,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } } @@ -688,6 +788,7 @@ namespace Foo.Bar.State public global::StrawberryShake.IOperationStore OperationStore => throw new global::System.NotSupportedException("OperationStore is not supported in store less mode"); public global::StrawberryShake.IEntityStore EntityStore => throw new global::System.NotSupportedException("EntityStore is not supported in store less mode"); public global::StrawberryShake.IEntityIdSerializer EntityIdSerializer => throw new global::System.NotSupportedException("EntityIdSerializer is not supported in store less mode"); + public global::StrawberryShake.IOperationRequestFactory GetOperationRequestFactory(global::System.Type resultType) { throw new global::System.NotSupportedException("GetOperationRequestFactory is not supported in store less mode"); diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Subscription_With_Default_Names.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Subscription_With_Default_Names.snap index 16cfcf7cf92..9f5af316670 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Subscription_With_Default_Names.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/NoStoreStarWarsGeneratorTests.Subscription_With_Default_Names.snap @@ -90,7 +90,6 @@ namespace Foo.Bar } public global::System.Int32 Stars { get; } - public global::System.String? Commentary { get; } public virtual global::System.Boolean Equals(OnReviewSub_OnReview_Review? other) @@ -161,7 +160,6 @@ namespace Foo.Bar public partial interface IOnReviewSub_OnReview { public global::System.Int32 Stars { get; } - public global::System.String? Commentary { get; } } @@ -193,8 +191,99 @@ namespace Foo.Bar public static OnReviewSubSubscriptionDocument Instance { get; } = new OnReviewSubSubscriptionDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Subscription; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x20, 0x7b, 0x20, 0x6f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x4e, 0x45, 0x57, 0x5f, 0x48, 0x4f, 0x50, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x74, 0x61, 0x72, 0x73, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x73, + 0x75, + 0x62, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x4f, + 0x6e, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x53, + 0x75, + 0x62, + 0x20, + 0x7b, + 0x20, + 0x6f, + 0x6e, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x4e, + 0x45, + 0x57, + 0x5f, + 0x48, + 0x4f, + 0x50, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x74, + 0x61, + 0x72, + 0x73, + 0x20, + 0x63, + 0x6f, + 0x6d, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x61, + 0x72, + 0x79, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "92220fce37342d7ade3d63a2a81342eb1fb14bac"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -228,6 +317,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IOnReviewSubResult); + public global::System.IObservable> Watch(global::StrawberryShake.ExecutionStrategy? strategy = null) { var request = CreateRequest(); @@ -308,6 +398,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IOnReviewSubResult); + public OnReviewSubResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (dataInfo is OnReviewSubResultInfo info) @@ -349,9 +440,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.ReviewData OnReview { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => global::System.Array.Empty(); public global::System.UInt64 Version => 0; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new OnReviewSubResultInfo(OnReview); @@ -442,9 +533,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Int32? Stars { get; } - public global::System.String? Commentary { get; } } @@ -455,6 +544,7 @@ namespace Foo.Bar.State public global::StrawberryShake.IOperationStore OperationStore => throw new global::System.NotSupportedException("OperationStore is not supported in store less mode"); public global::StrawberryShake.IEntityStore EntityStore => throw new global::System.NotSupportedException("EntityStore is not supported in store less mode"); public global::StrawberryShake.IEntityIdSerializer EntityIdSerializer => throw new global::System.NotSupportedException("EntityIdSerializer is not supported in store less mode"); + public global::StrawberryShake.IOperationRequestFactory GetOperationRequestFactory(global::System.Type resultType) { throw new global::System.NotSupportedException("GetOperationRequestFactory is not supported in store less mode"); diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Generate_ChatClient_AllOperations.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Generate_ChatClient_AllOperations.snap index a4448558638..09f69aa7e6a 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Generate_ChatClient_AllOperations.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Generate_ChatClient_AllOperations.snap @@ -187,22 +187,18 @@ namespace Foo.Bar /// Field name /// public global::System.String Name { get; } - /// /// Field email /// public global::System.String Email { get; } - /// /// Field isOnline /// public global::System.Boolean IsOnline { get; } - /// /// Field imageUri /// public global::System.Uri? ImageUri { get; } - /// /// Field lastSeen /// @@ -313,12 +309,10 @@ namespace Foo.Bar /// Field name /// public global::System.String Name { get; } - /// /// Field email /// public global::System.String Email { get; } - /// /// Field isOnline /// @@ -336,7 +330,6 @@ namespace Foo.Bar /// Field imageUri /// public global::System.Uri? ImageUri { get; } - /// /// Field lastSeen /// @@ -600,27 +593,22 @@ namespace Foo.Bar /// Field id /// public global::System.String Id { get; } - /// /// Field text /// public global::System.String Text { get; } - /// /// Field direction /// public global::Foo.Bar.Direction Direction { get; } - /// /// Fiejld recipient /// public global::Foo.Bar.IGetMessages_PersonByEmail_Messages_Nodes_Recipient Recipient { get; } - /// /// Field sender /// public global::Foo.Bar.IGetMessages_PersonByEmail_Messages_Nodes_Sender Sender { get; } - /// /// Field sent /// @@ -700,12 +688,10 @@ namespace Foo.Bar /// Field name /// public global::System.String Name { get; } - /// /// Field email /// public global::System.String Email { get; } - /// /// Field isOnline /// @@ -782,12 +768,10 @@ namespace Foo.Bar /// Field name /// public global::System.String Name { get; } - /// /// Field email /// public global::System.String Email { get; } - /// /// Field isOnline /// @@ -914,27 +898,22 @@ namespace Foo.Bar /// Field id /// public global::System.String Id { get; } - /// /// Field text /// public global::System.String Text { get; } - /// /// Field direction /// public global::Foo.Bar.Direction Direction { get; } - /// /// Fiejld recipient /// public global::Foo.Bar.IGetMessages_PersonByEmail_Messages_Nodes_Recipient Recipient { get; } - /// /// Field sender /// public global::Foo.Bar.IGetMessages_PersonByEmail_Messages_Nodes_Sender Sender { get; } - /// /// Field sent /// @@ -1152,27 +1131,22 @@ namespace Foo.Bar /// Field id /// public global::System.String Id { get; } - /// /// Field text /// public global::System.String Text { get; } - /// /// Field direction /// public global::Foo.Bar.Direction Direction { get; } - /// /// Fiejld recipient /// public global::Foo.Bar.IGetMessages_PersonByEmail_Messages_Nodes_Recipient Recipient { get; } - /// /// Field sender /// public global::Foo.Bar.IGetMessages_PersonByEmail_Messages_Nodes_Sender Sender { get; } - /// /// Field sent /// @@ -1252,12 +1226,10 @@ namespace Foo.Bar /// Field name /// public global::System.String Name { get; } - /// /// Field email /// public global::System.String Email { get; } - /// /// Field isOnline /// @@ -1334,12 +1306,10 @@ namespace Foo.Bar /// Field name /// public global::System.String Name { get; } - /// /// Field email /// public global::System.String Email { get; } - /// /// Field isOnline /// @@ -1644,27 +1614,22 @@ namespace Foo.Bar /// Field id /// public global::System.String Id { get; } - /// /// Field text /// public global::System.String Text { get; } - /// /// Field direction /// public global::Foo.Bar.Direction Direction { get; } - /// /// Fiejld recipient /// public global::Foo.Bar.IGetMessages_PersonByEmail_Messages_Nodes_Recipient Recipient { get; } - /// /// Field sender /// public global::Foo.Bar.IGetMessages_PersonByEmail_Messages_Nodes_Sender Sender { get; } - /// /// Field sent /// @@ -1744,12 +1709,10 @@ namespace Foo.Bar /// Field name /// public global::System.String Name { get; } - /// /// Field email /// public global::System.String Email { get; } - /// /// Field isOnline /// @@ -1826,12 +1789,10 @@ namespace Foo.Bar /// Field name /// public global::System.String Name { get; } - /// /// Field email /// public global::System.String Email { get; } - /// /// Field isOnline /// @@ -2068,27 +2029,22 @@ namespace Foo.Bar /// Field id /// public global::System.String Id { get; } - /// /// Field text /// public global::System.String Text { get; } - /// /// Field direction /// public global::Foo.Bar.Direction Direction { get; } - /// /// Fiejld recipient /// public global::Foo.Bar.IGetMessages_PersonByEmail_Messages_Nodes_Recipient Recipient { get; } - /// /// Field sender /// public global::Foo.Bar.IGetMessages_PersonByEmail_Messages_Nodes_Sender Sender { get; } - /// /// Field sent /// @@ -2168,12 +2124,10 @@ namespace Foo.Bar /// Field name /// public global::System.String Name { get; } - /// /// Field email /// public global::System.String Email { get; } - /// /// Field isOnline /// @@ -2250,12 +2204,10 @@ namespace Foo.Bar /// Field name /// public global::System.String Name { get; } - /// /// Field email /// public global::System.String Email { get; } - /// /// Field isOnline /// @@ -2387,6 +2339,7 @@ namespace Foo.Bar { private global::StrawberryShake.Serialization.IInputValueFormatter _stringFormatter = default !; public global::System.String TypeName => "SendMessageInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _stringFormatter = serializerResolver.GetInputValueFormatter("String"); @@ -2535,6 +2488,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.ISendMessageInputInfo.IsClientMutationIdSet => _set_clientMutationId; + ///The email of the person to which a message shall be send. public global::System.String RecipientEmail { @@ -2547,6 +2501,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.ISendMessageInputInfo.IsRecipientEmailSet => _set_recipientEmail; + ///The message text. public global::System.String Text { @@ -2583,6 +2538,7 @@ namespace Foo.Bar public partial class DirectionSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "Direction"; + public Direction Parse(global::System.String serializedValue) { return serializedValue switch @@ -2641,8 +2597,249 @@ namespace Foo.Bar public static GetPeopleQueryDocument Instance { get; } = new GetPeopleQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x28, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x3a, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x41, 0x53, 0x43, 0x20, 0x7d, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x55, 0x72, 0x69, 0x20, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x65, 0x6e, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x69, 0x73, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x28, + 0x6f, + 0x72, + 0x64, + 0x65, + 0x72, + 0x5f, + 0x62, + 0x79, + 0x3a, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x3a, + 0x20, + 0x41, + 0x53, + 0x43, + 0x20, + 0x7d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x6f, + 0x64, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x50, + 0x61, + 0x72, + 0x74, + 0x69, + 0x63, + 0x69, + 0x70, + 0x61, + 0x6e, + 0x74, + 0x20, + 0x69, + 0x6d, + 0x61, + 0x67, + 0x65, + 0x55, + 0x72, + 0x69, + 0x20, + 0x6c, + 0x61, + 0x73, + 0x74, + 0x53, + 0x65, + 0x65, + 0x6e, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x50, + 0x61, + 0x72, + 0x74, + 0x69, + 0x63, + 0x69, + 0x70, + 0x61, + 0x6e, + 0x74, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x20, + 0x69, + 0x73, + 0x4f, + 0x6e, + 0x6c, + 0x69, + 0x6e, + 0x65, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "91253402b90b965c3f43c2d774692ae8366270c6"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -2693,6 +2890,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPeopleResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -2818,8 +3016,449 @@ namespace Foo.Bar public static GetMessagesQueryDocument Instance { get; } = new GetMessagesQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x28, 0x24, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x3a, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x42, 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x28, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x3a, 0x20, 0x24, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x28, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x3a, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x41, 0x53, 0x43, 0x20, 0x7d, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x74, 0x65, 0x78, 0x74, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x69, 0x73, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x73, + 0x28, + 0x24, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x3a, + 0x20, + 0x53, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x42, + 0x79, + 0x45, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x28, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x3a, + 0x20, + 0x24, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x73, + 0x28, + 0x6f, + 0x72, + 0x64, + 0x65, + 0x72, + 0x5f, + 0x62, + 0x79, + 0x3a, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x65, + 0x6e, + 0x74, + 0x3a, + 0x20, + 0x41, + 0x53, + 0x43, + 0x20, + 0x7d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x6f, + 0x64, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x74, + 0x65, + 0x78, + 0x74, + 0x20, + 0x64, + 0x69, + 0x72, + 0x65, + 0x63, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x72, + 0x65, + 0x63, + 0x69, + 0x70, + 0x69, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x50, + 0x61, + 0x72, + 0x74, + 0x69, + 0x63, + 0x69, + 0x70, + 0x61, + 0x6e, + 0x74, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x73, + 0x65, + 0x6e, + 0x64, + 0x65, + 0x72, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x50, + 0x61, + 0x72, + 0x74, + 0x69, + 0x63, + 0x69, + 0x70, + 0x61, + 0x6e, + 0x74, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x73, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x50, + 0x61, + 0x72, + 0x74, + 0x69, + 0x63, + 0x69, + 0x70, + 0x61, + 0x6e, + 0x74, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x20, + 0x69, + 0x73, + 0x4f, + 0x6e, + 0x6c, + 0x69, + 0x6e, + 0x65, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "c9975fca1ca78b7c96f298130fccfc181f3d5309"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -2893,6 +3532,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetMessagesResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.String email, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(email); @@ -3045,8 +3685,397 @@ namespace Foo.Bar public static SendMessageInputMutationDocument Instance { get; } = new SendMessageInputMutationDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Mutation; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x28, 0x24, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x20, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x28, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x20, 0x24, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x74, 0x65, 0x78, 0x74, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x69, 0x73, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x6d, + 0x75, + 0x74, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x53, + 0x65, + 0x6e, + 0x64, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x28, + 0x24, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x3a, + 0x20, + 0x53, + 0x65, + 0x6e, + 0x64, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x65, + 0x6e, + 0x64, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x28, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x74, + 0x65, + 0x78, + 0x74, + 0x20, + 0x64, + 0x69, + 0x72, + 0x65, + 0x63, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x72, + 0x65, + 0x63, + 0x69, + 0x70, + 0x69, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x50, + 0x61, + 0x72, + 0x74, + 0x69, + 0x63, + 0x69, + 0x70, + 0x61, + 0x6e, + 0x74, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x73, + 0x65, + 0x6e, + 0x64, + 0x65, + 0x72, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x50, + 0x61, + 0x72, + 0x74, + 0x69, + 0x63, + 0x69, + 0x70, + 0x61, + 0x6e, + 0x74, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x73, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x50, + 0x61, + 0x72, + 0x74, + 0x69, + 0x63, + 0x69, + 0x70, + 0x61, + 0x6e, + 0x74, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x20, + 0x69, + 0x73, + 0x4f, + 0x6e, + 0x6c, + 0x69, + 0x6e, + 0x65, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "abbee600b2246c20ab39b641561c4a0312560356"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -3114,6 +4143,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ISendMessageInputResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.SendMessageInput input, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(input); @@ -3260,8 +4290,434 @@ namespace Foo.Bar public static SendMessageMutMutationDocument Instance { get; } = new SendMessageMutMutationDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Mutation; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4d, 0x75, 0x74, 0x28, 0x24, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x3a, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x21, 0x2c, 0x20, 0x24, 0x74, 0x65, 0x78, 0x74, 0x3a, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x28, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x20, 0x7b, 0x20, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x3a, 0x20, 0x24, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x2c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x3a, 0x20, 0x24, 0x74, 0x65, 0x78, 0x74, 0x20, 0x7d, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x74, 0x65, 0x78, 0x74, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x69, 0x73, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x6d, + 0x75, + 0x74, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x53, + 0x65, + 0x6e, + 0x64, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x4d, + 0x75, + 0x74, + 0x28, + 0x24, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x3a, + 0x20, + 0x53, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x74, + 0x65, + 0x78, + 0x74, + 0x3a, + 0x20, + 0x53, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x65, + 0x6e, + 0x64, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x28, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x3a, + 0x20, + 0x7b, + 0x20, + 0x72, + 0x65, + 0x63, + 0x69, + 0x70, + 0x69, + 0x65, + 0x6e, + 0x74, + 0x45, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x3a, + 0x20, + 0x24, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x2c, + 0x20, + 0x74, + 0x65, + 0x78, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x74, + 0x65, + 0x78, + 0x74, + 0x20, + 0x7d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x74, + 0x65, + 0x78, + 0x74, + 0x20, + 0x64, + 0x69, + 0x72, + 0x65, + 0x63, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x72, + 0x65, + 0x63, + 0x69, + 0x70, + 0x69, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x50, + 0x61, + 0x72, + 0x74, + 0x69, + 0x63, + 0x69, + 0x70, + 0x61, + 0x6e, + 0x74, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x73, + 0x65, + 0x6e, + 0x64, + 0x65, + 0x72, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x50, + 0x61, + 0x72, + 0x74, + 0x69, + 0x63, + 0x69, + 0x70, + 0x61, + 0x6e, + 0x74, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x73, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x50, + 0x61, + 0x72, + 0x74, + 0x69, + 0x63, + 0x69, + 0x70, + 0x61, + 0x6e, + 0x74, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x20, + 0x69, + 0x73, + 0x4f, + 0x6e, + 0x6c, + 0x69, + 0x6e, + 0x65, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "0a0b8bf5246ce3dca815397d3d9be98e9a35a867"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -3329,6 +4785,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ISendMessageMutResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.String email, global::System.String text, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(email, text); @@ -3483,8 +4940,347 @@ namespace Foo.Bar public static ReadMessagesSubscriptionDocument Instance { get; } = new ReadMessagesSubscriptionDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Subscription; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x52, 0x65, 0x61, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x3a, 0x20, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x74, 0x65, 0x78, 0x74, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x69, 0x73, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x73, + 0x75, + 0x62, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x52, + 0x65, + 0x61, + 0x64, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x6d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x3a, + 0x20, + 0x6f, + 0x6e, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x52, + 0x65, + 0x63, + 0x65, + 0x69, + 0x76, + 0x65, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4d, + 0x65, + 0x73, + 0x73, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x74, + 0x65, + 0x78, + 0x74, + 0x20, + 0x64, + 0x69, + 0x72, + 0x65, + 0x63, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x72, + 0x65, + 0x63, + 0x69, + 0x70, + 0x69, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x50, + 0x61, + 0x72, + 0x74, + 0x69, + 0x63, + 0x69, + 0x70, + 0x61, + 0x6e, + 0x74, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x73, + 0x65, + 0x6e, + 0x64, + 0x65, + 0x72, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x50, + 0x61, + 0x72, + 0x74, + 0x69, + 0x63, + 0x69, + 0x70, + 0x61, + 0x6e, + 0x74, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x73, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x50, + 0x61, + 0x72, + 0x74, + 0x69, + 0x63, + 0x69, + 0x70, + 0x61, + 0x6e, + 0x74, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x20, + 0x69, + 0x73, + 0x4f, + 0x6e, + 0x6c, + 0x69, + 0x6e, + 0x65, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "d814e26af4f48099826de75f91993d52b3568a02"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -3547,6 +5343,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IReadMessagesResult); + public global::System.IObservable> Watch(global::StrawberryShake.ExecutionStrategy? strategy = null) { var request = CreateRequest(); @@ -3684,19 +5481,14 @@ namespace Foo.Bar.State ///Field name public global::System.String Name { get; } - ///Field email public global::System.String Email { get; } - ///Field isOnline public global::System.Boolean IsOnline { get; } - ///Field imageUri public global::System.Uri? ImageUri { get; } - ///Field lastSeen public global::System.DateTimeOffset LastSeen { get; } - ///Field messages public global::Foo.Bar.State.MessageConnectionData? Messages { get; } } @@ -3718,19 +5510,14 @@ namespace Foo.Bar.State ///Field id public global::System.String Id { get; } - ///Field text public global::System.String Text { get; } - ///Field direction public global::Foo.Bar.Direction Direction { get; } - ///Fiejld recipient public global::StrawberryShake.EntityId Recipient { get; } - ///Field sender public global::StrawberryShake.EntityId Sender { get; } - ///Field sent public global::System.DateTimeOffset Sent { get; } } @@ -3748,6 +5535,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPeopleResult); + public GetPeopleResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -3837,9 +5625,9 @@ namespace Foo.Bar.State /// Gets access to all the people known to this service. /// public global::Foo.Bar.State.PersonConnectionData? People { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPeopleResultInfo(People, _entityIds, version); @@ -3859,6 +5647,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetMessagesResult); + public GetMessagesResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -3907,9 +5696,9 @@ namespace Foo.Bar.State /// Field personByEmail /// public global::StrawberryShake.EntityId PersonByEmail { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetMessagesResultInfo(PersonByEmail, _entityIds, version); @@ -3933,6 +5722,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ISendMessageInputResult); + public SendMessageInput_1Result Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -4016,9 +5806,9 @@ namespace Foo.Bar.State /// Field sendMessage /// public global::Foo.Bar.State.SendMessagePayloadData SendMessage { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new SendMessageInput_1ResultInfo(SendMessage, _entityIds, version); @@ -4042,6 +5832,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ISendMessageMutResult); + public SendMessageMutResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -4125,9 +5916,9 @@ namespace Foo.Bar.State /// Field sendMessage /// public global::Foo.Bar.State.SendMessagePayloadData SendMessage { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new SendMessageMutResultInfo(SendMessage, _entityIds, version); @@ -4147,6 +5938,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IReadMessagesResult); + public ReadMessagesResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -4195,9 +5987,9 @@ namespace Foo.Bar.State /// field onMessageReceived /// public global::StrawberryShake.EntityId Message { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new ReadMessagesResultInfo(Message, _entityIds, version); @@ -5280,7 +7072,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - ///A flattened list of the nodes. public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } } @@ -5297,7 +7088,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - ///A flattened list of the nodes. public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } } @@ -5314,7 +7104,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - ///Field message public global::StrawberryShake.EntityId? Message { get; } } @@ -5791,7 +7580,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.NonNullableValueType_WithoutGlobal_Input.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.NonNullableValueType_WithoutGlobal_Input.snap index 3642be2d6d9..94c552f4738 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.NonNullableValueType_WithoutGlobal_Input.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.NonNullableValueType_WithoutGlobal_Input.snap @@ -96,6 +96,7 @@ namespace Foo.Bar { private global::StrawberryShake.Serialization.IInputValueFormatter _intPtrFormatter = default !; public global::System.String TypeName => "Bar"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _intPtrFormatter = serializerResolver.GetInputValueFormatter("IntPtr"); @@ -217,8 +218,59 @@ namespace Foo.Bar public static GetSomethingQueryDocument Instance { get; } = new GetSomethingQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x28, 0x24, 0x62, 0x61, 0x72, 0x3a, 0x20, 0x42, 0x61, 0x72, 0x29, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x28, 0x62, 0x61, 0x72, 0x3a, 0x20, 0x24, 0x62, 0x61, 0x72, 0x29, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x53, + 0x6f, + 0x6d, + 0x65, + 0x74, + 0x68, + 0x69, + 0x6e, + 0x67, + 0x28, + 0x24, + 0x62, + 0x61, + 0x72, + 0x3a, + 0x20, + 0x42, + 0x61, + 0x72, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x28, + 0x62, + 0x61, + 0x72, + 0x3a, + 0x20, + 0x24, + 0x62, + 0x61, + 0x72, + 0x29, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "da8906d1f936b0ba2f53ecc3b4f994f97a74891d"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -250,6 +302,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetSomethingResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.Bar? bar, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(bar); @@ -349,6 +402,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetSomethingResult); + public GetSomethingResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -384,9 +438,9 @@ namespace Foo.Bar.State } public global::System.String? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetSomethingResultInfo(Foo, _entityIds, version); @@ -451,7 +505,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.NonNullable_ValueType_Input.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.NonNullable_ValueType_Input.snap index 3642be2d6d9..94c552f4738 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.NonNullable_ValueType_Input.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.NonNullable_ValueType_Input.snap @@ -96,6 +96,7 @@ namespace Foo.Bar { private global::StrawberryShake.Serialization.IInputValueFormatter _intPtrFormatter = default !; public global::System.String TypeName => "Bar"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _intPtrFormatter = serializerResolver.GetInputValueFormatter("IntPtr"); @@ -217,8 +218,59 @@ namespace Foo.Bar public static GetSomethingQueryDocument Instance { get; } = new GetSomethingQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x28, 0x24, 0x62, 0x61, 0x72, 0x3a, 0x20, 0x42, 0x61, 0x72, 0x29, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x28, 0x62, 0x61, 0x72, 0x3a, 0x20, 0x24, 0x62, 0x61, 0x72, 0x29, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x53, + 0x6f, + 0x6d, + 0x65, + 0x74, + 0x68, + 0x69, + 0x6e, + 0x67, + 0x28, + 0x24, + 0x62, + 0x61, + 0x72, + 0x3a, + 0x20, + 0x42, + 0x61, + 0x72, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x28, + 0x62, + 0x61, + 0x72, + 0x3a, + 0x20, + 0x24, + 0x62, + 0x61, + 0x72, + 0x29, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "da8906d1f936b0ba2f53ecc3b4f994f97a74891d"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -250,6 +302,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetSomethingResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.Bar? bar, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(bar); @@ -349,6 +402,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetSomethingResult); + public GetSomethingResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -384,9 +438,9 @@ namespace Foo.Bar.State } public global::System.String? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetSomethingResultInfo(Foo, _entityIds, version); @@ -451,7 +505,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Nullable_List_Input.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Nullable_List_Input.snap index 7d6aebbff9f..637492a281c 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Nullable_List_Input.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Nullable_List_Input.snap @@ -96,6 +96,7 @@ namespace Foo.Bar { private global::StrawberryShake.Serialization.IInputValueFormatter _bazFormatter = default !; public global::System.String TypeName => "Bar"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _bazFormatter = serializerResolver.GetInputValueFormatter("Baz"); @@ -235,6 +236,7 @@ namespace Foo.Bar { private global::StrawberryShake.Serialization.IInputValueFormatter _stringFormatter = default !; public global::System.String TypeName => "Baz"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _stringFormatter = serializerResolver.GetInputValueFormatter("String"); @@ -367,8 +369,59 @@ namespace Foo.Bar public static GetSomethingQueryDocument Instance { get; } = new GetSomethingQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x28, 0x24, 0x62, 0x61, 0x72, 0x3a, 0x20, 0x42, 0x61, 0x72, 0x29, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x28, 0x62, 0x61, 0x72, 0x3a, 0x20, 0x24, 0x62, 0x61, 0x72, 0x29, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x53, + 0x6f, + 0x6d, + 0x65, + 0x74, + 0x68, + 0x69, + 0x6e, + 0x67, + 0x28, + 0x24, + 0x62, + 0x61, + 0x72, + 0x3a, + 0x20, + 0x42, + 0x61, + 0x72, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x28, + 0x62, + 0x61, + 0x72, + 0x3a, + 0x20, + 0x24, + 0x62, + 0x61, + 0x72, + 0x29, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "da8906d1f936b0ba2f53ecc3b4f994f97a74891d"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -400,6 +453,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetSomethingResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.Bar? bar, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(bar); @@ -499,6 +553,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetSomethingResult); + public GetSomethingResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -534,9 +589,9 @@ namespace Foo.Bar.State } public global::System.String? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetSomethingResultInfo(Foo, _entityIds, version); @@ -606,7 +661,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Nullable_ValueType_Input.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Nullable_ValueType_Input.snap index 84422042e2f..a7b3c259bcf 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Nullable_ValueType_Input.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Nullable_ValueType_Input.snap @@ -96,6 +96,7 @@ namespace Foo.Bar { private global::StrawberryShake.Serialization.IInputValueFormatter _intPtrFormatter = default !; public global::System.String TypeName => "Bar"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _intPtrFormatter = serializerResolver.GetInputValueFormatter("IntPtr"); @@ -228,8 +229,59 @@ namespace Foo.Bar public static GetSomethingQueryDocument Instance { get; } = new GetSomethingQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x28, 0x24, 0x62, 0x61, 0x72, 0x3a, 0x20, 0x42, 0x61, 0x72, 0x29, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x28, 0x62, 0x61, 0x72, 0x3a, 0x20, 0x24, 0x62, 0x61, 0x72, 0x29, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x53, + 0x6f, + 0x6d, + 0x65, + 0x74, + 0x68, + 0x69, + 0x6e, + 0x67, + 0x28, + 0x24, + 0x62, + 0x61, + 0x72, + 0x3a, + 0x20, + 0x42, + 0x61, + 0x72, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x28, + 0x62, + 0x61, + 0x72, + 0x3a, + 0x20, + 0x24, + 0x62, + 0x61, + 0x72, + 0x29, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "da8906d1f936b0ba2f53ecc3b4f994f97a74891d"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -261,6 +313,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetSomethingResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.Bar? bar, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(bar); @@ -360,6 +413,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetSomethingResult); + public GetSomethingResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -395,9 +449,9 @@ namespace Foo.Bar.State } public global::System.String? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetSomethingResultInfo(Foo, _entityIds, version); @@ -462,7 +516,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Operation_With_MultipleOperations.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Operation_With_MultipleOperations.snap index 3f2ae90ad29..4887bd6707d 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Operation_With_MultipleOperations.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Operation_With_MultipleOperations.snap @@ -243,6 +243,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _stringFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _barFormatter = default !; public global::System.String TypeName => "Bar"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _stringFormatter = serializerResolver.GetInputValueFormatter("String"); @@ -493,6 +494,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBarInfo.IsStrSet => _set_str; + public global::System.String StrNonNullable { get => _value_strNonNullable; @@ -504,6 +506,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBarInfo.IsStrNonNullableSet => _set_strNonNullable; + public global::Foo.Bar.Bar? Nested { get => _value_nested; @@ -515,6 +518,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBarInfo.IsNestedSet => _set_nested; + public global::System.Collections.Generic.IReadOnlyList NestedList { get => _value_nestedList; @@ -526,6 +530,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBarInfo.IsNestedListSet => _set_nestedList; + public global::System.Collections.Generic.IReadOnlyList?>? NestedMatrix { get => _value_nestedMatrix; @@ -557,8 +562,147 @@ namespace Foo.Bar public static TestOperationQueryDocument Instance { get; } = new TestOperationQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x24, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x3a, 0x20, 0x42, 0x61, 0x72, 0x21, 0x2c, 0x20, 0x24, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x5b, 0x42, 0x61, 0x72, 0x21, 0x5d, 0x21, 0x2c, 0x20, 0x24, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x5b, 0x5b, 0x42, 0x61, 0x72, 0x21, 0x5d, 0x5d, 0x29, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x28, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x3a, 0x20, 0x24, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x2c, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x24, 0x6c, 0x69, 0x73, 0x74, 0x2c, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x24, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x29, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x54, + 0x65, + 0x73, + 0x74, + 0x4f, + 0x70, + 0x65, + 0x72, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x28, + 0x24, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x42, + 0x61, + 0x72, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x5b, + 0x42, + 0x61, + 0x72, + 0x21, + 0x5d, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x5b, + 0x5b, + 0x42, + 0x61, + 0x72, + 0x21, + 0x5d, + 0x5d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x28, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x2c, + 0x20, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x2c, + 0x20, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x29, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "6aca82b03753ea1d58eba946d9b8a2ed36586c9c"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -590,6 +734,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ITestOperationResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.Bar single, global::System.Collections.Generic.IReadOnlyList list, global::System.Collections.Generic.IReadOnlyList?>? nestedList, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(single, list, nestedList); @@ -723,8 +868,148 @@ namespace Foo.Bar public static TestOperation2QueryDocument Instance { get; } = new TestOperation2QueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x28, 0x24, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x3a, 0x20, 0x42, 0x61, 0x72, 0x21, 0x2c, 0x20, 0x24, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x5b, 0x42, 0x61, 0x72, 0x21, 0x5d, 0x21, 0x2c, 0x20, 0x24, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x5b, 0x5b, 0x42, 0x61, 0x72, 0x21, 0x5d, 0x5d, 0x29, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x28, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x3a, 0x20, 0x24, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x2c, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x24, 0x6c, 0x69, 0x73, 0x74, 0x2c, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x24, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x29, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x54, + 0x65, + 0x73, + 0x74, + 0x4f, + 0x70, + 0x65, + 0x72, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x32, + 0x28, + 0x24, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x42, + 0x61, + 0x72, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x5b, + 0x42, + 0x61, + 0x72, + 0x21, + 0x5d, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x5b, + 0x5b, + 0x42, + 0x61, + 0x72, + 0x21, + 0x5d, + 0x5d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x28, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x2c, + 0x20, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x2c, + 0x20, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x29, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "4c447d93a3741461bd6929b4e3290bebf942e0f4"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -756,6 +1041,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ITestOperation2Result); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.Bar single, global::System.Collections.Generic.IReadOnlyList list, global::System.Collections.Generic.IReadOnlyList?>? nestedList, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(single, list, nestedList); @@ -889,8 +1175,148 @@ namespace Foo.Bar public static TestOperation3QueryDocument Instance { get; } = new TestOperation3QueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x33, 0x28, 0x24, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x3a, 0x20, 0x42, 0x61, 0x72, 0x21, 0x2c, 0x20, 0x24, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x5b, 0x42, 0x61, 0x72, 0x21, 0x5d, 0x21, 0x2c, 0x20, 0x24, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x5b, 0x5b, 0x42, 0x61, 0x72, 0x21, 0x5d, 0x5d, 0x29, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x28, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x3a, 0x20, 0x24, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x2c, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x24, 0x6c, 0x69, 0x73, 0x74, 0x2c, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x3a, 0x20, 0x24, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x29, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x54, + 0x65, + 0x73, + 0x74, + 0x4f, + 0x70, + 0x65, + 0x72, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x33, + 0x28, + 0x24, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x42, + 0x61, + 0x72, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x5b, + 0x42, + 0x61, + 0x72, + 0x21, + 0x5d, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x5b, + 0x5b, + 0x42, + 0x61, + 0x72, + 0x21, + 0x5d, + 0x5d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x28, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x73, + 0x69, + 0x6e, + 0x67, + 0x6c, + 0x65, + 0x2c, + 0x20, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x2c, + 0x20, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x29, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "a377633fa3ecfd86e7171c57e87aec71a1224663"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -922,6 +1348,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ITestOperation3Result); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.Bar single, global::System.Collections.Generic.IReadOnlyList list, global::System.Collections.Generic.IReadOnlyList?>? nestedList, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(single, list, nestedList); @@ -1088,6 +1515,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ITestOperationResult); + public TestOperationResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -1123,9 +1551,9 @@ namespace Foo.Bar.State } public global::System.String? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new TestOperationResultInfo(Foo, _entityIds, version); @@ -1143,6 +1571,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ITestOperation2Result); + public TestOperation2Result Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -1178,9 +1607,9 @@ namespace Foo.Bar.State } public global::System.String? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new TestOperation2ResultInfo(Foo, _entityIds, version); @@ -1198,6 +1627,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ITestOperation3Result); + public TestOperation3Result Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -1233,9 +1663,9 @@ namespace Foo.Bar.State } public global::System.String? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new TestOperation3ResultInfo(Foo, _entityIds, version); @@ -1394,7 +1824,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Response_Name_Is_Correctly_Cased.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Response_Name_Is_Correctly_Cased.snap index d34667a143b..c3bd122d840 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Response_Name_Is_Correctly_Cased.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/OperationGeneratorTests.Response_Name_Is_Correctly_Cased.snap @@ -108,8 +108,58 @@ namespace Foo.Bar public static GetSomethingQueryDocument Instance { get; } = new GetSomethingQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x20, 0x7b, 0x20, 0x62, 0x61, 0x72, 0x5f, 0x62, 0x61, 0x7a, 0x5f, 0x66, 0x6f, 0x6f, 0x3a, 0x20, 0x66, 0x6f, 0x6f, 0x5f, 0x62, 0x61, 0x72, 0x5f, 0x62, 0x61, 0x7a, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x53, + 0x6f, + 0x6d, + 0x65, + 0x74, + 0x68, + 0x69, + 0x6e, + 0x67, + 0x20, + 0x7b, + 0x20, + 0x62, + 0x61, + 0x72, + 0x5f, + 0x62, + 0x61, + 0x7a, + 0x5f, + 0x66, + 0x6f, + 0x6f, + 0x3a, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x5f, + 0x62, + 0x61, + 0x72, + 0x5f, + 0x62, + 0x61, + 0x7a, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "9507f9500bdf3672c4c7762930e240f720fcce40"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -139,6 +189,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetSomethingResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -224,6 +275,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetSomethingResult); + public GetSomethingResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -259,9 +311,9 @@ namespace Foo.Bar.State } public global::System.String? Bar_baz_foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetSomethingResultInfo(Bar_baz_foo, _entityIds, version); @@ -317,7 +369,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/PersistedOperationGeneratorTests.Simple_Custom_Scalar.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/PersistedOperationGeneratorTests.Simple_Custom_Scalar.snap index 621f6cbd087..c19b4d43a44 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/PersistedOperationGeneratorTests.Simple_Custom_Scalar.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/PersistedOperationGeneratorTests.Simple_Custom_Scalar.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.String? Email { get; } public virtual global::System.Boolean Equals(GetPerson_Person_Person? other) @@ -165,7 +164,6 @@ namespace Foo.Bar public partial interface IGetPerson_Person { public global::System.String Name { get; } - public global::System.String? Email { get; } } @@ -199,6 +197,7 @@ namespace Foo.Bar public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; public global::System.ReadOnlySpan Body => new global::System.Byte[0]; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "90e3850be405988debbddcbd8810ef6e54f016e5"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -232,6 +231,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -321,6 +321,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPersonResult); + public GetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -376,9 +377,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.PersonData? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPersonResultInfo(Person, _entityIds, version); @@ -479,9 +480,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.String? Email { get; } } @@ -490,7 +489,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ResultTypeGeneratorTests.Nested_Entity.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ResultTypeGeneratorTests.Nested_Entity.snap index 79c5f7286cd..f6ad3950d53 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ResultTypeGeneratorTests.Nested_Entity.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ResultTypeGeneratorTests.Nested_Entity.snap @@ -91,9 +91,7 @@ namespace Foo.Bar } public global::System.Boolean IsValid { get; } - public global::Foo.Bar.IDecodeVIN_DecodeVIN_VehicleMake? VehicleMake { get; } - public global::Foo.Bar.IDecodeVIN_DecodeVIN_VehicleModel? VehicleModel { get; } public virtual global::System.Boolean Equals(DecodeVIN_DecodeVIN_DecodeVIN? other) @@ -170,11 +168,8 @@ namespace Foo.Bar } public global::System.Guid Id { get; } - public global::System.String? Make { get; } - public global::System.String? MakeCode { get; } - public global::System.Boolean IsDisabled { get; } public virtual global::System.Boolean Equals(DecodeVIN_DecodeVIN_VehicleMake_VehicleMake? other) @@ -254,15 +249,10 @@ namespace Foo.Bar } public global::System.Guid Id { get; } - public global::System.String? Model { get; } - public global::System.String? ModelCode { get; } - public global::System.Guid VehicleMakeId { get; } - public global::System.Boolean IsDisabled { get; } - public global::System.String? ModelType { get; } public virtual global::System.Boolean Equals(DecodeVIN_DecodeVIN_VehicleModel_VehicleModel? other) @@ -345,9 +335,7 @@ namespace Foo.Bar public partial interface IDecodeVINModel { public global::System.Boolean IsValid { get; } - public global::Foo.Bar.IDecodeVIN_DecodeVIN_VehicleMake? VehicleMake { get; } - public global::Foo.Bar.IDecodeVIN_DecodeVIN_VehicleModel? VehicleModel { get; } } @@ -368,11 +356,8 @@ namespace Foo.Bar public partial interface IVehicleMakeModel { public global::System.Guid Id { get; } - public global::System.String? Make { get; } - public global::System.String? MakeCode { get; } - public global::System.Boolean IsDisabled { get; } } @@ -393,15 +378,10 @@ namespace Foo.Bar public partial interface IVehicleModelModel { public global::System.Guid Id { get; } - public global::System.String? Model { get; } - public global::System.String? ModelCode { get; } - public global::System.Guid VehicleMakeId { get; } - public global::System.Boolean IsDisabled { get; } - public global::System.String? ModelType { get; } } @@ -472,8 +452,448 @@ namespace Foo.Bar public static DecodeVINQueryDocument Instance { get; } = new DecodeVINQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x49, 0x4e, 0x20, 0x7b, 0x20, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x49, 0x4e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x49, 0x4e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x49, 0x4e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x49, 0x4e, 0x20, 0x7b, 0x20, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x76, 0x65, 0x68, 0x69, 0x63, 0x6c, 0x65, 0x4d, 0x61, 0x6b, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x56, 0x65, 0x68, 0x69, 0x63, 0x6c, 0x65, 0x4d, 0x61, 0x6b, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x56, 0x65, 0x68, 0x69, 0x63, 0x6c, 0x65, 0x4d, 0x61, 0x6b, 0x65, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x76, 0x65, 0x68, 0x69, 0x63, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x56, 0x65, 0x68, 0x69, 0x63, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x56, 0x65, 0x68, 0x69, 0x63, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x56, 0x65, 0x68, 0x69, 0x63, 0x6c, 0x65, 0x4d, 0x61, 0x6b, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x20, 0x6f, 0x6e, 0x20, 0x56, 0x65, 0x68, 0x69, 0x63, 0x6c, 0x65, 0x4d, 0x61, 0x6b, 0x65, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x20, 0x69, 0x73, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x56, 0x65, 0x68, 0x69, 0x63, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x20, 0x6f, 0x6e, 0x20, 0x56, 0x65, 0x68, 0x69, 0x63, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x43, 0x6f, 0x64, 0x65, 0x20, 0x76, 0x65, 0x68, 0x69, 0x63, 0x6c, 0x65, 0x4d, 0x61, 0x6b, 0x65, 0x49, 0x64, 0x20, 0x69, 0x73, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x44, + 0x65, + 0x63, + 0x6f, + 0x64, + 0x65, + 0x56, + 0x49, + 0x4e, + 0x20, + 0x7b, + 0x20, + 0x64, + 0x65, + 0x63, + 0x6f, + 0x64, + 0x65, + 0x56, + 0x49, + 0x4e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x44, + 0x65, + 0x63, + 0x6f, + 0x64, + 0x65, + 0x56, + 0x49, + 0x4e, + 0x4d, + 0x6f, + 0x64, + 0x65, + 0x6c, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x44, + 0x65, + 0x63, + 0x6f, + 0x64, + 0x65, + 0x56, + 0x49, + 0x4e, + 0x4d, + 0x6f, + 0x64, + 0x65, + 0x6c, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x65, + 0x63, + 0x6f, + 0x64, + 0x65, + 0x56, + 0x49, + 0x4e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x73, + 0x56, + 0x61, + 0x6c, + 0x69, + 0x64, + 0x20, + 0x76, + 0x65, + 0x68, + 0x69, + 0x63, + 0x6c, + 0x65, + 0x4d, + 0x61, + 0x6b, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x56, + 0x65, + 0x68, + 0x69, + 0x63, + 0x6c, + 0x65, + 0x4d, + 0x61, + 0x6b, + 0x65, + 0x4d, + 0x6f, + 0x64, + 0x65, + 0x6c, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x56, + 0x65, + 0x68, + 0x69, + 0x63, + 0x6c, + 0x65, + 0x4d, + 0x61, + 0x6b, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x76, + 0x65, + 0x68, + 0x69, + 0x63, + 0x6c, + 0x65, + 0x4d, + 0x6f, + 0x64, + 0x65, + 0x6c, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x56, + 0x65, + 0x68, + 0x69, + 0x63, + 0x6c, + 0x65, + 0x4d, + 0x6f, + 0x64, + 0x65, + 0x6c, + 0x4d, + 0x6f, + 0x64, + 0x65, + 0x6c, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x56, + 0x65, + 0x68, + 0x69, + 0x63, + 0x6c, + 0x65, + 0x4d, + 0x6f, + 0x64, + 0x65, + 0x6c, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x56, + 0x65, + 0x68, + 0x69, + 0x63, + 0x6c, + 0x65, + 0x4d, + 0x61, + 0x6b, + 0x65, + 0x4d, + 0x6f, + 0x64, + 0x65, + 0x6c, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x56, + 0x65, + 0x68, + 0x69, + 0x63, + 0x6c, + 0x65, + 0x4d, + 0x61, + 0x6b, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x6d, + 0x61, + 0x6b, + 0x65, + 0x20, + 0x6d, + 0x61, + 0x6b, + 0x65, + 0x43, + 0x6f, + 0x64, + 0x65, + 0x20, + 0x69, + 0x73, + 0x44, + 0x69, + 0x73, + 0x61, + 0x62, + 0x6c, + 0x65, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x56, + 0x65, + 0x68, + 0x69, + 0x63, + 0x6c, + 0x65, + 0x4d, + 0x6f, + 0x64, + 0x65, + 0x6c, + 0x4d, + 0x6f, + 0x64, + 0x65, + 0x6c, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x56, + 0x65, + 0x68, + 0x69, + 0x63, + 0x6c, + 0x65, + 0x4d, + 0x6f, + 0x64, + 0x65, + 0x6c, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x6d, + 0x6f, + 0x64, + 0x65, + 0x6c, + 0x20, + 0x6d, + 0x6f, + 0x64, + 0x65, + 0x6c, + 0x43, + 0x6f, + 0x64, + 0x65, + 0x20, + 0x76, + 0x65, + 0x68, + 0x69, + 0x63, + 0x6c, + 0x65, + 0x4d, + 0x61, + 0x6b, + 0x65, + 0x49, + 0x64, + 0x20, + 0x69, + 0x73, + 0x44, + 0x69, + 0x73, + 0x61, + 0x62, + 0x6c, + 0x65, + 0x64, + 0x20, + 0x6d, + 0x6f, + 0x64, + 0x65, + 0x6c, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "3f6909b5b7145f91544b46b59247799ab1582d49"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -540,6 +960,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IDecodeVINResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -664,11 +1085,8 @@ namespace Foo.Bar.State } public global::System.Guid Id { get; } - public global::System.String? Make { get; } - public global::System.String? MakeCode { get; } - public global::System.Boolean IsDisabled { get; } } @@ -687,15 +1105,10 @@ namespace Foo.Bar.State } public global::System.Guid Id { get; } - public global::System.String? Model { get; } - public global::System.String? ModelCode { get; } - public global::System.Guid VehicleMakeId { get; } - public global::System.Boolean IsDisabled { get; } - public global::System.String? ModelType { get; } } @@ -714,6 +1127,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IDecodeVINResult); + public DecodeVINResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -794,9 +1208,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.DecodeVINData DecodeVIN { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new DecodeVINResultInfo(DecodeVIN, _entityIds, version); @@ -979,11 +1393,8 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Boolean? IsValid { get; } - public global::StrawberryShake.EntityId? VehicleMake { get; } - public global::StrawberryShake.EntityId? VehicleModel { get; } } @@ -1034,7 +1445,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ResultTypeGeneratorTests.Operation_With_Comments.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ResultTypeGeneratorTests.Operation_With_Comments.snap index 19feebacf7b..d5b4278842b 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ResultTypeGeneratorTests.Operation_With_Comments.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ResultTypeGeneratorTests.Operation_With_Comments.snap @@ -103,22 +103,18 @@ namespace Foo.Bar /// Field str /// public global::System.String? Str { get; } - /// /// Field strNonNullable /// public global::System.String StrNonNullable { get; } - /// /// Field nested /// public global::Foo.Bar.IGetFoo_Foo_Nested? Nested { get; } - /// /// Field nestedList /// public global::System.Collections.Generic.IReadOnlyList NestedList { get; } - /// /// Field nestedMatrix /// @@ -441,22 +437,18 @@ namespace Foo.Bar /// Field str /// public global::System.String? Str { get; } - /// /// Field strNonNullable /// public global::System.String StrNonNullable { get; } - /// /// Field nested /// public global::Foo.Bar.IGetFoo_Foo_Nested? Nested { get; } - /// /// Field nestedList /// public global::System.Collections.Generic.IReadOnlyList NestedList { get; } - /// /// Field nestedMatrix /// @@ -572,8 +564,153 @@ namespace Foo.Bar public static GetFooQueryDocument Instance { get; } = new GetFooQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x74, 0x72, 0x20, 0x73, 0x74, 0x72, 0x4e, 0x6f, 0x6e, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x74, 0x72, 0x20, 0x7d, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x74, 0x72, 0x20, 0x7d, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x74, 0x72, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x46, + 0x6f, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x74, + 0x72, + 0x20, + 0x73, + 0x74, + 0x72, + 0x4e, + 0x6f, + 0x6e, + 0x4e, + 0x75, + 0x6c, + 0x6c, + 0x61, + 0x62, + 0x6c, + 0x65, + 0x20, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x74, + 0x72, + 0x20, + 0x7d, + 0x20, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x74, + 0x72, + 0x20, + 0x7d, + 0x20, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4d, + 0x61, + 0x74, + 0x72, + 0x69, + 0x78, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x74, + 0x72, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "389e0dede74e9628a1ba44caa630c03e186e3344"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -619,6 +756,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetFooResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -720,6 +858,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetFooResult); + public GetFooResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -878,9 +1017,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.BazData? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetFooResultInfo(Foo, _entityIds, version); @@ -1109,19 +1248,14 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - ///Field str public global::System.String? Str { get; } - ///Field strNonNullable public global::System.String? StrNonNullable { get; } - ///Field nested public global::Foo.Bar.State.BazData? Nested { get; } - ///Field nestedList public global::System.Collections.Generic.IReadOnlyList? NestedList { get; } - ///Field nestedMatrix public global::System.Collections.Generic.IReadOnlyList?>? NestedMatrix { get; } } @@ -1131,7 +1265,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ResultTypeGeneratorTests.Operation_With_Complex_Types.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ResultTypeGeneratorTests.Operation_With_Complex_Types.snap index eac5da405bd..b420c95a322 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ResultTypeGeneratorTests.Operation_With_Complex_Types.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ResultTypeGeneratorTests.Operation_With_Complex_Types.snap @@ -97,13 +97,9 @@ namespace Foo.Bar } public global::System.String? Str { get; } - public global::System.String StrNonNullable { get; } - public global::Foo.Bar.IGetFoo_Foo_Nested? Nested { get; } - public global::System.Collections.Generic.IReadOnlyList NestedList { get; } - public global::System.Collections.Generic.IReadOnlyList?>? NestedMatrix { get; } public virtual global::System.Boolean Equals(GetFoo_Foo_Baz? other) @@ -399,13 +395,9 @@ namespace Foo.Bar public partial interface IGetFoo_Foo { public global::System.String? Str { get; } - public global::System.String StrNonNullable { get; } - public global::Foo.Bar.IGetFoo_Foo_Nested? Nested { get; } - public global::System.Collections.Generic.IReadOnlyList NestedList { get; } - public global::System.Collections.Generic.IReadOnlyList?>? NestedMatrix { get; } } @@ -488,8 +480,153 @@ namespace Foo.Bar public static GetFooQueryDocument Instance { get; } = new GetFooQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x20, 0x7b, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x74, 0x72, 0x20, 0x73, 0x74, 0x72, 0x4e, 0x6f, 0x6e, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x74, 0x72, 0x20, 0x7d, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x74, 0x72, 0x20, 0x7d, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x74, 0x72, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x46, + 0x6f, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x74, + 0x72, + 0x20, + 0x73, + 0x74, + 0x72, + 0x4e, + 0x6f, + 0x6e, + 0x4e, + 0x75, + 0x6c, + 0x6c, + 0x61, + 0x62, + 0x6c, + 0x65, + 0x20, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x74, + 0x72, + 0x20, + 0x7d, + 0x20, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x74, + 0x72, + 0x20, + 0x7d, + 0x20, + 0x6e, + 0x65, + 0x73, + 0x74, + 0x65, + 0x64, + 0x4d, + 0x61, + 0x74, + 0x72, + 0x69, + 0x78, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x74, + 0x72, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "389e0dede74e9628a1ba44caa630c03e186e3344"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -535,6 +672,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetFooResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -636,6 +774,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetFooResult); + public GetFooResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -794,9 +933,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.BazData? Foo { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetFooResultInfo(Foo, _entityIds, version); @@ -1024,15 +1163,10 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Str { get; } - public global::System.String? StrNonNullable { get; } - public global::Foo.Bar.State.BazData? Nested { get; } - public global::System.Collections.Generic.IReadOnlyList? NestedList { get; } - public global::System.Collections.Generic.IReadOnlyList?>? NestedMatrix { get; } } @@ -1041,7 +1175,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ResultTypeGeneratorTests.Operation_With_NullableData.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ResultTypeGeneratorTests.Operation_With_NullableData.snap index 3280e00dca4..bf2801be5c0 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ResultTypeGeneratorTests.Operation_With_NullableData.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ResultTypeGeneratorTests.Operation_With_NullableData.snap @@ -90,7 +90,6 @@ namespace Foo.Bar } public global::System.String Action { get; } - public global::Foo.Bar.IOnFooUpdated_OnFooUpdated_Data Data { get; } public virtual global::System.Boolean Equals(OnFooUpdated_OnFooUpdated_FooNotification? other) @@ -162,19 +161,12 @@ namespace Foo.Bar } public global::System.String BarGUID { get; } - public global::System.String ThingGUID { get; } - public global::System.String ThingDATE { get; } - public global::System.String? ThingSTATUS { get; } - public global::System.String FooGUID { get; } - public global::System.String? FooAUTHOR { get; } - public global::System.String FooDATE { get; } - public global::System.String? FooTEXT { get; } public virtual global::System.Boolean Equals(OnFooUpdated_OnFooUpdated_Data_FooNotificationData? other) @@ -259,7 +251,6 @@ namespace Foo.Bar public partial interface IOnFooUpdated_OnFooUpdated { public global::System.String Action { get; } - public global::Foo.Bar.IOnFooUpdated_OnFooUpdated_Data Data { get; } } @@ -274,19 +265,12 @@ namespace Foo.Bar public partial interface IOnFooUpdated_OnFooUpdated_Data { public global::System.String BarGUID { get; } - public global::System.String ThingGUID { get; } - public global::System.String ThingDATE { get; } - public global::System.String? ThingSTATUS { get; } - public global::System.String FooGUID { get; } - public global::System.String? FooAUTHOR { get; } - public global::System.String FooDATE { get; } - public global::System.String? FooTEXT { get; } } @@ -328,8 +312,169 @@ namespace Foo.Bar public static OnFooUpdatedSubscriptionDocument Instance { get; } = new OnFooUpdatedSubscriptionDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Subscription; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4f, 0x6e, 0x46, 0x6f, 0x6f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x20, 0x7b, 0x20, 0x6f, 0x6e, 0x46, 0x6f, 0x6f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x62, 0x61, 0x72, 0x47, 0x55, 0x49, 0x44, 0x20, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x47, 0x55, 0x49, 0x44, 0x20, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x44, 0x41, 0x54, 0x45, 0x20, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x20, 0x66, 0x6f, 0x6f, 0x47, 0x55, 0x49, 0x44, 0x20, 0x66, 0x6f, 0x6f, 0x41, 0x55, 0x54, 0x48, 0x4f, 0x52, 0x20, 0x66, 0x6f, 0x6f, 0x44, 0x41, 0x54, 0x45, 0x20, 0x66, 0x6f, 0x6f, 0x54, 0x45, 0x58, 0x54, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x73, + 0x75, + 0x62, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x4f, + 0x6e, + 0x46, + 0x6f, + 0x6f, + 0x55, + 0x70, + 0x64, + 0x61, + 0x74, + 0x65, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x6f, + 0x6e, + 0x46, + 0x6f, + 0x6f, + 0x55, + 0x70, + 0x64, + 0x61, + 0x74, + 0x65, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x61, + 0x63, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x64, + 0x61, + 0x74, + 0x61, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x62, + 0x61, + 0x72, + 0x47, + 0x55, + 0x49, + 0x44, + 0x20, + 0x74, + 0x68, + 0x69, + 0x6e, + 0x67, + 0x47, + 0x55, + 0x49, + 0x44, + 0x20, + 0x74, + 0x68, + 0x69, + 0x6e, + 0x67, + 0x44, + 0x41, + 0x54, + 0x45, + 0x20, + 0x74, + 0x68, + 0x69, + 0x6e, + 0x67, + 0x53, + 0x54, + 0x41, + 0x54, + 0x55, + 0x53, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x47, + 0x55, + 0x49, + 0x44, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x41, + 0x55, + 0x54, + 0x48, + 0x4f, + 0x52, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x44, + 0x41, + 0x54, + 0x45, + 0x20, + 0x66, + 0x6f, + 0x6f, + 0x54, + 0x45, + 0x58, + 0x54, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "e03070cdeadb90b2eff58618790e1892dbf89b15"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -373,6 +518,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IOnFooUpdatedResult); + public global::System.IObservable> Watch(global::StrawberryShake.ExecutionStrategy? strategy = null) { var request = CreateRequest(); @@ -465,6 +611,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IOnFooUpdatedResult); + public OnFooUpdatedResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -530,9 +677,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.FooNotificationData OnFooUpdated { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new OnFooUpdatedResultInfo(OnFooUpdated, _entityIds, version); @@ -652,9 +799,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Action { get; } - public global::Foo.Bar.State.FooNotificationDataData? Data { get; } } @@ -676,21 +821,13 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? BarGUID { get; } - public global::System.String? ThingGUID { get; } - public global::System.String? ThingDATE { get; } - public global::System.String? ThingSTATUS { get; } - public global::System.String? FooGUID { get; } - public global::System.String? FooAUTHOR { get; } - public global::System.String? FooDATE { get; } - public global::System.String? FooTEXT { get; } } @@ -699,7 +836,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Any_Scalar.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Any_Scalar.snap index 91c555e9ebf..190fdec8c79 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Any_Scalar.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Any_Scalar.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.Object? Data { get; } public virtual global::System.Boolean Equals(GetPerson_Person_Person? other) @@ -165,7 +164,6 @@ namespace Foo.Bar public partial interface IGetPerson_Person { public global::System.String Name { get; } - public global::System.Object? Data { get; } } @@ -197,8 +195,62 @@ namespace Foo.Bar public static GetPersonQueryDocument Instance { get; } = new GetPersonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x64, + 0x61, + 0x74, + 0x61, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "368598981f25055985a805466e9d638691b4b1e6"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -232,6 +284,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -321,6 +374,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPersonResult); + public GetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -376,9 +430,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.PersonData? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPersonResultInfo(Person, _entityIds, version); @@ -479,9 +533,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.Object? Data { get; } } @@ -490,7 +542,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Any_Type.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Any_Type.snap index 6aed069759b..a4e5571493c 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Any_Type.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Any_Type.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.Text.Json.JsonElement? Email { get; } public virtual global::System.Boolean Equals(GetPerson_Person_Person? other) @@ -165,7 +164,6 @@ namespace Foo.Bar public partial interface IGetPerson_Person { public global::System.String Name { get; } - public global::System.Text.Json.JsonElement? Email { get; } } @@ -197,8 +195,63 @@ namespace Foo.Bar public static GetPersonQueryDocument Instance { get; } = new GetPersonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "90e3850be405988debbddcbd8810ef6e54f016e5"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -232,6 +285,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -321,6 +375,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPersonResult); + public GetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -376,9 +431,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.PersonData? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPersonResultInfo(Person, _entityIds, version); @@ -479,9 +534,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.Text.Json.JsonElement? Email { get; } } @@ -490,7 +543,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.ByteArray_ScalarType.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.ByteArray_ScalarType.snap index d7bc10c297e..e15fd8e211d 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.ByteArray_ScalarType.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.ByteArray_ScalarType.snap @@ -104,8 +104,44 @@ namespace Foo.Bar public static GetAttachmentQueryDocument Instance { get; } = new GetAttachmentQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x7b, 0x20, 0x62, 0x79, 0x74, 0x65, 0x41, 0x72, 0x72, 0x61, 0x79, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x41, + 0x74, + 0x74, + 0x61, + 0x63, + 0x68, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x7b, + 0x20, + 0x62, + 0x79, + 0x74, + 0x65, + 0x41, + 0x72, + 0x72, + 0x61, + 0x79, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "8705e9978f3ff458aeb2844ad87162d9028f0801"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -135,6 +171,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetAttachmentResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -220,6 +257,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetAttachmentResult); + public GetAttachmentResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -255,9 +293,9 @@ namespace Foo.Bar.State } public global::System.Byte[] ByteArray { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetAttachmentResultInfo(ByteArray, _entityIds, version); @@ -313,7 +351,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Complete_Schema_With_Uuid_And_DateTime.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Complete_Schema_With_Uuid_And_DateTime.snap index 9bd61bb7176..f328f530b80 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Complete_Schema_With_Uuid_And_DateTime.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Complete_Schema_With_Uuid_And_DateTime.snap @@ -105,17 +105,11 @@ namespace Foo.Bar } public global::System.Guid Id { get; } - public global::System.Decimal Amount { get; } - public global::System.DateTimeOffset Date { get; } - public global::System.String? Description { get; } - public global::Foo.Bar.ExpenseCategory Category { get; } - public global::Foo.Bar.PaymentMethod PaymentMethod { get; } - public global::System.Collections.Generic.IReadOnlyList? Tags { get; } public virtual global::System.Boolean Equals(AllExpenses_Expense_Expense? other) @@ -267,17 +261,11 @@ namespace Foo.Bar public partial interface IAllExpenses_Expense { public global::System.Guid Id { get; } - public global::System.Decimal Amount { get; } - public global::System.DateTimeOffset Date { get; } - public global::System.String? Description { get; } - public global::Foo.Bar.ExpenseCategory Category { get; } - public global::Foo.Bar.PaymentMethod PaymentMethod { get; } - public global::System.Collections.Generic.IReadOnlyList? Tags { get; } } @@ -327,6 +315,7 @@ namespace Foo.Bar public partial class ExpenseCategorySerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "ExpenseCategory"; + public ExpenseCategory Parse(global::System.String serializedValue) { return serializedValue switch @@ -390,6 +379,7 @@ namespace Foo.Bar public partial class PaymentMethodSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "PaymentMethod"; + public PaymentMethod Parse(global::System.String serializedValue) { return serializedValue switch @@ -448,8 +438,152 @@ namespace Foo.Bar public static AllExpensesQueryDocument Instance { get; } = new AllExpensesQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x41, 0x6c, 0x6c, 0x45, 0x78, 0x70, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x65, 0x78, 0x70, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x64, 0x20, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x64, 0x61, 0x74, 0x65, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x20, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x74, 0x61, 0x67, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x45, 0x78, 0x70, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x41, + 0x6c, + 0x6c, + 0x45, + 0x78, + 0x70, + 0x65, + 0x6e, + 0x73, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x65, + 0x78, + 0x70, + 0x65, + 0x6e, + 0x73, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x64, + 0x20, + 0x61, + 0x6d, + 0x6f, + 0x75, + 0x6e, + 0x74, + 0x20, + 0x64, + 0x61, + 0x74, + 0x65, + 0x20, + 0x64, + 0x65, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x63, + 0x61, + 0x74, + 0x65, + 0x67, + 0x6f, + 0x72, + 0x79, + 0x20, + 0x70, + 0x61, + 0x79, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x4d, + 0x65, + 0x74, + 0x68, + 0x6f, + 0x64, + 0x20, + 0x74, + 0x61, + 0x67, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x45, + 0x78, + 0x70, + 0x65, + 0x6e, + 0x73, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "2c6c9362bd54e9b97f02c5b99f7ac6c1fab8169b"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -494,6 +628,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IAllExpensesResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -599,17 +734,11 @@ namespace Foo.Bar.State } public global::System.Guid Id { get; } - public global::System.Decimal Amount { get; } - public global::System.DateTimeOffset Date { get; } - public global::System.String? Description { get; } - public global::Foo.Bar.ExpenseCategory Category { get; } - public global::Foo.Bar.PaymentMethod PaymentMethod { get; } - public global::System.Collections.Generic.IReadOnlyList? Tags { get; } } @@ -626,6 +755,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IAllExpensesResult); + public AllExpensesResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -692,9 +822,9 @@ namespace Foo.Bar.State } public global::System.Collections.Generic.IReadOnlyList? Expense { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new AllExpensesResultInfo(Expense, _entityIds, version); @@ -937,7 +1067,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } } @@ -1003,7 +1132,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Custom_Scalar_With_RuntimeType.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Custom_Scalar_With_RuntimeType.snap index da0c74a70c6..01a90075581 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Custom_Scalar_With_RuntimeType.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Custom_Scalar_With_RuntimeType.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.Int32? Email { get; } public virtual global::System.Boolean Equals(GetPerson_Person_Person? other) @@ -165,7 +164,6 @@ namespace Foo.Bar public partial interface IGetPerson_Person { public global::System.String Name { get; } - public global::System.Int32? Email { get; } } @@ -197,8 +195,63 @@ namespace Foo.Bar public static GetPersonQueryDocument Instance { get; } = new GetPersonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "90e3850be405988debbddcbd8810ef6e54f016e5"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -232,6 +285,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -321,6 +375,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPersonResult); + public GetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -376,9 +431,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.PersonData? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPersonResultInfo(Person, _entityIds, version); @@ -479,9 +534,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.Int32? Email { get; } } @@ -490,7 +543,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Custom_Scalar_With_RuntimeType_ValueType_AsInput.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Custom_Scalar_With_RuntimeType_ValueType_AsInput.snap index e8eada7c271..057875c1a4a 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Custom_Scalar_With_RuntimeType_ValueType_AsInput.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Custom_Scalar_With_RuntimeType_ValueType_AsInput.snap @@ -186,8 +186,92 @@ namespace Foo.Bar public static SetPersonQueryDocument Instance { get; } = new SetPersonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x53, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x28, 0x24, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x3a, 0x20, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x65, 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x28, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x3a, 0x20, 0x24, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x29, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x53, + 0x65, + 0x74, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x28, + 0x24, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x3a, + 0x20, + 0x45, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x65, + 0x74, + 0x45, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x28, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x3a, + 0x20, + 0x24, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x29, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "969f32b130bc0037d5f598a45e088f8bc7690fc8"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -222,6 +306,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ISetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Index email, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(email); @@ -317,6 +402,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ISetPersonResult); + public SetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -372,9 +458,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.PersonData? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new SetPersonResultInfo(Person, _entityIds, version); @@ -457,7 +543,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Index? SetEmail { get; } } @@ -466,7 +551,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Custom_Scalar_With_SerializationType.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Custom_Scalar_With_SerializationType.snap index 472c1cd032a..8b20f97f7ac 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Custom_Scalar_With_SerializationType.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Custom_Scalar_With_SerializationType.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.String? Email { get; } public virtual global::System.Boolean Equals(GetPerson_Person_Person? other) @@ -165,7 +164,6 @@ namespace Foo.Bar public partial interface IGetPerson_Person { public global::System.String Name { get; } - public global::System.String? Email { get; } } @@ -197,8 +195,63 @@ namespace Foo.Bar public static GetPersonQueryDocument Instance { get; } = new GetPersonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "90e3850be405988debbddcbd8810ef6e54f016e5"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -232,6 +285,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -321,6 +375,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPersonResult); + public GetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -376,9 +431,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.PersonData? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPersonResultInfo(Person, _entityIds, version); @@ -479,9 +534,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.String? Email { get; } } @@ -490,7 +543,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Custom_Scalar_With_SerializationType_And_RuntimeType.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Custom_Scalar_With_SerializationType_And_RuntimeType.snap index bf7fddfdb1a..1feb96b946e 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Custom_Scalar_With_SerializationType_And_RuntimeType.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Custom_Scalar_With_SerializationType_And_RuntimeType.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.Int64? Email { get; } public virtual global::System.Boolean Equals(GetPerson_Person_Person? other) @@ -165,7 +164,6 @@ namespace Foo.Bar public partial interface IGetPerson_Person { public global::System.String Name { get; } - public global::System.Int64? Email { get; } } @@ -197,8 +195,63 @@ namespace Foo.Bar public static GetPersonQueryDocument Instance { get; } = new GetPersonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "90e3850be405988debbddcbd8810ef6e54f016e5"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -232,6 +285,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -321,6 +375,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPersonResult); + public GetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -376,9 +431,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.PersonData? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPersonResultInfo(Person, _entityIds, version); @@ -479,9 +534,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.Int64? Email { get; } } @@ -490,7 +543,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Custom_Scalar_With_Unknown_RuntimeType.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Custom_Scalar_With_Unknown_RuntimeType.snap index e24dae8abd6..b6cb7e78491 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Custom_Scalar_With_Unknown_RuntimeType.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Custom_Scalar_With_Unknown_RuntimeType.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Custom? Email { get; } public virtual global::System.Boolean Equals(GetPerson_Person_Person? other) @@ -165,7 +164,6 @@ namespace Foo.Bar public partial interface IGetPerson_Person { public global::System.String Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Custom? Email { get; } } @@ -197,8 +195,63 @@ namespace Foo.Bar public static GetPersonQueryDocument Instance { get; } = new GetPersonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "90e3850be405988debbddcbd8810ef6e54f016e5"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -232,6 +285,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -321,6 +375,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPersonResult); + public GetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -376,9 +431,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.PersonData? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPersonResultInfo(Person, _entityIds, version); @@ -479,9 +534,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::StrawberryShake.CodeGeneration.CSharp.Custom? Email { get; } } @@ -490,7 +543,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Only_Custom_Scalars.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Only_Custom_Scalars.snap index 5be98f68427..5908e4dae06 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Only_Custom_Scalars.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Only_Custom_Scalars.snap @@ -190,8 +190,58 @@ namespace Foo.Bar public static GetPersonQueryDocument Instance { get; } = new GetPersonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "5584daf20236e87cc2159892887cd0fa5c76a944"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -224,6 +274,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -312,6 +363,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPersonResult); + public GetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -367,9 +419,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.PersonData? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPersonResultInfo(Person, _entityIds, version); @@ -452,7 +504,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Email { get; } } @@ -461,7 +512,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Scalars_Are_Correctly_Inferred.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Scalars_Are_Correctly_Inferred.snap index 7913ee5cb44..3c33b4b154f 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Scalars_Are_Correctly_Inferred.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Scalars_Are_Correctly_Inferred.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.Double? NumberFloat { get; } - public global::System.Int32? NumberInt { get; } public virtual global::System.Boolean Equals(GetAll_Listings_Offer? other) @@ -169,7 +168,6 @@ namespace Foo.Bar public partial interface IOffer { public global::System.Double? NumberFloat { get; } - public global::System.Int32? NumberInt { get; } } @@ -211,8 +209,111 @@ namespace Foo.Bar public static GetAllQueryDocument Instance { get; } = new GetAllQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x20, 0x7b, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x20, 0x6f, 0x6e, 0x20, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x20, 0x7b, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x41, + 0x6c, + 0x6c, + 0x20, + 0x7b, + 0x20, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x4f, + 0x66, + 0x66, + 0x65, + 0x72, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x4f, + 0x66, + 0x66, + 0x65, + 0x72, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4f, + 0x66, + 0x66, + 0x65, + 0x72, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x75, + 0x6d, + 0x62, + 0x65, + 0x72, + 0x46, + 0x6c, + 0x6f, + 0x61, + 0x74, + 0x20, + 0x6e, + 0x75, + 0x6d, + 0x62, + 0x65, + 0x72, + 0x49, + 0x6e, + 0x74, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "f1d55f52ab8224f1113e9ad0cb8321f1bafff815"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -250,6 +351,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetAllResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -343,6 +445,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetAllResult); + public GetAllResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -409,9 +512,9 @@ namespace Foo.Bar.State } public global::System.Collections.Generic.IReadOnlyList Listings { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetAllResultInfo(Listings, _entityIds, version); @@ -533,9 +636,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Double? NumberFloat { get; } - public global::System.Int32? NumberInt { get; } } @@ -544,7 +645,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Simple_Custom_Scalar.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Simple_Custom_Scalar.snap index 9097a3874cb..5bb09bfedc7 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Simple_Custom_Scalar.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Simple_Custom_Scalar.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.String? Email { get; } public virtual global::System.Boolean Equals(GetPerson_Person_Person? other) @@ -165,7 +164,6 @@ namespace Foo.Bar public partial interface IGetPerson_Person { public global::System.String Name { get; } - public global::System.String? Email { get; } } @@ -197,8 +195,63 @@ namespace Foo.Bar public static GetPersonQueryDocument Instance { get; } = new GetPersonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x65, + 0x6d, + 0x61, + 0x69, + 0x6c, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "90e3850be405988debbddcbd8810ef6e54f016e5"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -232,6 +285,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -321,6 +375,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPersonResult); + public GetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -376,9 +431,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.PersonData? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPersonResultInfo(Person, _entityIds, version); @@ -479,9 +534,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.String? Email { get; } } @@ -490,7 +543,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.TimeSpan_Not_Detected.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.TimeSpan_Not_Detected.snap index 2b2c32b6083..97d66b201ef 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.TimeSpan_Not_Detected.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.TimeSpan_Not_Detected.snap @@ -289,8 +289,128 @@ namespace Foo.Bar public static GetSessionsQueryDocument Instance { get; } = new GetSessionsQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x28, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x20, 0x7b, 0x20, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x3a, 0x20, 0x41, 0x53, 0x43, 0x20, 0x7d, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x53, + 0x65, + 0x73, + 0x73, + 0x69, + 0x6f, + 0x6e, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x65, + 0x73, + 0x73, + 0x69, + 0x6f, + 0x6e, + 0x73, + 0x28, + 0x6f, + 0x72, + 0x64, + 0x65, + 0x72, + 0x3a, + 0x20, + 0x7b, + 0x20, + 0x74, + 0x69, + 0x74, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x41, + 0x53, + 0x43, + 0x20, + 0x7d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x6f, + 0x64, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x74, + 0x69, + 0x74, + 0x6c, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x53, + 0x65, + 0x73, + 0x73, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "4198cc75513f14cb8a7abfa91bb409dcdb89138b"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -329,6 +449,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetSessionsResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -437,6 +558,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetSessionsResult); + public GetSessionsResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -518,9 +640,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.SessionConnectionData? Sessions { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetSessionsResultInfo(Sessions, _entityIds, version); @@ -658,7 +780,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - ///A flattened list of the nodes. public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } } @@ -689,7 +810,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Uri_Type.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Uri_Type.snap index 1116f4b365a..750aedaa708 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Uri_Type.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Uri_Type.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.Uri? Uri { get; } - public global::System.Uri? URI { get; } public virtual global::System.Boolean Equals(GetPerson_Person_Person? other) @@ -169,7 +168,6 @@ namespace Foo.Bar public partial interface IGetPerson_Person { public global::System.Uri? Uri { get; } - public global::System.Uri? URI { get; } } @@ -201,8 +199,60 @@ namespace Foo.Bar public static GetPersonQueryDocument Instance { get; } = new GetPersonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x75, 0x72, 0x69, 0x20, 0x55, 0x52, 0x49, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x75, + 0x72, + 0x69, + 0x20, + 0x55, + 0x52, + 0x49, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "0935b507b123c9b8b4e075f238ff2dcf5047abaa"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -236,6 +286,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -325,6 +376,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPersonResult); + public GetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -380,9 +432,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.PersonData? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPersonResultInfo(Person, _entityIds, version); @@ -468,9 +520,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Uri? Uri { get; } - public global::System.Uri? URI { get; } } @@ -479,7 +529,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Uuid_Type.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Uuid_Type.snap index 99dbb7df728..b4556f6787b 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Uuid_Type.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/ScalarGeneratorTests.Uuid_Type.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.Guid? Uuid { get; } - public global::System.Guid? UUID { get; } public virtual global::System.Boolean Equals(GetPerson_Person_Person? other) @@ -169,7 +168,6 @@ namespace Foo.Bar public partial interface IGetPerson_Person { public global::System.Guid? Uuid { get; } - public global::System.Guid? UUID { get; } } @@ -201,8 +199,62 @@ namespace Foo.Bar public static GetPersonQueryDocument Instance { get; } = new GetPersonQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x55, 0x75, 0x69, 0x64, 0x20, 0x55, 0x55, 0x49, 0x44, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x55, + 0x75, + 0x69, + 0x64, + 0x20, + 0x55, + 0x55, + 0x49, + 0x44, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "63833e12a095519476031ce95747d0c564ae6b49"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -236,6 +288,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPersonResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -325,6 +378,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPersonResult); + public GetPersonResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -380,9 +434,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.PersonData? Person { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPersonResultInfo(Person, _entityIds, version); @@ -468,9 +522,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Guid? Uuid { get; } - public global::System.Guid? UUID { get; } } @@ -479,7 +531,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_DataType_Query.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_DataType_Query.snap index 72c68d528bb..785d8ff5cd1 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_DataType_Query.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_DataType_Query.snap @@ -268,8 +268,79 @@ namespace Foo.Bar public static GetAllFoosQueryDocument Instance { get; } = new GetAllFoosQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x46, 0x6f, 0x6f, 0x73, 0x20, 0x7b, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x41, + 0x6c, + 0x6c, + 0x46, + 0x6f, + 0x6f, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x74, + 0x65, + 0x73, + 0x74, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x70, + 0x72, + 0x6f, + 0x66, + 0x69, + 0x6c, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "0bed3e95cee021d9969785b8c1aac3425587955c"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -305,6 +376,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetAllFoosResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -396,6 +468,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetAllFoosResult); + public GetAllFoosResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -477,9 +550,9 @@ namespace Foo.Bar.State } public global::System.Collections.Generic.IReadOnlyList Test { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetAllFoosResultInfo(Test, _entityIds, version); @@ -604,7 +677,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::Foo.Bar.State.ProfileData? Profile { get; } } @@ -619,7 +691,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } } @@ -628,7 +699,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_GetFeatById.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_GetFeatById.snap index e2666312bfc..52bf0f8c3ae 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_GetFeatById.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_GetFeatById.snap @@ -168,11 +168,8 @@ namespace Foo.Bar } public global::System.Guid Id { get; } - public global::System.String Name { get; } - public global::System.Int32 Level { get; } - public global::System.Collections.Generic.IReadOnlyList Details { get; } public virtual global::System.Boolean Equals(GetFeatById_Feats_Items_Feat? other) @@ -320,11 +317,8 @@ namespace Foo.Bar public partial interface IGetFeatById_Feats_Items { public global::System.Guid Id { get; } - public global::System.String Name { get; } - public global::System.Int32 Level { get; } - public global::System.Collections.Generic.IReadOnlyList Details { get; } } @@ -383,8 +377,206 @@ namespace Foo.Bar public static GetFeatByIdQueryDocument Instance { get; } = new GetFeatByIdQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x46, 0x65, 0x61, 0x74, 0x42, 0x79, 0x49, 0x64, 0x28, 0x24, 0x69, 0x64, 0x3a, 0x20, 0x55, 0x55, 0x49, 0x44, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x66, 0x65, 0x61, 0x74, 0x73, 0x28, 0x77, 0x68, 0x65, 0x72, 0x65, 0x3a, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x3a, 0x20, 0x7b, 0x20, 0x65, 0x71, 0x3a, 0x20, 0x24, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x74, 0x65, 0x78, 0x74, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x46, 0x65, 0x61, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x46, 0x65, 0x61, 0x74, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x46, + 0x65, + 0x61, + 0x74, + 0x42, + 0x79, + 0x49, + 0x64, + 0x28, + 0x24, + 0x69, + 0x64, + 0x3a, + 0x20, + 0x55, + 0x55, + 0x49, + 0x44, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x65, + 0x61, + 0x74, + 0x73, + 0x28, + 0x77, + 0x68, + 0x65, + 0x72, + 0x65, + 0x3a, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x3a, + 0x20, + 0x7b, + 0x20, + 0x65, + 0x71, + 0x3a, + 0x20, + 0x24, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x74, + 0x65, + 0x6d, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x64, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6c, + 0x65, + 0x76, + 0x65, + 0x6c, + 0x20, + 0x64, + 0x65, + 0x74, + 0x61, + 0x69, + 0x6c, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x74, + 0x65, + 0x78, + 0x74, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x46, + 0x65, + 0x61, + 0x74, + 0x44, + 0x65, + 0x74, + 0x61, + 0x69, + 0x6c, + 0x73, + 0x42, + 0x6c, + 0x6f, + 0x63, + 0x6b, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x46, + 0x65, + 0x61, + 0x74, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "d036805a9b57f740e08b76f17d57f3de1b7e6d25"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -434,6 +626,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetFeatByIdResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Guid id, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(id); @@ -546,11 +739,8 @@ namespace Foo.Bar.State } public global::System.Guid Id { get; } - public global::System.String Name { get; } - public global::System.Int32 Level { get; } - public global::System.Collections.Generic.IReadOnlyList Details { get; } } @@ -581,6 +771,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetFeatByIdResult); + public GetFeatByIdResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -693,9 +884,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.FeatCollectionSegmentData? Feats { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetFeatByIdResultInfo(Feats, _entityIds, version); @@ -918,7 +1109,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Collections.Generic.IReadOnlyList? Items { get; } } @@ -997,7 +1187,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_GetFeatsPage.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_GetFeatsPage.snap index bf1eb6f0ab2..60f0703dc1f 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_GetFeatsPage.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_GetFeatsPage.snap @@ -168,11 +168,8 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.Int32 Level { get; } - public global::System.Boolean CanBeLearnedMoreThanOnce { get; } - public global::Foo.Bar.IGetFeatsPage_Feats_Items_ActionType ActionType { get; } public virtual global::System.Boolean Equals(GetFeatsPage_Feats_Items_Feat? other) @@ -316,11 +313,8 @@ namespace Foo.Bar public partial interface IGetFeatsPage_Feats_Items { public global::System.String Name { get; } - public global::System.Int32 Level { get; } - public global::System.Boolean CanBeLearnedMoreThanOnce { get; } - public global::Foo.Bar.IGetFeatsPage_Feats_Items_ActionType ActionType { get; } } @@ -379,8 +373,236 @@ namespace Foo.Bar public static GetFeatsPageQueryDocument Instance { get; } = new GetFeatsPageQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x46, 0x65, 0x61, 0x74, 0x73, 0x50, 0x61, 0x67, 0x65, 0x28, 0x24, 0x73, 0x6b, 0x69, 0x70, 0x3a, 0x20, 0x49, 0x6e, 0x74, 0x2c, 0x20, 0x24, 0x74, 0x61, 0x6b, 0x65, 0x3a, 0x20, 0x49, 0x6e, 0x74, 0x29, 0x20, 0x7b, 0x20, 0x66, 0x65, 0x61, 0x74, 0x73, 0x28, 0x73, 0x6b, 0x69, 0x70, 0x3a, 0x20, 0x24, 0x73, 0x6b, 0x69, 0x70, 0x2c, 0x20, 0x74, 0x61, 0x6b, 0x65, 0x3a, 0x20, 0x24, 0x74, 0x61, 0x6b, 0x65, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x63, 0x61, 0x6e, 0x42, 0x65, 0x4c, 0x65, 0x61, 0x72, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x72, 0x65, 0x54, 0x68, 0x61, 0x6e, 0x4f, 0x6e, 0x63, 0x65, 0x20, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x46, 0x65, 0x61, 0x74, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x46, + 0x65, + 0x61, + 0x74, + 0x73, + 0x50, + 0x61, + 0x67, + 0x65, + 0x28, + 0x24, + 0x73, + 0x6b, + 0x69, + 0x70, + 0x3a, + 0x20, + 0x49, + 0x6e, + 0x74, + 0x2c, + 0x20, + 0x24, + 0x74, + 0x61, + 0x6b, + 0x65, + 0x3a, + 0x20, + 0x49, + 0x6e, + 0x74, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x65, + 0x61, + 0x74, + 0x73, + 0x28, + 0x73, + 0x6b, + 0x69, + 0x70, + 0x3a, + 0x20, + 0x24, + 0x73, + 0x6b, + 0x69, + 0x70, + 0x2c, + 0x20, + 0x74, + 0x61, + 0x6b, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x74, + 0x61, + 0x6b, + 0x65, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x74, + 0x65, + 0x6d, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6c, + 0x65, + 0x76, + 0x65, + 0x6c, + 0x20, + 0x63, + 0x61, + 0x6e, + 0x42, + 0x65, + 0x4c, + 0x65, + 0x61, + 0x72, + 0x6e, + 0x65, + 0x64, + 0x4d, + 0x6f, + 0x72, + 0x65, + 0x54, + 0x68, + 0x61, + 0x6e, + 0x4f, + 0x6e, + 0x63, + 0x65, + 0x20, + 0x61, + 0x63, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x41, + 0x63, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x46, + 0x65, + 0x61, + 0x74, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "1982a47676d97873e3abcf4a7c72b03511095fac"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -430,6 +652,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetFeatsPageResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Int32? skip, global::System.Int32? take, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(skip, take); @@ -562,11 +785,8 @@ namespace Foo.Bar.State } public global::System.String Name { get; } - public global::System.Int32 Level { get; } - public global::System.Boolean CanBeLearnedMoreThanOnce { get; } - public global::StrawberryShake.EntityId ActionType { get; } } @@ -597,6 +817,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetFeatsPageResult); + public GetFeatsPageResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -693,9 +914,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.FeatCollectionSegmentData? Feats { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetFeatsPageResultInfo(Feats, _entityIds, version); @@ -897,7 +1118,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Collections.Generic.IReadOnlyList? Items { get; } } @@ -960,7 +1180,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_PeopleSearch_From_ActiveDirectory_Schema.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_PeopleSearch_From_ActiveDirectory_Schema.snap index d8253ce169e..b9f1f5bdc15 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_PeopleSearch_From_ActiveDirectory_Schema.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_PeopleSearch_From_ActiveDirectory_Schema.snap @@ -98,12 +98,10 @@ namespace Foo.Bar } public global::System.Int32 TotalCount { get; } - /// /// Information to aid in pagination. /// public global::Foo.Bar.IPeopleSearch_People_PageInfo PageInfo { get; } - public global::System.Collections.Generic.IReadOnlyList? Items { get; } public virtual global::System.Boolean Equals(PeopleSearch_People_PersonCollectionSegment? other) @@ -183,7 +181,6 @@ namespace Foo.Bar /// Indicates whether more items exist following the set defined by the clients arguments. /// public global::System.Boolean HasNextPage { get; } - /// /// Indicates whether more items exist prior the set defined by the clients arguments. /// @@ -258,37 +255,30 @@ namespace Foo.Bar } public global::System.String Id { get; } - /// /// The database primary key for the person. /// public global::System.Int64 Key { get; } - /// /// The full of the person. /// public global::System.String? DisplayName { get; } - /// /// Indicates if the person is active. /// public global::System.Boolean IsActive { get; } - /// /// The department the person belongs to. /// public global::Foo.Bar.IPeopleSearch_People_Items_Department? Department { get; } - /// /// Url to image, you can specify a size in pixels by appending '?size=300' to get a square image. /// public global::System.Uri? Image { get; } - /// /// The job title of the person. /// public global::System.String Title { get; } - /// /// The person managing the person. /// @@ -379,7 +369,6 @@ namespace Foo.Bar } public global::System.String Id { get; } - /// /// The name of the department. /// @@ -449,12 +438,10 @@ namespace Foo.Bar } public global::System.String Id { get; } - /// /// The database primary key for the person. /// public global::System.Int64 Key { get; } - /// /// The full of the person. /// @@ -532,12 +519,10 @@ namespace Foo.Bar public partial interface IPeopleSearch_People { public global::System.Int32 TotalCount { get; } - /// /// Information to aid in pagination. /// public global::Foo.Bar.IPeopleSearch_People_PageInfo PageInfo { get; } - public global::System.Collections.Generic.IReadOnlyList? Items { get; } } @@ -558,7 +543,6 @@ namespace Foo.Bar /// Indicates whether more items exist following the set defined by the clients arguments. /// public global::System.Boolean HasNextPage { get; } - /// /// Indicates whether more items exist prior the set defined by the clients arguments. /// @@ -579,37 +563,30 @@ namespace Foo.Bar public partial interface IPeopleSearchResult { public global::System.String Id { get; } - /// /// The database primary key for the person. /// public global::System.Int64 Key { get; } - /// /// The full of the person. /// public global::System.String? DisplayName { get; } - /// /// Indicates if the person is active. /// public global::System.Boolean IsActive { get; } - /// /// The department the person belongs to. /// public global::Foo.Bar.IPeopleSearch_People_Items_Department? Department { get; } - /// /// Url to image, you can specify a size in pixels by appending '?size=300' to get a square image. /// public global::System.Uri? Image { get; } - /// /// The job title of the person. /// public global::System.String Title { get; } - /// /// The person managing the person. /// @@ -633,7 +610,6 @@ namespace Foo.Bar public partial interface IPeopleSearch_People_Items_Department { public global::System.String Id { get; } - /// /// The name of the department. /// @@ -651,12 +627,10 @@ namespace Foo.Bar public partial interface IPeopleSearch_People_Items_Manager { public global::System.String Id { get; } - /// /// The database primary key for the person. /// public global::System.Int64 Key { get; } - /// /// The full of the person. /// @@ -728,8 +702,528 @@ namespace Foo.Bar public static PeopleSearchQueryDocument Instance { get; } = new PeopleSearchQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x50, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x28, 0x24, 0x74, 0x65, 0x72, 0x6d, 0x3a, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x21, 0x2c, 0x20, 0x24, 0x73, 0x6b, 0x69, 0x70, 0x3a, 0x20, 0x49, 0x6e, 0x74, 0x2c, 0x20, 0x24, 0x74, 0x61, 0x6b, 0x65, 0x3a, 0x20, 0x49, 0x6e, 0x74, 0x2c, 0x20, 0x24, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x3a, 0x20, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x29, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x3a, 0x20, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x28, 0x74, 0x65, 0x72, 0x6d, 0x3a, 0x20, 0x24, 0x74, 0x65, 0x72, 0x6d, 0x2c, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x49, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x3a, 0x20, 0x24, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x2c, 0x20, 0x73, 0x6b, 0x69, 0x70, 0x3a, 0x20, 0x24, 0x73, 0x6b, 0x69, 0x70, 0x2c, 0x20, 0x74, 0x61, 0x6b, 0x65, 0x3a, 0x20, 0x24, 0x74, 0x61, 0x6b, 0x65, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x70, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x68, 0x61, 0x73, 0x4e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x20, 0x68, 0x61, 0x73, 0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x50, 0x61, 0x67, 0x65, 0x20, 0x7d, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x50, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x50, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x20, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x64, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x50, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x53, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x28, + 0x24, + 0x74, + 0x65, + 0x72, + 0x6d, + 0x3a, + 0x20, + 0x53, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x73, + 0x6b, + 0x69, + 0x70, + 0x3a, + 0x20, + 0x49, + 0x6e, + 0x74, + 0x2c, + 0x20, + 0x24, + 0x74, + 0x61, + 0x6b, + 0x65, + 0x3a, + 0x20, + 0x49, + 0x6e, + 0x74, + 0x2c, + 0x20, + 0x24, + 0x69, + 0x6e, + 0x61, + 0x63, + 0x74, + 0x69, + 0x76, + 0x65, + 0x3a, + 0x20, + 0x42, + 0x6f, + 0x6f, + 0x6c, + 0x65, + 0x61, + 0x6e, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x70, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x53, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x28, + 0x74, + 0x65, + 0x72, + 0x6d, + 0x3a, + 0x20, + 0x24, + 0x74, + 0x65, + 0x72, + 0x6d, + 0x2c, + 0x20, + 0x69, + 0x6e, + 0x63, + 0x6c, + 0x75, + 0x64, + 0x65, + 0x49, + 0x6e, + 0x61, + 0x63, + 0x74, + 0x69, + 0x76, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x69, + 0x6e, + 0x61, + 0x63, + 0x74, + 0x69, + 0x76, + 0x65, + 0x2c, + 0x20, + 0x73, + 0x6b, + 0x69, + 0x70, + 0x3a, + 0x20, + 0x24, + 0x73, + 0x6b, + 0x69, + 0x70, + 0x2c, + 0x20, + 0x74, + 0x61, + 0x6b, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x74, + 0x61, + 0x6b, + 0x65, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x74, + 0x6f, + 0x74, + 0x61, + 0x6c, + 0x43, + 0x6f, + 0x75, + 0x6e, + 0x74, + 0x20, + 0x70, + 0x61, + 0x67, + 0x65, + 0x49, + 0x6e, + 0x66, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x68, + 0x61, + 0x73, + 0x4e, + 0x65, + 0x78, + 0x74, + 0x50, + 0x61, + 0x67, + 0x65, + 0x20, + 0x68, + 0x61, + 0x73, + 0x50, + 0x72, + 0x65, + 0x76, + 0x69, + 0x6f, + 0x75, + 0x73, + 0x50, + 0x61, + 0x67, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x69, + 0x74, + 0x65, + 0x6d, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x50, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x53, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x52, + 0x65, + 0x73, + 0x75, + 0x6c, + 0x74, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x50, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x53, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x52, + 0x65, + 0x73, + 0x75, + 0x6c, + 0x74, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x6b, + 0x65, + 0x79, + 0x20, + 0x64, + 0x69, + 0x73, + 0x70, + 0x6c, + 0x61, + 0x79, + 0x4e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x73, + 0x41, + 0x63, + 0x74, + 0x69, + 0x76, + 0x65, + 0x20, + 0x64, + 0x65, + 0x70, + 0x61, + 0x72, + 0x74, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x64, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x65, + 0x70, + 0x61, + 0x72, + 0x74, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x69, + 0x6d, + 0x61, + 0x67, + 0x65, + 0x20, + 0x74, + 0x69, + 0x74, + 0x6c, + 0x65, + 0x20, + 0x6d, + 0x61, + 0x6e, + 0x61, + 0x67, + 0x65, + 0x72, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x64, + 0x20, + 0x6b, + 0x65, + 0x79, + 0x20, + 0x64, + 0x69, + 0x73, + 0x70, + 0x6c, + 0x61, + 0x79, + 0x4e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x50, + 0x65, + 0x72, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "0aa0e07a3648d30f705916cfe5d398a1c5c4beac"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -806,6 +1300,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IPeopleSearchQueryResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.String term, global::System.Int32? skip, global::System.Int32? take, global::System.Boolean? inactive, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(term, skip, take, inactive); @@ -989,25 +1484,18 @@ namespace Foo.Bar.State } public global::System.String Id { get; } - ///The database primary key for the person. public global::System.Int64 Key { get; } - ///The full of the person. public global::System.String? DisplayName { get; } - ///Indicates if the person is active. public global::System.Boolean IsActive { get; } - ///The department the person belongs to. public global::StrawberryShake.EntityId? Department { get; } - ///Url to image, you can specify a size in pixels by appending '?size=300' to get a square image. public global::System.Uri? Image { get; } - ///The job title of the person. public global::System.String Title { get; } - ///The person managing the person. public global::StrawberryShake.EntityId? Manager { get; } } @@ -1023,7 +1511,6 @@ namespace Foo.Bar.State } public global::System.String Id { get; } - ///The name of the department. public global::System.String Name { get; } } @@ -1045,6 +1532,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IPeopleSearchQueryResult); + public PeopleSearchResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -1174,9 +1662,9 @@ namespace Foo.Bar.State /// Searches for people based on their id, name, and identites. /// public global::Foo.Bar.State.PersonCollectionSegmentData? People { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new PeopleSearchResultInfo(People, _entityIds, version); @@ -1483,12 +1971,9 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Int32? TotalCount { get; } - ///Information to aid in pagination. public global::Foo.Bar.State.CollectionSegmentInfoData? PageInfo { get; } - public global::System.Collections.Generic.IReadOnlyList? Items { get; } } @@ -1505,10 +1990,8 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - ///Indicates whether more items exist following the set defined by the clients arguments. public global::System.Boolean? HasNextPage { get; } - ///Indicates whether more items exist prior the set defined by the clients arguments. public global::System.Boolean? HasPreviousPage { get; } } @@ -1615,7 +2098,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_Query_With_Skip_Take.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_Query_With_Skip_Take.snap index f7e17360728..8b66baf801d 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_Query_With_Skip_Take.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_Query_With_Skip_Take.snap @@ -167,9 +167,7 @@ namespace Foo.Bar } public global::System.String Id { get; } - public global::System.String Title { get; } - public global::System.String Summary { get; } public virtual global::System.Boolean Equals(SearchNewsItems_NewsItems_Items_NewsItem? other) @@ -250,9 +248,7 @@ namespace Foo.Bar public partial interface ISearchNewsItems_NewsItems_Items { public global::System.String Id { get; } - public global::System.String Title { get; } - public global::System.String Summary { get; } } @@ -291,8 +287,204 @@ namespace Foo.Bar public static SearchNewsItemsQueryDocument Instance { get; } = new SearchNewsItemsQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4e, 0x65, 0x77, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x28, 0x24, 0x71, 0x75, 0x65, 0x72, 0x79, 0x3a, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x21, 0x2c, 0x20, 0x24, 0x73, 0x6b, 0x69, 0x70, 0x3a, 0x20, 0x49, 0x6e, 0x74, 0x2c, 0x20, 0x24, 0x74, 0x61, 0x6b, 0x65, 0x3a, 0x20, 0x49, 0x6e, 0x74, 0x29, 0x20, 0x7b, 0x20, 0x6e, 0x65, 0x77, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x28, 0x73, 0x6b, 0x69, 0x70, 0x3a, 0x20, 0x24, 0x73, 0x6b, 0x69, 0x70, 0x2c, 0x20, 0x74, 0x61, 0x6b, 0x65, 0x3a, 0x20, 0x24, 0x74, 0x61, 0x6b, 0x65, 0x2c, 0x20, 0x71, 0x75, 0x65, 0x72, 0x79, 0x3a, 0x20, 0x24, 0x71, 0x75, 0x65, 0x72, 0x79, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x64, 0x20, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x20, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x4e, 0x65, 0x77, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x53, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x4e, + 0x65, + 0x77, + 0x73, + 0x49, + 0x74, + 0x65, + 0x6d, + 0x73, + 0x28, + 0x24, + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x3a, + 0x20, + 0x53, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x73, + 0x6b, + 0x69, + 0x70, + 0x3a, + 0x20, + 0x49, + 0x6e, + 0x74, + 0x2c, + 0x20, + 0x24, + 0x74, + 0x61, + 0x6b, + 0x65, + 0x3a, + 0x20, + 0x49, + 0x6e, + 0x74, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x65, + 0x77, + 0x73, + 0x49, + 0x74, + 0x65, + 0x6d, + 0x73, + 0x28, + 0x73, + 0x6b, + 0x69, + 0x70, + 0x3a, + 0x20, + 0x24, + 0x73, + 0x6b, + 0x69, + 0x70, + 0x2c, + 0x20, + 0x74, + 0x61, + 0x6b, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x74, + 0x61, + 0x6b, + 0x65, + 0x2c, + 0x20, + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x3a, + 0x20, + 0x24, + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x74, + 0x65, + 0x6d, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x64, + 0x20, + 0x74, + 0x69, + 0x74, + 0x6c, + 0x65, + 0x20, + 0x73, + 0x75, + 0x6d, + 0x6d, + 0x61, + 0x72, + 0x79, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4e, + 0x65, + 0x77, + 0x73, + 0x49, + 0x74, + 0x65, + 0x6d, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "81d29110879bdfdff3d9b0cc85211da657cf052b"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -337,6 +529,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ISearchNewsItemsResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.String query, global::System.Int32? skip, global::System.Int32? take, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(query, skip, take); @@ -472,9 +665,7 @@ namespace Foo.Bar.State } public global::System.String Id { get; } - public global::System.String Title { get; } - public global::System.String Summary { get; } } @@ -491,6 +682,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ISearchNewsItemsResult); + public SearchNewsItemsResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -577,9 +769,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.NewsItemCollectionSegmentData? NewsItems { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new SearchNewsItemsResultInfo(NewsItems, _entityIds, version); @@ -720,7 +912,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Collections.Generic.IReadOnlyList? Items { get; } } @@ -750,7 +941,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_UpdateMembers_Mutation.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_UpdateMembers_Mutation.snap index d69bbfa3687..9fe97e04fb8 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_UpdateMembers_Mutation.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Create_UpdateMembers_Mutation.snap @@ -253,6 +253,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _guidFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _updateProjectMemberInputFormatter = default !; public global::System.String TypeName => "UpdateProjectMembersInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _guidFormatter = serializerResolver.GetInputValueFormatter("Guid"); @@ -395,6 +396,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IUpdateProjectMembersInputInfo.IsIdSet => _set_id; + ///A member of the project public global::System.Collections.Generic.IReadOnlyList Members { @@ -417,6 +419,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _projectUserRoleTypeFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _booleanFormatter = default !; public global::System.String TypeName => "UpdateProjectMemberInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _guidFormatter = serializerResolver.GetInputValueFormatter("Guid"); @@ -547,6 +550,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IUpdateProjectMemberInputInfo.IsIdSet => _set_id; + ///The type of role the user has on the project, only used when Remove is false public global::Foo.Bar.ProjectUserRoleType Type { @@ -559,6 +563,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IUpdateProjectMemberInputInfo.IsTypeSet => _set_type; + ///True will remove the member from the project public global::System.Boolean Remove { @@ -587,6 +592,7 @@ namespace Foo.Bar public partial class ProjectUserRoleTypeSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "ProjectUserRoleType"; + public ProjectUserRoleType Parse(global::System.String serializedValue) { return serializedValue switch @@ -632,8 +638,154 @@ namespace Foo.Bar public static UpdateMembersMutationDocument Instance { get; } = new UpdateMembersMutationDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Mutation; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x28, 0x24, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x20, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x28, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x20, 0x24, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x6d, + 0x75, + 0x74, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x55, + 0x70, + 0x64, + 0x61, + 0x74, + 0x65, + 0x4d, + 0x65, + 0x6d, + 0x62, + 0x65, + 0x72, + 0x73, + 0x28, + 0x24, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x3a, + 0x20, + 0x55, + 0x70, + 0x64, + 0x61, + 0x74, + 0x65, + 0x50, + 0x72, + 0x6f, + 0x6a, + 0x65, + 0x63, + 0x74, + 0x4d, + 0x65, + 0x6d, + 0x62, + 0x65, + 0x72, + 0x73, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x72, + 0x6f, + 0x6a, + 0x65, + 0x63, + 0x74, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x75, + 0x70, + 0x64, + 0x61, + 0x74, + 0x65, + 0x4d, + 0x65, + 0x6d, + 0x62, + 0x65, + 0x72, + 0x73, + 0x28, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x63, + 0x6f, + 0x72, + 0x72, + 0x65, + 0x6c, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x49, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "8aac78b8e445094164d4bdd50d47e2a919e24dfc"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -671,6 +823,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IUpdateMembersResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.UpdateProjectMembersInput input, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(input); @@ -774,6 +927,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IUpdateMembersResult); + public UpdateMembersResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -844,9 +998,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.ProjectMutationsData Project { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new UpdateMembersResultInfo(Project, _entityIds, version); @@ -974,7 +1128,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - ///Update the project members public global::Foo.Bar.State.MutationResultData? UpdateMembers { get; } } @@ -990,7 +1143,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Guid? CorrelationId { get; } } @@ -999,7 +1151,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.EnumWithUnderscorePrefixedValues.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.EnumWithUnderscorePrefixedValues.snap index 904196a000f..9fe734a4462 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.EnumWithUnderscorePrefixedValues.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.EnumWithUnderscorePrefixedValues.snap @@ -106,6 +106,7 @@ namespace Foo.Bar public partial class Enum1Serializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "Enum1"; + public Enum1 Parse(global::System.String serializedValue) { return serializedValue switch @@ -149,8 +150,37 @@ namespace Foo.Bar public static GetField1QueryDocument Instance { get; } = new GetField1QueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x31, 0x20, 0x7b, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x31, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x46, + 0x69, + 0x65, + 0x6c, + 0x64, + 0x31, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x69, + 0x65, + 0x6c, + 0x64, + 0x31, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "b505bdfe64c0b4ef198f5363575dea66cf6092df"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -180,6 +210,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetField1Result); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -265,6 +296,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetField1Result); + public GetField1Result Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -300,9 +332,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.Enum1? Field1 { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetField1ResultInfo(Field1, _entityIds, version); @@ -358,7 +390,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.FieldsWithUnderlineInName.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.FieldsWithUnderlineInName.snap index b9372b5d3b9..e79be115092 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.FieldsWithUnderlineInName.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.FieldsWithUnderlineInName.snap @@ -183,29 +183,17 @@ namespace Foo.Bar } public global::System.String? InventoryId { get; } - public global::System.String? Area { get; } - public global::System.String? Source { get; } - public global::System.String? Type { get; } - public global::System.String? Name { get; } - public global::System.String? Category { get; } - public global::System.String? Specification { get; } - public global::System.String? Commodity { get; } - public global::Foo.Bar.IGetBwr_TimeSeries_Bwr_TimeSeries_Nodes_Resolution? Resolution { get; } - public global::System.String? Unit { get; } - public global::Foo.Bar.IGetBwr_TimeSeries_Bwr_TimeSeries_Nodes_ValidationCriteria? ValidationCriteria { get; } - public global::Foo.Bar.IGetBwr_TimeSeries_Bwr_TimeSeries_Nodes_ImportSpecification? ImportSpecification { get; } - public global::System.Collections.Generic.IReadOnlyList? _dataPoints { get; } public virtual global::System.Boolean Equals(GetBwr_TimeSeries_Bwr_TimeSeries_Nodes_bwr_TimeSeries? other) @@ -337,7 +325,6 @@ namespace Foo.Bar } public global::Foo.Bar.TimeUnit TimeUnit { get; } - public global::System.Int32 Factor { get; } public virtual global::System.Boolean Equals(GetBwr_TimeSeries_Bwr_TimeSeries_Nodes_Resolution_Resolution? other) @@ -406,13 +393,9 @@ namespace Foo.Bar } public global::System.String? _inventoryItemId { get; } - public global::System.String? Name { get; } - public global::System.String? Completeness { get; } - public global::System.Decimal? LowerBound { get; } - public global::System.Decimal? UpperBound { get; } public virtual global::System.Boolean Equals(GetBwr_TimeSeries_Bwr_TimeSeries_Nodes_ValidationCriteria_bwr_ValidationCriteria? other) @@ -501,7 +484,6 @@ namespace Foo.Bar } public global::System.Int32? FromPeriod { get; } - public global::System.Int32? ToPeriod { get; } public virtual global::System.Boolean Equals(GetBwr_TimeSeries_Bwr_TimeSeries_Nodes_ImportSpecification_bwr_ImportSpecification? other) @@ -576,9 +558,7 @@ namespace Foo.Bar } public global::System.DateTimeOffset Timestamp { get; } - public global::System.Double Value { get; } - public global::Foo.Bar.DataFlag Flag { get; } public virtual global::System.Boolean Equals(GetBwr_TimeSeries_Bwr_TimeSeries_Nodes__dataPoints_DataPoint? other) @@ -668,29 +648,17 @@ namespace Foo.Bar public partial interface IBwr_TimeSeries { public global::System.String? InventoryId { get; } - public global::System.String? Area { get; } - public global::System.String? Source { get; } - public global::System.String? Type { get; } - public global::System.String? Name { get; } - public global::System.String? Category { get; } - public global::System.String? Specification { get; } - public global::System.String? Commodity { get; } - public global::Foo.Bar.IGetBwr_TimeSeries_Bwr_TimeSeries_Nodes_Resolution? Resolution { get; } - public global::System.String? Unit { get; } - public global::Foo.Bar.IGetBwr_TimeSeries_Bwr_TimeSeries_Nodes_ValidationCriteria? ValidationCriteria { get; } - public global::Foo.Bar.IGetBwr_TimeSeries_Bwr_TimeSeries_Nodes_ImportSpecification? ImportSpecification { get; } - public global::System.Collections.Generic.IReadOnlyList? _dataPoints { get; } } @@ -711,7 +679,6 @@ namespace Foo.Bar public partial interface IGetBwr_TimeSeries_Bwr_TimeSeries_Nodes_Resolution { public global::Foo.Bar.TimeUnit TimeUnit { get; } - public global::System.Int32 Factor { get; } } @@ -726,13 +693,9 @@ namespace Foo.Bar public partial interface IBwr_ValidationCriteria { public global::System.String? _inventoryItemId { get; } - public global::System.String? Name { get; } - public global::System.String? Completeness { get; } - public global::System.Decimal? LowerBound { get; } - public global::System.Decimal? UpperBound { get; } } @@ -753,7 +716,6 @@ namespace Foo.Bar public partial interface IGetBwr_TimeSeries_Bwr_TimeSeries_Nodes_ImportSpecification { public global::System.Int32? FromPeriod { get; } - public global::System.Int32? ToPeriod { get; } } @@ -768,9 +730,7 @@ namespace Foo.Bar public partial interface IGetBwr_TimeSeries_Bwr_TimeSeries_Nodes__dataPoints { public global::System.DateTimeOffset Timestamp { get; } - public global::System.Double Value { get; } - public global::Foo.Bar.DataFlag Flag { get; } } @@ -789,6 +749,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _referenceTyOfbwr_TimeSeriesFilterInputFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _listRefFilterTyOfbwr_TimeSeriesFilterInputFormatter = default !; public global::System.String TypeName => "bwr_TimeSeriesFilterInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _bwr_TimeSeriesFilterInputFormatter = serializerResolver.GetInputValueFormatter("bwr_TimeSeriesFilterInput"); @@ -1268,6 +1229,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBwr_TimeSeriesFilterInputInfo.IsAndSet => _set_and; + public global::System.Collections.Generic.IReadOnlyList? Or { get => _value_or; @@ -1279,6 +1241,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBwr_TimeSeriesFilterInputInfo.IsOrSet => _set_or; + public global::Foo.Bar.StringOperationFilterInput? Name { get => _value_name; @@ -1290,6 +1253,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBwr_TimeSeriesFilterInputInfo.IsNameSet => _set_name; + public global::Foo.Bar.StringOperationFilterInput? Category { get => _value_category; @@ -1301,6 +1265,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBwr_TimeSeriesFilterInputInfo.IsCategorySet => _set_category; + public global::Foo.Bar.StringOperationFilterInput? Specification { get => _value_specification; @@ -1312,6 +1277,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBwr_TimeSeriesFilterInputInfo.IsSpecificationSet => _set_specification; + public global::Foo.Bar.StringOperationFilterInput? Commodity { get => _value_commodity; @@ -1323,6 +1289,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBwr_TimeSeriesFilterInputInfo.IsCommoditySet => _set_commodity; + public global::Foo.Bar.StringOperationFilterInput? Area { get => _value_area; @@ -1334,6 +1301,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBwr_TimeSeriesFilterInputInfo.IsAreaSet => _set_area; + public global::Foo.Bar.StringOperationFilterInput? Source { get => _value_source; @@ -1345,6 +1313,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBwr_TimeSeriesFilterInputInfo.IsSourceSet => _set_source; + public global::Foo.Bar.StringOperationFilterInput? Type { get => _value_type; @@ -1356,6 +1325,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBwr_TimeSeriesFilterInputInfo.IsTypeSet => _set_type; + public global::Foo.Bar.StringOperationFilterInput? Resolution { get => _value_resolution; @@ -1367,6 +1337,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBwr_TimeSeriesFilterInputInfo.IsResolutionSet => _set_resolution; + public global::Foo.Bar.StringOperationFilterInput? Unit { get => _value_unit; @@ -1378,6 +1349,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBwr_TimeSeriesFilterInputInfo.IsUnitSet => _set_unit; + public global::Foo.Bar.ReferenceTyOfbwr_TimeSeriesFilterInput? ImportSpecification { get => _value_importSpecification; @@ -1389,6 +1361,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBwr_TimeSeriesFilterInputInfo.IsImportSpecificationSet => _set_importSpecification; + public global::Foo.Bar.ReferenceTyOfbwr_TimeSeriesFilterInput? ValidationCriteria { get => _value_validationCriteria; @@ -1400,6 +1373,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBwr_TimeSeriesFilterInputInfo.IsValidationCriteriaSet => _set_validationCriteria; + public global::Foo.Bar.ListRefFilterTyOfbwr_TimeSeriesFilterInput? ValidationResults { get => _value_validationResults; @@ -1411,6 +1385,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IBwr_TimeSeriesFilterInputInfo.IsValidationResultsSet => _set_validationResults; + public global::Foo.Bar.StringOperationFilterInput? _inventoryItemId { get => _value__inventoryItemId; @@ -1431,6 +1406,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _stringOperationFilterInputFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _stringFormatter = default !; public global::System.String TypeName => "StringOperationFilterInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _stringOperationFilterInputFormatter = serializerResolver.GetInputValueFormatter("StringOperationFilterInput"); @@ -1874,6 +1850,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IStringOperationFilterInputInfo.IsAndSet => _set_and; + public global::System.Collections.Generic.IReadOnlyList? Or { get => _value_or; @@ -1885,6 +1862,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IStringOperationFilterInputInfo.IsOrSet => _set_or; + public global::System.String? Eq { get => _value_eq; @@ -1896,6 +1874,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IStringOperationFilterInputInfo.IsEqSet => _set_eq; + public global::System.String? Neq { get => _value_neq; @@ -1907,6 +1886,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IStringOperationFilterInputInfo.IsNeqSet => _set_neq; + public global::System.String? Contains { get => _value_contains; @@ -1918,6 +1898,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IStringOperationFilterInputInfo.IsContainsSet => _set_contains; + public global::System.String? Ncontains { get => _value_ncontains; @@ -1929,6 +1910,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IStringOperationFilterInputInfo.IsNcontainsSet => _set_ncontains; + public global::System.Collections.Generic.IReadOnlyList? In { get => _value_in; @@ -1940,6 +1922,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IStringOperationFilterInputInfo.IsInSet => _set_in; + public global::System.Collections.Generic.IReadOnlyList? Nin { get => _value_nin; @@ -1951,6 +1934,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IStringOperationFilterInputInfo.IsNinSet => _set_nin; + public global::System.String? StartsWith { get => _value_startsWith; @@ -1962,6 +1946,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IStringOperationFilterInputInfo.IsStartsWithSet => _set_startsWith; + public global::System.String? NstartsWith { get => _value_nstartsWith; @@ -1973,6 +1958,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IStringOperationFilterInputInfo.IsNstartsWithSet => _set_nstartsWith; + public global::System.String? EndsWith { get => _value_endsWith; @@ -1984,6 +1970,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IStringOperationFilterInputInfo.IsEndsWithSet => _set_endsWith; + public global::System.String? NendsWith { get => _value_nendsWith; @@ -2004,6 +1991,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _referenceTyOfbwr_TimeSeriesFilterInputFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _stringOperationFilterInputFormatter = default !; public global::System.String TypeName => "ReferenceTyOfbwr_TimeSeriesFilterInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _referenceTyOfbwr_TimeSeriesFilterInputFormatter = serializerResolver.GetInputValueFormatter("ReferenceTyOfbwr_TimeSeriesFilterInput"); @@ -2193,6 +2181,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IReferenceTyOfbwr_TimeSeriesFilterInputInfo.IsAndSet => _set_and; + public global::System.Collections.Generic.IReadOnlyList? Or { get => _value_or; @@ -2204,6 +2193,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IReferenceTyOfbwr_TimeSeriesFilterInputInfo.IsOrSet => _set_or; + public global::Foo.Bar.StringOperationFilterInput? _inventoryItemId { get => _value__inventoryItemId; @@ -2224,6 +2214,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _referenceTyOfbwr_TimeSeriesFilterInputFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _booleanFormatter = default !; public global::System.String TypeName => "ListRefFilterTyOfbwr_TimeSeriesFilterInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _referenceTyOfbwr_TimeSeriesFilterInputFormatter = serializerResolver.GetInputValueFormatter("ReferenceTyOfbwr_TimeSeriesFilterInput"); @@ -2409,6 +2400,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IListRefFilterTyOfbwr_TimeSeriesFilterInputInfo.IsAllSet => _set_all; + public global::Foo.Bar.ReferenceTyOfbwr_TimeSeriesFilterInput? None { get => _value_none; @@ -2420,6 +2412,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IListRefFilterTyOfbwr_TimeSeriesFilterInputInfo.IsNoneSet => _set_none; + public global::Foo.Bar.ReferenceTyOfbwr_TimeSeriesFilterInput? Some { get => _value_some; @@ -2431,6 +2424,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IListRefFilterTyOfbwr_TimeSeriesFilterInputInfo.IsSomeSet => _set_some; + public global::System.Boolean? Any { get => _value_any; @@ -2453,6 +2447,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _resolutionInputFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _aggregationFormatter = default !; public global::System.String TypeName => "ReadDataInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _stringFormatter = serializerResolver.GetInputValueFormatter("String"); @@ -2642,6 +2637,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IReadDataInputInfo.IsUnitSet => _set_unit; + public global::System.DateTimeOffset From { get => _value_from; @@ -2653,6 +2649,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IReadDataInputInfo.IsFromSet => _set_from; + public global::System.DateTimeOffset To { get => _value_to; @@ -2664,6 +2661,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IReadDataInputInfo.IsToSet => _set_to; + public global::Foo.Bar.ResolutionInput? Resolution { get => _value_resolution; @@ -2675,6 +2673,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IReadDataInputInfo.IsResolutionSet => _set_resolution; + public global::Foo.Bar.Aggregation? Aggregation { get => _value_aggregation; @@ -2695,6 +2694,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _timeUnitFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _intFormatter = default !; public global::System.String TypeName => "ResolutionInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _timeUnitFormatter = serializerResolver.GetInputValueFormatter("TimeUnit"); @@ -2810,6 +2810,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IResolutionInputInfo.IsTimeUnitSet => _set_timeUnit; + public global::System.Int32 Factor { get => _value_factor; @@ -2843,6 +2844,7 @@ namespace Foo.Bar public partial class TimeUnitSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "TimeUnit"; + public TimeUnit Parse(global::System.String serializedValue) { return serializedValue switch @@ -2891,6 +2893,7 @@ namespace Foo.Bar public partial class AggregationSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "Aggregation"; + public Aggregation Parse(global::System.String serializedValue) { return serializedValue switch @@ -2928,6 +2931,7 @@ namespace Foo.Bar public partial class DataFlagSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "DataFlag"; + public DataFlag Parse(global::System.String serializedValue) { return serializedValue switch @@ -3022,8 +3026,778 @@ namespace Foo.Bar public static GetBwr_TimeSeriesQueryDocument Instance { get; } = new GetBwr_TimeSeriesQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x42, 0x77, 0x72, 0x5f, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x28, 0x24, 0x77, 0x68, 0x65, 0x72, 0x65, 0x3a, 0x20, 0x62, 0x77, 0x72, 0x5f, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x2c, 0x20, 0x24, 0x72, 0x65, 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x20, 0x52, 0x65, 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x62, 0x77, 0x72, 0x5f, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x28, 0x77, 0x68, 0x65, 0x72, 0x65, 0x3a, 0x20, 0x24, 0x77, 0x68, 0x65, 0x72, 0x65, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x42, 0x77, 0x72, 0x5f, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x62, 0x77, 0x72, 0x5f, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x42, 0x77, 0x72, 0x5f, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x6f, 0x6e, 0x20, 0x62, 0x77, 0x72, 0x5f, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x3a, 0x20, 0x5f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x20, 0x61, 0x72, 0x65, 0x61, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x64, 0x69, 0x74, 0x79, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x20, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x20, 0x7d, 0x20, 0x75, 0x6e, 0x69, 0x74, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x72, 0x69, 0x74, 0x65, 0x72, 0x69, 0x61, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x42, 0x77, 0x72, 0x5f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x72, 0x69, 0x74, 0x65, 0x72, 0x69, 0x61, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x62, 0x77, 0x72, 0x5f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x72, 0x69, 0x74, 0x65, 0x72, 0x69, 0x61, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x20, 0x74, 0x6f, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x62, 0x77, 0x72, 0x5f, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x28, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x20, 0x24, 0x72, 0x65, 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x66, 0x6c, 0x61, 0x67, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x42, 0x77, 0x72, 0x5f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x72, 0x69, 0x74, 0x65, 0x72, 0x69, 0x61, 0x20, 0x6f, 0x6e, 0x20, 0x62, 0x77, 0x72, 0x5f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x72, 0x69, 0x74, 0x65, 0x72, 0x69, 0x61, 0x20, 0x7b, 0x20, 0x5f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x20, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x75, 0x70, 0x70, 0x65, 0x72, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x42, + 0x77, + 0x72, + 0x5f, + 0x54, + 0x69, + 0x6d, + 0x65, + 0x53, + 0x65, + 0x72, + 0x69, + 0x65, + 0x73, + 0x28, + 0x24, + 0x77, + 0x68, + 0x65, + 0x72, + 0x65, + 0x3a, + 0x20, + 0x62, + 0x77, + 0x72, + 0x5f, + 0x54, + 0x69, + 0x6d, + 0x65, + 0x53, + 0x65, + 0x72, + 0x69, + 0x65, + 0x73, + 0x46, + 0x69, + 0x6c, + 0x74, + 0x65, + 0x72, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x2c, + 0x20, + 0x24, + 0x72, + 0x65, + 0x61, + 0x64, + 0x44, + 0x61, + 0x74, + 0x61, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x3a, + 0x20, + 0x52, + 0x65, + 0x61, + 0x64, + 0x44, + 0x61, + 0x74, + 0x61, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x62, + 0x77, + 0x72, + 0x5f, + 0x54, + 0x69, + 0x6d, + 0x65, + 0x53, + 0x65, + 0x72, + 0x69, + 0x65, + 0x73, + 0x28, + 0x77, + 0x68, + 0x65, + 0x72, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x77, + 0x68, + 0x65, + 0x72, + 0x65, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x6f, + 0x64, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x42, + 0x77, + 0x72, + 0x5f, + 0x54, + 0x69, + 0x6d, + 0x65, + 0x53, + 0x65, + 0x72, + 0x69, + 0x65, + 0x73, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x62, + 0x77, + 0x72, + 0x5f, + 0x54, + 0x69, + 0x6d, + 0x65, + 0x53, + 0x65, + 0x72, + 0x69, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x42, + 0x77, + 0x72, + 0x5f, + 0x54, + 0x69, + 0x6d, + 0x65, + 0x53, + 0x65, + 0x72, + 0x69, + 0x65, + 0x73, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x62, + 0x77, + 0x72, + 0x5f, + 0x54, + 0x69, + 0x6d, + 0x65, + 0x53, + 0x65, + 0x72, + 0x69, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x6e, + 0x76, + 0x65, + 0x6e, + 0x74, + 0x6f, + 0x72, + 0x79, + 0x49, + 0x64, + 0x3a, + 0x20, + 0x5f, + 0x69, + 0x6e, + 0x76, + 0x65, + 0x6e, + 0x74, + 0x6f, + 0x72, + 0x79, + 0x49, + 0x74, + 0x65, + 0x6d, + 0x49, + 0x64, + 0x20, + 0x61, + 0x72, + 0x65, + 0x61, + 0x20, + 0x73, + 0x6f, + 0x75, + 0x72, + 0x63, + 0x65, + 0x20, + 0x74, + 0x79, + 0x70, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x63, + 0x61, + 0x74, + 0x65, + 0x67, + 0x6f, + 0x72, + 0x79, + 0x20, + 0x73, + 0x70, + 0x65, + 0x63, + 0x69, + 0x66, + 0x69, + 0x63, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x63, + 0x6f, + 0x6d, + 0x6d, + 0x6f, + 0x64, + 0x69, + 0x74, + 0x79, + 0x20, + 0x72, + 0x65, + 0x73, + 0x6f, + 0x6c, + 0x75, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x74, + 0x69, + 0x6d, + 0x65, + 0x55, + 0x6e, + 0x69, + 0x74, + 0x20, + 0x66, + 0x61, + 0x63, + 0x74, + 0x6f, + 0x72, + 0x20, + 0x7d, + 0x20, + 0x75, + 0x6e, + 0x69, + 0x74, + 0x20, + 0x76, + 0x61, + 0x6c, + 0x69, + 0x64, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x43, + 0x72, + 0x69, + 0x74, + 0x65, + 0x72, + 0x69, + 0x61, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x42, + 0x77, + 0x72, + 0x5f, + 0x56, + 0x61, + 0x6c, + 0x69, + 0x64, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x43, + 0x72, + 0x69, + 0x74, + 0x65, + 0x72, + 0x69, + 0x61, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x62, + 0x77, + 0x72, + 0x5f, + 0x56, + 0x61, + 0x6c, + 0x69, + 0x64, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x43, + 0x72, + 0x69, + 0x74, + 0x65, + 0x72, + 0x69, + 0x61, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x69, + 0x6d, + 0x70, + 0x6f, + 0x72, + 0x74, + 0x53, + 0x70, + 0x65, + 0x63, + 0x69, + 0x66, + 0x69, + 0x63, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x66, + 0x72, + 0x6f, + 0x6d, + 0x50, + 0x65, + 0x72, + 0x69, + 0x6f, + 0x64, + 0x20, + 0x74, + 0x6f, + 0x50, + 0x65, + 0x72, + 0x69, + 0x6f, + 0x64, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x62, + 0x77, + 0x72, + 0x5f, + 0x49, + 0x6d, + 0x70, + 0x6f, + 0x72, + 0x74, + 0x53, + 0x70, + 0x65, + 0x63, + 0x69, + 0x66, + 0x69, + 0x63, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x5f, + 0x64, + 0x61, + 0x74, + 0x61, + 0x50, + 0x6f, + 0x69, + 0x6e, + 0x74, + 0x73, + 0x28, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x3a, + 0x20, + 0x24, + 0x72, + 0x65, + 0x61, + 0x64, + 0x44, + 0x61, + 0x74, + 0x61, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x74, + 0x69, + 0x6d, + 0x65, + 0x73, + 0x74, + 0x61, + 0x6d, + 0x70, + 0x20, + 0x76, + 0x61, + 0x6c, + 0x75, + 0x65, + 0x20, + 0x66, + 0x6c, + 0x61, + 0x67, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x42, + 0x77, + 0x72, + 0x5f, + 0x56, + 0x61, + 0x6c, + 0x69, + 0x64, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x43, + 0x72, + 0x69, + 0x74, + 0x65, + 0x72, + 0x69, + 0x61, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x62, + 0x77, + 0x72, + 0x5f, + 0x56, + 0x61, + 0x6c, + 0x69, + 0x64, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x43, + 0x72, + 0x69, + 0x74, + 0x65, + 0x72, + 0x69, + 0x61, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x69, + 0x6e, + 0x76, + 0x65, + 0x6e, + 0x74, + 0x6f, + 0x72, + 0x79, + 0x49, + 0x74, + 0x65, + 0x6d, + 0x49, + 0x64, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x63, + 0x6f, + 0x6d, + 0x70, + 0x6c, + 0x65, + 0x74, + 0x65, + 0x6e, + 0x65, + 0x73, + 0x73, + 0x20, + 0x6c, + 0x6f, + 0x77, + 0x65, + 0x72, + 0x42, + 0x6f, + 0x75, + 0x6e, + 0x64, + 0x20, + 0x75, + 0x70, + 0x70, + 0x65, + 0x72, + 0x42, + 0x6f, + 0x75, + 0x6e, + 0x64, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "fd97876c1fe57bcb23d5c9cf665e79aff6ded9e3"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -3112,6 +3886,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetBwr_TimeSeriesResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.bwr_TimeSeriesFilterInput? @where, global::Foo.Bar.ReadDataInput readDataInput, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(@where, readDataInput); @@ -3288,29 +4063,17 @@ namespace Foo.Bar.State } public global::System.String? InventoryId { get; } - public global::System.String? Area { get; } - public global::System.String? Source { get; } - public global::System.String? Type { get; } - public global::System.String? Name { get; } - public global::System.String? Category { get; } - public global::System.String? Specification { get; } - public global::System.String? Commodity { get; } - public global::Foo.Bar.State.ResolutionData? Resolution { get; } - public global::System.String? Unit { get; } - public global::StrawberryShake.EntityId? ValidationCriteria { get; } - public global::StrawberryShake.EntityId? ImportSpecification { get; } - public global::System.Collections.Generic.IReadOnlyList? _dataPoints { get; } } @@ -3328,13 +4091,9 @@ namespace Foo.Bar.State } public global::System.String? _inventoryItemId { get; } - public global::System.String? Name { get; } - public global::System.String? Completeness { get; } - public global::System.Decimal? LowerBound { get; } - public global::System.Decimal? UpperBound { get; } } @@ -3349,7 +4108,6 @@ namespace Foo.Bar.State } public global::System.Int32? FromPeriod { get; } - public global::System.Int32? ToPeriod { get; } } @@ -3370,6 +4128,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetBwr_TimeSeriesResult); + public GetBwr_TimeSeriesResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -3537,9 +4296,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.Bwr_TimeSeriesConnectionData? Bwr_TimeSeries { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetBwr_TimeSeriesResultInfo(Bwr_TimeSeries, _entityIds, version); @@ -4035,7 +4794,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - ///A flattened list of the nodes. public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } } @@ -4052,9 +4810,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::Foo.Bar.TimeUnit? TimeUnit { get; } - public global::System.Int32? Factor { get; } } @@ -4071,11 +4827,8 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.DateTimeOffset? Timestamp { get; } - public global::System.Double? Value { get; } - public global::Foo.Bar.DataFlag? Flag { get; } } @@ -4232,7 +4985,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Full_Extension_File.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Full_Extension_File.snap index a011051dc2d..43f3ad38d50 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Full_Extension_File.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Full_Extension_File.snap @@ -204,8 +204,135 @@ namespace Foo.Bar public static GetListingsCountQueryDocument Instance { get; } = new GetListingsCountQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x7b, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x7b, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x73, + 0x43, + 0x6f, + 0x75, + 0x6e, + 0x74, + 0x20, + 0x7b, + 0x20, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x73, + 0x50, + 0x61, + 0x79, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x73, + 0x50, + 0x61, + 0x79, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x73, + 0x50, + 0x61, + 0x79, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x63, + 0x6f, + 0x75, + 0x6e, + 0x74, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "c3a13333bd2282e2d7ed111b99934a7610014ba3"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -242,6 +369,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetListingsCountResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -334,6 +462,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetListingsCountResult); + public GetListingsCountResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -387,9 +516,9 @@ namespace Foo.Bar.State /// Vyhledávání mezi inzeráty /// public global::Foo.Bar.State.ListingsPayloadData Listings { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetListingsCountResultInfo(Listings, _entityIds, version); @@ -472,7 +601,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Int32? Count { get; } } @@ -481,7 +609,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.HasuraMutation.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.HasuraMutation.snap index f93596a52fb..f497fc6ac32 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.HasuraMutation.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.HasuraMutation.snap @@ -200,6 +200,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _stringFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _uuidFormatter = default !; public global::System.String TypeName => "people_insert_input"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _cars_Arr_Rel_Insert_InputFormatter = serializerResolver.GetInputValueFormatter("cars_arr_rel_insert_input"); @@ -387,6 +388,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IPeople_insert_inputInfo.IsCarsSet => _set_cars; + public global::System.String? FirstName { get => _value_firstName; @@ -398,6 +400,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IPeople_insert_inputInfo.IsFirstNameSet => _set_firstName; + public global::System.String? Id { get => _value_id; @@ -409,6 +412,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IPeople_insert_inputInfo.IsIdSet => _set_id; + public global::System.String? LastName { get => _value_lastName; @@ -429,6 +433,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _cars_Insert_InputFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _cars_On_ConflictFormatter = default !; public global::System.String TypeName => "cars_arr_rel_insert_input"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _cars_Insert_InputFormatter = serializerResolver.GetInputValueFormatter("cars_insert_input"); @@ -576,6 +581,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.ICars_arr_rel_insert_inputInfo.IsDataSet => _set_data; + ///on conflict condition public global::Foo.Bar.cars_on_conflict? On_conflict { @@ -598,6 +604,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _uuidFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _people_Obj_Rel_Insert_InputFormatter = default !; public global::System.String TypeName => "cars_insert_input"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _stringFormatter = serializerResolver.GetInputValueFormatter("String"); @@ -785,6 +792,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.ICars_insert_inputInfo.IsCarNameSet => _set_carName; + public global::System.String? Id { get => _value_id; @@ -796,6 +804,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.ICars_insert_inputInfo.IsIdSet => _set_id; + public global::System.String? OwnerId { get => _value_ownerId; @@ -807,6 +816,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.ICars_insert_inputInfo.IsOwnerIdSet => _set_ownerId; + public global::Foo.Bar.people_obj_rel_insert_input? Person { get => _value_person; @@ -827,6 +837,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _people_Insert_InputFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _people_On_ConflictFormatter = default !; public global::System.String TypeName => "people_obj_rel_insert_input"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _people_Insert_InputFormatter = serializerResolver.GetInputValueFormatter("people_insert_input"); @@ -959,6 +970,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IPeople_obj_rel_insert_inputInfo.IsDataSet => _set_data; + ///on conflict condition public global::Foo.Bar.people_on_conflict? On_conflict { @@ -981,6 +993,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _people_Update_ColumnFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _people_Bool_ExpFormatter = default !; public global::System.String TypeName => "people_on_conflict"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _people_ConstraintFormatter = serializerResolver.GetInputValueFormatter("People_constraint"); @@ -1142,6 +1155,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IPeople_on_conflictInfo.IsConstraintSet => _set_constraint; + public global::System.Collections.Generic.IReadOnlyList? Update_columns { get => _value_update_Columns; @@ -1153,6 +1167,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IPeople_on_conflictInfo.IsUpdate_columnsSet => _set_update_Columns; + public global::Foo.Bar.people_bool_exp? Where { get => _value_where; @@ -1175,6 +1190,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _string_Comparison_ExpFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _uuid_Comparison_ExpFormatter = default !; public global::System.String TypeName => "people_bool_exp"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _people_Bool_ExpFormatter = serializerResolver.GetInputValueFormatter("people_bool_exp"); @@ -1463,6 +1479,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IPeople_bool_expInfo.Is_andSet => _set__and; + public global::Foo.Bar.people_bool_exp? _not { get => _value__not; @@ -1474,6 +1491,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IPeople_bool_expInfo.Is_notSet => _set__not; + public global::System.Collections.Generic.IReadOnlyList? _or { get => _value__or; @@ -1485,6 +1503,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IPeople_bool_expInfo.Is_orSet => _set__or; + public global::Foo.Bar.cars_bool_exp? Cars { get => _value_cars; @@ -1496,6 +1515,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IPeople_bool_expInfo.IsCarsSet => _set_cars; + public global::Foo.Bar.String_comparison_exp? FirstName { get => _value_firstName; @@ -1507,6 +1527,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IPeople_bool_expInfo.IsFirstNameSet => _set_firstName; + public global::Foo.Bar.uuid_comparison_exp? Id { get => _value_id; @@ -1518,6 +1539,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IPeople_bool_expInfo.IsIdSet => _set_id; + public global::Foo.Bar.String_comparison_exp? LastName { get => _value_lastName; @@ -1540,6 +1562,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _uuid_Comparison_ExpFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _people_Bool_ExpFormatter = default !; public global::System.String TypeName => "cars_bool_exp"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _cars_Bool_ExpFormatter = serializerResolver.GetInputValueFormatter("cars_bool_exp"); @@ -1828,6 +1851,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.ICars_bool_expInfo.Is_andSet => _set__and; + public global::Foo.Bar.cars_bool_exp? _not { get => _value__not; @@ -1839,6 +1863,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.ICars_bool_expInfo.Is_notSet => _set__not; + public global::System.Collections.Generic.IReadOnlyList? _or { get => _value__or; @@ -1850,6 +1875,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.ICars_bool_expInfo.Is_orSet => _set__or; + public global::Foo.Bar.String_comparison_exp? CarName { get => _value_carName; @@ -1861,6 +1887,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.ICars_bool_expInfo.IsCarNameSet => _set_carName; + public global::Foo.Bar.uuid_comparison_exp? Id { get => _value_id; @@ -1872,6 +1899,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.ICars_bool_expInfo.IsIdSet => _set_id; + public global::Foo.Bar.uuid_comparison_exp? OwnerId { get => _value_ownerId; @@ -1883,6 +1911,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.ICars_bool_expInfo.IsOwnerIdSet => _set_ownerId; + public global::Foo.Bar.people_bool_exp? Person { get => _value_person; @@ -1903,6 +1932,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _stringFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _booleanFormatter = default !; public global::System.String TypeName => "String_comparison_exp"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _stringFormatter = serializerResolver.GetInputValueFormatter("String"); @@ -2477,6 +2507,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IString_comparison_expInfo.Is_eqSet => _set__eq; + public global::System.String? _gt { get => _value__gt; @@ -2488,6 +2519,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IString_comparison_expInfo.Is_gtSet => _set__gt; + public global::System.String? _gte { get => _value__gte; @@ -2499,6 +2531,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IString_comparison_expInfo.Is_gteSet => _set__gte; + ///does the column match the given case-insensitive pattern public global::System.String? _ilike { @@ -2511,6 +2544,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IString_comparison_expInfo.Is_ilikeSet => _set__ilike; + public global::System.Collections.Generic.IReadOnlyList? _in { get => _value__in; @@ -2522,6 +2556,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IString_comparison_expInfo.Is_inSet => _set__in; + ///does the column match the given POSIX regular expression, case insensitive public global::System.String? _iregex { @@ -2534,6 +2569,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IString_comparison_expInfo.Is_iregexSet => _set__iregex; + public global::System.Boolean? _is_null { get => _value__is_null; @@ -2545,6 +2581,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IString_comparison_expInfo.Is_is_nullSet => _set__is_null; + ///does the column match the given pattern public global::System.String? _like { @@ -2557,6 +2594,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IString_comparison_expInfo.Is_likeSet => _set__like; + public global::System.String? _lt { get => _value__lt; @@ -2568,6 +2606,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IString_comparison_expInfo.Is_ltSet => _set__lt; + public global::System.String? _lte { get => _value__lte; @@ -2579,6 +2618,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IString_comparison_expInfo.Is_lteSet => _set__lte; + public global::System.String? _neq { get => _value__neq; @@ -2590,6 +2630,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IString_comparison_expInfo.Is_neqSet => _set__neq; + ///does the column NOT match the given case-insensitive pattern public global::System.String? _nilike { @@ -2602,6 +2643,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IString_comparison_expInfo.Is_nilikeSet => _set__nilike; + public global::System.Collections.Generic.IReadOnlyList? _nin { get => _value__nin; @@ -2613,6 +2655,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IString_comparison_expInfo.Is_ninSet => _set__nin; + ///does the column NOT match the given POSIX regular expression, case insensitive public global::System.String? _niregex { @@ -2625,6 +2668,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IString_comparison_expInfo.Is_niregexSet => _set__niregex; + ///does the column NOT match the given pattern public global::System.String? _nlike { @@ -2637,6 +2681,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IString_comparison_expInfo.Is_nlikeSet => _set__nlike; + ///does the column NOT match the given POSIX regular expression, case sensitive public global::System.String? _nregex { @@ -2649,6 +2694,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IString_comparison_expInfo.Is_nregexSet => _set__nregex; + ///does the column NOT match the given SQL regular expression public global::System.String? _nsimilar { @@ -2661,6 +2707,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IString_comparison_expInfo.Is_nsimilarSet => _set__nsimilar; + ///does the column match the given POSIX regular expression, case sensitive public global::System.String? _regex { @@ -2673,6 +2720,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IString_comparison_expInfo.Is_regexSet => _set__regex; + ///does the column match the given SQL regular expression public global::System.String? _similar { @@ -2694,6 +2742,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _uuidFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _booleanFormatter = default !; public global::System.String TypeName => "uuid_comparison_exp"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _uuidFormatter = serializerResolver.GetInputValueFormatter("uuid"); @@ -3028,6 +3077,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IUuid_comparison_expInfo.Is_eqSet => _set__eq; + public global::System.String? _gt { get => _value__gt; @@ -3039,6 +3089,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IUuid_comparison_expInfo.Is_gtSet => _set__gt; + public global::System.String? _gte { get => _value__gte; @@ -3050,6 +3101,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IUuid_comparison_expInfo.Is_gteSet => _set__gte; + public global::System.Collections.Generic.IReadOnlyList? _in { get => _value__in; @@ -3061,6 +3113,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IUuid_comparison_expInfo.Is_inSet => _set__in; + public global::System.Boolean? _is_null { get => _value__is_null; @@ -3072,6 +3125,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IUuid_comparison_expInfo.Is_is_nullSet => _set__is_null; + public global::System.String? _lt { get => _value__lt; @@ -3083,6 +3137,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IUuid_comparison_expInfo.Is_ltSet => _set__lt; + public global::System.String? _lte { get => _value__lte; @@ -3094,6 +3149,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IUuid_comparison_expInfo.Is_lteSet => _set__lte; + public global::System.String? _neq { get => _value__neq; @@ -3105,6 +3161,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IUuid_comparison_expInfo.Is_neqSet => _set__neq; + public global::System.Collections.Generic.IReadOnlyList? _nin { get => _value__nin; @@ -3126,6 +3183,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _cars_Update_ColumnFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _cars_Bool_ExpFormatter = default !; public global::System.String TypeName => "cars_on_conflict"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _cars_ConstraintFormatter = serializerResolver.GetInputValueFormatter("Cars_constraint"); @@ -3287,6 +3345,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.ICars_on_conflictInfo.IsConstraintSet => _set_constraint; + public global::System.Collections.Generic.IReadOnlyList? Update_columns { get => _value_update_Columns; @@ -3298,6 +3357,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.ICars_on_conflictInfo.IsUpdate_columnsSet => _set_update_Columns; + public global::Foo.Bar.cars_bool_exp? Where { get => _value_where; @@ -3329,6 +3389,7 @@ namespace Foo.Bar public partial class People_constraintSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "People_constraint"; + public People_constraint Parse(global::System.String serializedValue) { return serializedValue switch @@ -3372,6 +3433,7 @@ namespace Foo.Bar public partial class People_update_columnSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "People_update_column"; + public People_update_column Parse(global::System.String serializedValue) { return serializedValue switch @@ -3411,6 +3473,7 @@ namespace Foo.Bar public partial class Cars_constraintSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "Cars_constraint"; + public Cars_constraint Parse(global::System.String serializedValue) { return serializedValue switch @@ -3454,6 +3517,7 @@ namespace Foo.Bar public partial class Cars_update_columnSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "Cars_update_column"; + public Cars_update_column Parse(global::System.String serializedValue) { return serializedValue switch @@ -3496,8 +3560,131 @@ namespace Foo.Bar public static InsertPeopleMutationDocument Instance { get; } = new InsertPeopleMutationDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Mutation; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x50, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x28, 0x24, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x3a, 0x20, 0x5b, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x5f, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x21, 0x5d, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x5f, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x28, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x3a, 0x20, 0x24, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x6d, + 0x75, + 0x74, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x49, + 0x6e, + 0x73, + 0x65, + 0x72, + 0x74, + 0x50, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x28, + 0x24, + 0x70, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x3a, + 0x20, + 0x5b, + 0x70, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x5f, + 0x69, + 0x6e, + 0x73, + 0x65, + 0x72, + 0x74, + 0x5f, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x21, + 0x5d, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x6e, + 0x73, + 0x65, + 0x72, + 0x74, + 0x5f, + 0x70, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x28, + 0x6f, + 0x62, + 0x6a, + 0x65, + 0x63, + 0x74, + 0x73, + 0x3a, + 0x20, + 0x24, + 0x70, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x61, + 0x66, + 0x66, + 0x65, + 0x63, + 0x74, + 0x65, + 0x64, + 0x5f, + 0x72, + 0x6f, + 0x77, + 0x73, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "c8b55152dcc4370cf6b30d4d748739527f578d0a"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -3532,6 +3719,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IInsertPeopleResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Collections.Generic.IReadOnlyList people, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(people); @@ -3643,6 +3831,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IInsertPeopleResult); + public InsertPeopleResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -3701,9 +3890,9 @@ namespace Foo.Bar.State /// insert data into the table: "people" /// public global::Foo.Bar.State.people_mutation_responseData? Insert_people { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new InsertPeopleResultInfo(Insert_people, _entityIds, version); @@ -3971,7 +4160,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - ///number of rows affected by the mutation public global::System.Int32? Affected_rows { get; } } @@ -3981,7 +4169,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.IntrospectionQuery.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.IntrospectionQuery.snap index 8cd9f097146..b78f6d9b4d0 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.IntrospectionQuery.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.IntrospectionQuery.snap @@ -102,22 +102,18 @@ namespace Foo.Bar /// The type that query operations will be rooted at. /// public global::Foo.Bar.IIntrospectionQuery___schema_QueryType QueryType { get; } - /// /// If this server supports mutation, the type that mutation operations will be rooted at. /// public global::Foo.Bar.IIntrospectionQuery___schema_MutationType? MutationType { get; } - /// /// If this server support subscription, the type that subscription operations will be rooted at. /// public global::Foo.Bar.IIntrospectionQuery___schema_SubscriptionType? SubscriptionType { get; } - /// /// A list of all types supported by this server. /// public global::System.Collections.Generic.IReadOnlyList Types { get; } - /// /// A list of all directives supported by this server. /// @@ -429,19 +425,12 @@ namespace Foo.Bar } public global::Foo.Bar.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::System.String? Description { get; } - public global::System.Collections.Generic.IReadOnlyList? Fields { get; } - public global::System.Collections.Generic.IReadOnlyList? InputFields { get; } - public global::System.Collections.Generic.IReadOnlyList? Interfaces { get; } - public global::System.Collections.Generic.IReadOnlyList? EnumValues { get; } - public global::System.Collections.Generic.IReadOnlyList? PossibleTypes { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types___Type? other) @@ -565,15 +554,10 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.String? Description { get; } - public global::System.Collections.Generic.IReadOnlyList Args { get; } - public global::System.Boolean OnOperation { get; } - public global::System.Boolean OnFragment { get; } - public global::System.Boolean OnField { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Directives___Directive? other) @@ -658,15 +642,10 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.String? Description { get; } - public global::System.Collections.Generic.IReadOnlyList Args { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_Fields_Type Type { get; } - public global::System.Boolean IsDeprecated { get; } - public global::System.String? DeprecationReason { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_Fields___Field? other) @@ -753,11 +732,8 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.String? Description { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_InputFields_Type Type { get; } - /// /// A GraphQL-formatted string representing the default value for this input value. /// @@ -842,9 +818,7 @@ namespace Foo.Bar } public global::Foo.Bar.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_Interfaces_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_Interfaces___Type? other) @@ -924,11 +898,8 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.String? Description { get; } - public global::System.Boolean IsDeprecated { get; } - public global::System.String? DeprecationReason { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_EnumValues___EnumValue? other) @@ -1010,9 +981,7 @@ namespace Foo.Bar } public global::Foo.Bar.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_Interfaces_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_PossibleTypes___Type? other) @@ -1092,11 +1061,8 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.String? Description { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_InputFields_Type Type { get; } - /// /// A GraphQL-formatted string representing the default value for this input value. /// @@ -1180,11 +1146,8 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.String? Description { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_InputFields_Type Type { get; } - /// /// A GraphQL-formatted string representing the default value for this input value. /// @@ -1269,9 +1232,7 @@ namespace Foo.Bar } public global::Foo.Bar.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_Interfaces_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_Fields_Type___Type? other) @@ -1352,9 +1313,7 @@ namespace Foo.Bar } public global::Foo.Bar.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_Interfaces_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_InputFields_Type___Type? other) @@ -1435,9 +1394,7 @@ namespace Foo.Bar } public global::Foo.Bar.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_Interfaces_OfType___Type? other) @@ -1518,9 +1475,7 @@ namespace Foo.Bar } public global::Foo.Bar.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_PossibleTypes_OfType___Type? other) @@ -1601,9 +1556,7 @@ namespace Foo.Bar } public global::Foo.Bar.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_Interfaces_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Directives_Args_Type___Type? other) @@ -1684,9 +1637,7 @@ namespace Foo.Bar } public global::Foo.Bar.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_Interfaces_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_Fields_Args_Type___Type? other) @@ -1767,9 +1718,7 @@ namespace Foo.Bar } public global::Foo.Bar.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_Fields_Type_OfType___Type? other) @@ -1850,9 +1799,7 @@ namespace Foo.Bar } public global::Foo.Bar.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_InputFields_Type_OfType___Type? other) @@ -1933,9 +1880,7 @@ namespace Foo.Bar } public global::Foo.Bar.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType_OfType? OfType { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_Interfaces_OfType_OfType___Type? other) @@ -2015,7 +1960,6 @@ namespace Foo.Bar } public global::Foo.Bar.__TypeKind Kind { get; } - public global::System.String? Name { get; } public virtual global::System.Boolean Equals(IntrospectionQuery___schema_Types_Interfaces_OfType_OfType_OfType___Type? other) @@ -2095,22 +2039,18 @@ namespace Foo.Bar /// The type that query operations will be rooted at. /// public global::Foo.Bar.IIntrospectionQuery___schema_QueryType QueryType { get; } - /// /// If this server supports mutation, the type that mutation operations will be rooted at. /// public global::Foo.Bar.IIntrospectionQuery___schema_MutationType? MutationType { get; } - /// /// If this server support subscription, the type that subscription operations will be rooted at. /// public global::Foo.Bar.IIntrospectionQuery___schema_SubscriptionType? SubscriptionType { get; } - /// /// A list of all types supported by this server. /// public global::System.Collections.Generic.IReadOnlyList Types { get; } - /// /// A list of all directives supported by this server. /// @@ -2205,19 +2145,12 @@ namespace Foo.Bar public partial interface IFullType { public global::Foo.Bar.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::System.String? Description { get; } - public global::System.Collections.Generic.IReadOnlyList? Fields { get; } - public global::System.Collections.Generic.IReadOnlyList? InputFields { get; } - public global::System.Collections.Generic.IReadOnlyList? Interfaces { get; } - public global::System.Collections.Generic.IReadOnlyList? EnumValues { get; } - public global::System.Collections.Generic.IReadOnlyList? PossibleTypes { get; } } @@ -2253,15 +2186,10 @@ namespace Foo.Bar public partial interface IIntrospectionQuery___schema_Directives { public global::System.String Name { get; } - public global::System.String? Description { get; } - public global::System.Collections.Generic.IReadOnlyList Args { get; } - public global::System.Boolean OnOperation { get; } - public global::System.Boolean OnFragment { get; } - public global::System.Boolean OnField { get; } } @@ -2284,15 +2212,10 @@ namespace Foo.Bar public partial interface IIntrospectionQuery___schema_Types_Fields { public global::System.String Name { get; } - public global::System.String? Description { get; } - public global::System.Collections.Generic.IReadOnlyList Args { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_Fields_Type Type { get; } - public global::System.Boolean IsDeprecated { get; } - public global::System.String? DeprecationReason { get; } } @@ -2313,11 +2236,8 @@ namespace Foo.Bar public partial interface IInputValue { public global::System.String Name { get; } - public global::System.String? Description { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_InputFields_Type Type { get; } - /// /// A GraphQL-formatted string representing the default value for this input value. /// @@ -2352,9 +2272,7 @@ namespace Foo.Bar public partial interface ITypeRef { public global::Foo.Bar.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_Interfaces_OfType? OfType { get; } } @@ -2388,11 +2306,8 @@ namespace Foo.Bar public partial interface IIntrospectionQuery___schema_Types_EnumValues { public global::System.String Name { get; } - public global::System.String? Description { get; } - public global::System.Boolean IsDeprecated { get; } - public global::System.String? DeprecationReason { get; } } @@ -2517,9 +2432,7 @@ namespace Foo.Bar public partial interface IIntrospectionQuery___schema_Types_Interfaces_OfType { public global::Foo.Bar.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType? OfType { get; } } @@ -2544,9 +2457,7 @@ namespace Foo.Bar public partial interface IIntrospectionQuery___schema_Types_PossibleTypes_OfType { public global::Foo.Bar.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType? OfType { get; } } @@ -2615,9 +2526,7 @@ namespace Foo.Bar public partial interface IIntrospectionQuery___schema_Types_Fields_Type_OfType { public global::Foo.Bar.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType? OfType { get; } } @@ -2642,9 +2551,7 @@ namespace Foo.Bar public partial interface IIntrospectionQuery___schema_Types_InputFields_Type_OfType { public global::Foo.Bar.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType? OfType { get; } } @@ -2669,9 +2576,7 @@ namespace Foo.Bar public partial interface IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType { public global::Foo.Bar.__TypeKind Kind { get; } - public global::System.String? Name { get; } - public global::Foo.Bar.IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType_OfType? OfType { get; } } @@ -2696,7 +2601,6 @@ namespace Foo.Bar public partial interface IIntrospectionQuery___schema_Types_Interfaces_OfType_OfType_OfType { public global::Foo.Bar.__TypeKind Kind { get; } - public global::System.String? Name { get; } } @@ -2757,6 +2661,7 @@ namespace Foo.Bar public partial class __TypeKindSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "__TypeKind"; + public __TypeKind Parse(global::System.String serializedValue) { return serializedValue switch @@ -2906,8 +2811,981 @@ namespace Foo.Bar public static IntrospectionQueryQueryDocument Instance { get; } = new IntrospectionQueryQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x49, 0x6e, 0x74, 0x72, 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x71, 0x75, 0x65, 0x72, 0x79, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x46, 0x75, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7d, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x7d, 0x20, 0x6f, 0x6e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x46, 0x75, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x5f, 0x5f, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x6b, 0x69, 0x6e, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x28, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x3a, 0x20, 0x74, 0x72, 0x75, 0x65, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x7d, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x66, 0x20, 0x7d, 0x20, 0x69, 0x73, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x20, 0x7d, 0x20, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x7d, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x66, 0x20, 0x7d, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x28, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x3a, 0x20, 0x74, 0x72, 0x75, 0x65, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x20, 0x7d, 0x20, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x66, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x5f, 0x5f, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x66, 0x20, 0x7d, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x66, 0x20, 0x6f, 0x6e, 0x20, 0x5f, 0x5f, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x6b, 0x69, 0x6e, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6b, 0x69, 0x6e, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6b, 0x69, 0x6e, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6b, 0x69, 0x6e, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x49, + 0x6e, + 0x74, + 0x72, + 0x6f, + 0x73, + 0x70, + 0x65, + 0x63, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x51, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x73, + 0x63, + 0x68, + 0x65, + 0x6d, + 0x61, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x6d, + 0x75, + 0x74, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x73, + 0x75, + 0x62, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x74, + 0x79, + 0x70, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x46, + 0x75, + 0x6c, + 0x6c, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x64, + 0x69, + 0x72, + 0x65, + 0x63, + 0x74, + 0x69, + 0x76, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x64, + 0x65, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x61, + 0x72, + 0x67, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x56, + 0x61, + 0x6c, + 0x75, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x6f, + 0x6e, + 0x4f, + 0x70, + 0x65, + 0x72, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x6f, + 0x6e, + 0x46, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x6f, + 0x6e, + 0x46, + 0x69, + 0x65, + 0x6c, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x46, + 0x75, + 0x6c, + 0x6c, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x5f, + 0x5f, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x6b, + 0x69, + 0x6e, + 0x64, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x64, + 0x65, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x66, + 0x69, + 0x65, + 0x6c, + 0x64, + 0x73, + 0x28, + 0x69, + 0x6e, + 0x63, + 0x6c, + 0x75, + 0x64, + 0x65, + 0x44, + 0x65, + 0x70, + 0x72, + 0x65, + 0x63, + 0x61, + 0x74, + 0x65, + 0x64, + 0x3a, + 0x20, + 0x74, + 0x72, + 0x75, + 0x65, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x64, + 0x65, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x61, + 0x72, + 0x67, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x56, + 0x61, + 0x6c, + 0x75, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x74, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x54, + 0x79, + 0x70, + 0x65, + 0x52, + 0x65, + 0x66, + 0x20, + 0x7d, + 0x20, + 0x69, + 0x73, + 0x44, + 0x65, + 0x70, + 0x72, + 0x65, + 0x63, + 0x61, + 0x74, + 0x65, + 0x64, + 0x20, + 0x64, + 0x65, + 0x70, + 0x72, + 0x65, + 0x63, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x52, + 0x65, + 0x61, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7d, + 0x20, + 0x69, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x46, + 0x69, + 0x65, + 0x6c, + 0x64, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x56, + 0x61, + 0x6c, + 0x75, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x69, + 0x6e, + 0x74, + 0x65, + 0x72, + 0x66, + 0x61, + 0x63, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x54, + 0x79, + 0x70, + 0x65, + 0x52, + 0x65, + 0x66, + 0x20, + 0x7d, + 0x20, + 0x65, + 0x6e, + 0x75, + 0x6d, + 0x56, + 0x61, + 0x6c, + 0x75, + 0x65, + 0x73, + 0x28, + 0x69, + 0x6e, + 0x63, + 0x6c, + 0x75, + 0x64, + 0x65, + 0x44, + 0x65, + 0x70, + 0x72, + 0x65, + 0x63, + 0x61, + 0x74, + 0x65, + 0x64, + 0x3a, + 0x20, + 0x74, + 0x72, + 0x75, + 0x65, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x64, + 0x65, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x69, + 0x73, + 0x44, + 0x65, + 0x70, + 0x72, + 0x65, + 0x63, + 0x61, + 0x74, + 0x65, + 0x64, + 0x20, + 0x64, + 0x65, + 0x70, + 0x72, + 0x65, + 0x63, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x52, + 0x65, + 0x61, + 0x73, + 0x6f, + 0x6e, + 0x20, + 0x7d, + 0x20, + 0x70, + 0x6f, + 0x73, + 0x73, + 0x69, + 0x62, + 0x6c, + 0x65, + 0x54, + 0x79, + 0x70, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x54, + 0x79, + 0x70, + 0x65, + 0x52, + 0x65, + 0x66, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x56, + 0x61, + 0x6c, + 0x75, + 0x65, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x5f, + 0x5f, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x56, + 0x61, + 0x6c, + 0x75, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x64, + 0x65, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x74, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x54, + 0x79, + 0x70, + 0x65, + 0x52, + 0x65, + 0x66, + 0x20, + 0x7d, + 0x20, + 0x64, + 0x65, + 0x66, + 0x61, + 0x75, + 0x6c, + 0x74, + 0x56, + 0x61, + 0x6c, + 0x75, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x54, + 0x79, + 0x70, + 0x65, + 0x52, + 0x65, + 0x66, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x5f, + 0x5f, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x6b, + 0x69, + 0x6e, + 0x64, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6f, + 0x66, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6b, + 0x69, + 0x6e, + 0x64, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6f, + 0x66, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6b, + 0x69, + 0x6e, + 0x64, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6f, + 0x66, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6b, + 0x69, + 0x6e, + 0x64, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "5902e9f9fd92bc2e9785f0821db6ff925e660fde"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -3037,6 +3915,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IIntrospectionQueryResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -3222,6 +4101,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IIntrospectionQueryResult); + public IntrospectionQueryResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -3699,9 +4579,9 @@ namespace Foo.Bar.State /// Access the current type schema of this server. /// public global::Foo.Bar.State.__SchemaData __schema { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new IntrospectionQueryResultInfo(__schema, _entityIds, version); @@ -4384,19 +5264,14 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - ///The type that query operations will be rooted at. public global::Foo.Bar.State.__TypeData? QueryType { get; } - ///If this server supports mutation, the type that mutation operations will be rooted at. public global::Foo.Bar.State.__TypeData? MutationType { get; } - ///If this server support subscription, the type that subscription operations will be rooted at. public global::Foo.Bar.State.__TypeData? SubscriptionType { get; } - ///A list of all types supported by this server. public global::System.Collections.Generic.IReadOnlyList? Types { get; } - ///A list of all directives supported by this server. public global::System.Collections.Generic.IReadOnlyList? Directives { get; } } @@ -4421,23 +5296,14 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::Foo.Bar.__TypeKind? Kind { get; } - public global::System.String? Description { get; } - public global::System.Collections.Generic.IReadOnlyList? Fields { get; } - public global::System.Collections.Generic.IReadOnlyList? InputFields { get; } - public global::System.Collections.Generic.IReadOnlyList? Interfaces { get; } - public global::System.Collections.Generic.IReadOnlyList? EnumValues { get; } - public global::System.Collections.Generic.IReadOnlyList? PossibleTypes { get; } - public global::Foo.Bar.State.__TypeData? OfType { get; } } @@ -4458,17 +5324,11 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.String? Description { get; } - public global::System.Collections.Generic.IReadOnlyList? Args { get; } - public global::System.Boolean? OnOperation { get; } - public global::System.Boolean? OnFragment { get; } - public global::System.Boolean? OnField { get; } } @@ -4489,17 +5349,11 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.String? Description { get; } - public global::System.Collections.Generic.IReadOnlyList? Args { get; } - public global::Foo.Bar.State.__TypeData? Type { get; } - public global::System.Boolean? IsDeprecated { get; } - public global::System.String? DeprecationReason { get; } } @@ -4518,13 +5372,9 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.String? Description { get; } - public global::Foo.Bar.State.__TypeData? Type { get; } - ///A GraphQL-formatted string representing the default value for this input value. public global::System.String? DefaultValue { get; } } @@ -4544,13 +5394,9 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? Name { get; } - public global::System.String? Description { get; } - public global::System.Boolean? IsDeprecated { get; } - public global::System.String? DeprecationReason { get; } } @@ -4559,7 +5405,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.LowerCaseScalarArgument.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.LowerCaseScalarArgument.snap index aefb129a1cd..6504084209d 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.LowerCaseScalarArgument.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.LowerCaseScalarArgument.snap @@ -101,9 +101,7 @@ namespace Foo.Bar } public global::System.String Id { get; } - public global::System.String FirstName { get; } - public global::System.String LastName { get; } public virtual global::System.Boolean Equals(GetPeopleByPk_People_by_pk_people? other) @@ -177,9 +175,7 @@ namespace Foo.Bar public partial interface IGetPeopleByPk_People_by_pk { public global::System.String Id { get; } - public global::System.String FirstName { get; } - public global::System.String LastName { get; } } @@ -218,8 +214,126 @@ namespace Foo.Bar public static GetPeopleByPkQueryDocument Instance { get; } = new GetPeopleByPkQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x50, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x50, 0x6b, 0x28, 0x24, 0x69, 0x64, 0x3a, 0x20, 0x75, 0x75, 0x69, 0x64, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x5f, 0x62, 0x79, 0x5f, 0x70, 0x6b, 0x28, 0x69, 0x64, 0x3a, 0x20, 0x24, 0x69, 0x64, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x64, 0x20, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x20, 0x6c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x50, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x42, + 0x79, + 0x50, + 0x6b, + 0x28, + 0x24, + 0x69, + 0x64, + 0x3a, + 0x20, + 0x75, + 0x75, + 0x69, + 0x64, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x5f, + 0x62, + 0x79, + 0x5f, + 0x70, + 0x6b, + 0x28, + 0x69, + 0x64, + 0x3a, + 0x20, + 0x24, + 0x69, + 0x64, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x64, + 0x20, + 0x66, + 0x69, + 0x72, + 0x73, + 0x74, + 0x4e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6c, + 0x61, + 0x73, + 0x74, + 0x4e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x70, + 0x65, + 0x6f, + 0x70, + 0x6c, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "28da94710b416eca776b3fa8f2e06756a3a5477e"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -259,6 +373,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetPeopleByPkResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.String id, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(id); @@ -366,9 +481,7 @@ namespace Foo.Bar.State } public global::System.String Id { get; } - public global::System.String FirstName { get; } - public global::System.String LastName { get; } } @@ -385,6 +498,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetPeopleByPkResult); + public GetPeopleByPkResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -438,9 +552,9 @@ namespace Foo.Bar.State /// fetch data from the table: "people" using primary key columns /// public global::StrawberryShake.EntityId? People_by_pk { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetPeopleByPkResultInfo(People_by_pk, _entityIds, version); @@ -552,7 +666,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.MultiLineDocumentation.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.MultiLineDocumentation.snap index b44601028fb..4e9031c1097 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.MultiLineDocumentation.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.MultiLineDocumentation.snap @@ -116,8 +116,28 @@ namespace Foo.Bar public static FooQueryDocument Instance { get; } = new FooQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x46, 0x6f, 0x6f, 0x20, 0x7b, 0x20, 0x61, 0x62, 0x63, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x46, + 0x6f, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x61, + 0x62, + 0x63, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "1eb6282f473553c0540a49bffc020a72111807bc"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -147,6 +167,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IFooResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -232,6 +253,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IFooResult); + public FooResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -271,9 +293,9 @@ namespace Foo.Bar.State /// DEF /// public global::System.String? Abc { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new FooResultInfo(Abc, _entityIds, version); @@ -329,7 +351,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.NodeTypenameCollision.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.NodeTypenameCollision.snap index 9490cca8782..a583828a028 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.NodeTypenameCollision.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.NodeTypenameCollision.snap @@ -97,7 +97,6 @@ namespace Foo.Bar /// The name of the current Object type at runtime. /// public global::System.String __typename { get; } - public global::System.String Id { get; } public virtual global::System.Boolean Equals(Nodes_Node_Workspace? other) @@ -164,7 +163,6 @@ namespace Foo.Bar public partial interface INodes_Node { public global::System.String __typename { get; } - public global::System.String Id { get; } } @@ -198,8 +196,92 @@ namespace Foo.Bar public static NodesQueryDocument Instance { get; } = new NodesQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x28, 0x24, 0x69, 0x64, 0x3a, 0x20, 0x49, 0x44, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x28, 0x69, 0x64, 0x3a, 0x20, 0x24, 0x69, 0x64, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x64, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x4e, + 0x6f, + 0x64, + 0x65, + 0x73, + 0x28, + 0x24, + 0x69, + 0x64, + 0x3a, + 0x20, + 0x49, + 0x44, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x6f, + 0x64, + 0x65, + 0x28, + 0x69, + 0x64, + 0x3a, + 0x20, + 0x24, + 0x69, + 0x64, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x64, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x57, + 0x6f, + 0x72, + 0x6b, + 0x73, + 0x70, + 0x61, + 0x63, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "86342fe724e154da3e9ddee8d2b79bcfabc79214"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -237,6 +319,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(INodesResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.String id, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(id); @@ -341,7 +424,6 @@ namespace Foo.Bar.State ///The name of the current Object type at runtime. public global::System.String __typename { get; } - public global::System.String Id { get; } } @@ -358,6 +440,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.INodesResult); + public NodesResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -408,9 +491,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? Node { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new NodesResultInfo(Node, _entityIds, version); @@ -522,7 +605,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.NonNullLists.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.NonNullLists.snap index bd4f1e40a30..6d4a5d9660a 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.NonNullLists.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.NonNullLists.snap @@ -99,17 +99,11 @@ namespace Foo.Bar } public global::System.Collections.Generic.IReadOnlyList Amenities1 { get; } - public global::System.Collections.Generic.IReadOnlyList? Amenities2 { get; } - public global::System.Collections.Generic.IReadOnlyList Amenities3 { get; } - public global::System.Collections.Generic.IReadOnlyList? Amenities4 { get; } - public global::System.Collections.Generic.IReadOnlyList> Amenities5 { get; } - public global::System.Collections.Generic.IReadOnlyList>? Amenities6 { get; } - public global::System.Collections.Generic.IReadOnlyList?> Amenities7 { get; } public virtual global::System.Boolean Equals(GetAll_Listings_Offer? other) @@ -242,17 +236,11 @@ namespace Foo.Bar public partial interface IOffer { public global::System.Collections.Generic.IReadOnlyList Amenities1 { get; } - public global::System.Collections.Generic.IReadOnlyList? Amenities2 { get; } - public global::System.Collections.Generic.IReadOnlyList Amenities3 { get; } - public global::System.Collections.Generic.IReadOnlyList? Amenities4 { get; } - public global::System.Collections.Generic.IReadOnlyList> Amenities5 { get; } - public global::System.Collections.Generic.IReadOnlyList>? Amenities6 { get; } - public global::System.Collections.Generic.IReadOnlyList?> Amenities7 { get; } } @@ -275,6 +263,7 @@ namespace Foo.Bar public partial class AmenitySerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "Amenity"; + public Amenity Parse(global::System.String serializedValue) { return serializedValue switch @@ -325,8 +314,166 @@ namespace Foo.Bar public static GetAllQueryDocument Instance { get; } = new GetAllQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x20, 0x7b, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x20, 0x6f, 0x6e, 0x20, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x20, 0x7b, 0x20, 0x61, 0x6d, 0x65, 0x6e, 0x69, 0x74, 0x69, 0x65, 0x73, 0x31, 0x20, 0x61, 0x6d, 0x65, 0x6e, 0x69, 0x74, 0x69, 0x65, 0x73, 0x32, 0x20, 0x61, 0x6d, 0x65, 0x6e, 0x69, 0x74, 0x69, 0x65, 0x73, 0x33, 0x20, 0x61, 0x6d, 0x65, 0x6e, 0x69, 0x74, 0x69, 0x65, 0x73, 0x34, 0x20, 0x61, 0x6d, 0x65, 0x6e, 0x69, 0x74, 0x69, 0x65, 0x73, 0x35, 0x20, 0x61, 0x6d, 0x65, 0x6e, 0x69, 0x74, 0x69, 0x65, 0x73, 0x36, 0x20, 0x61, 0x6d, 0x65, 0x6e, 0x69, 0x74, 0x69, 0x65, 0x73, 0x37, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x41, + 0x6c, + 0x6c, + 0x20, + 0x7b, + 0x20, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x4f, + 0x66, + 0x66, + 0x65, + 0x72, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x4f, + 0x66, + 0x66, + 0x65, + 0x72, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4f, + 0x66, + 0x66, + 0x65, + 0x72, + 0x20, + 0x7b, + 0x20, + 0x61, + 0x6d, + 0x65, + 0x6e, + 0x69, + 0x74, + 0x69, + 0x65, + 0x73, + 0x31, + 0x20, + 0x61, + 0x6d, + 0x65, + 0x6e, + 0x69, + 0x74, + 0x69, + 0x65, + 0x73, + 0x32, + 0x20, + 0x61, + 0x6d, + 0x65, + 0x6e, + 0x69, + 0x74, + 0x69, + 0x65, + 0x73, + 0x33, + 0x20, + 0x61, + 0x6d, + 0x65, + 0x6e, + 0x69, + 0x74, + 0x69, + 0x65, + 0x73, + 0x34, + 0x20, + 0x61, + 0x6d, + 0x65, + 0x6e, + 0x69, + 0x74, + 0x69, + 0x65, + 0x73, + 0x35, + 0x20, + 0x61, + 0x6d, + 0x65, + 0x6e, + 0x69, + 0x74, + 0x69, + 0x65, + 0x73, + 0x36, + 0x20, + 0x61, + 0x6d, + 0x65, + 0x6e, + 0x69, + 0x74, + 0x69, + 0x65, + 0x73, + 0x37, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "2cb871ada5a49964bc9fe651d0d97bd18903b601"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -369,6 +516,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetAllResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -467,6 +615,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetAllResult); + public GetAllResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -533,9 +682,9 @@ namespace Foo.Bar.State } public global::System.Collections.Generic.IReadOnlyList Listings { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetAllResultInfo(Listings, _entityIds, version); @@ -814,19 +963,12 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Collections.Generic.IReadOnlyList? Amenities1 { get; } - public global::System.Collections.Generic.IReadOnlyList? Amenities2 { get; } - public global::System.Collections.Generic.IReadOnlyList? Amenities3 { get; } - public global::System.Collections.Generic.IReadOnlyList? Amenities4 { get; } - public global::System.Collections.Generic.IReadOnlyList>? Amenities5 { get; } - public global::System.Collections.Generic.IReadOnlyList>? Amenities6 { get; } - public global::System.Collections.Generic.IReadOnlyList?>? Amenities7 { get; } } @@ -835,7 +977,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.QueryInterference.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.QueryInterference.snap index adbe6968413..21839145116 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.QueryInterference.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.QueryInterference.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.Int32 TotalCount { get; } - public global::System.Collections.Generic.IReadOnlyList? Items { get; } public virtual global::System.Boolean Equals(GetFeatsPage_Feats_FeatCollectionSegment? other) @@ -173,13 +172,9 @@ namespace Foo.Bar } public global::System.Guid Id { get; } - public global::System.String Name { get; } - public global::System.Int32 Level { get; } - public global::System.Boolean CanBeLearnedMoreThanOnce { get; } - public global::System.Collections.Generic.IReadOnlyList Details { get; } public virtual global::System.Boolean Equals(GetFeatsPage_Feats_Items_Feat? other) @@ -315,7 +310,6 @@ namespace Foo.Bar public partial interface IGetFeatsPage_Feats { public global::System.Int32 TotalCount { get; } - public global::System.Collections.Generic.IReadOnlyList? Items { get; } } @@ -330,13 +324,9 @@ namespace Foo.Bar public partial interface IFeatsPage { public global::System.Guid Id { get; } - public global::System.String Name { get; } - public global::System.Int32 Level { get; } - public global::System.Boolean CanBeLearnedMoreThanOnce { get; } - public global::System.Collections.Generic.IReadOnlyList Details { get; } } @@ -519,17 +509,11 @@ namespace Foo.Bar } public global::System.Guid Id { get; } - public global::System.String Name { get; } - public global::System.Int32 Level { get; } - public global::System.String? Special { get; } - public global::System.String? Trigger { get; } - public global::System.Collections.Generic.IReadOnlyList Details { get; } - public global::Foo.Bar.IGetFeatById_Feats_Items_ActionType ActionType { get; } public virtual global::System.Boolean Equals(GetFeatById_Feats_Items_Feat? other) @@ -750,17 +734,11 @@ namespace Foo.Bar public partial interface IFeatById { public global::System.Guid Id { get; } - public global::System.String Name { get; } - public global::System.Int32 Level { get; } - public global::System.String? Special { get; } - public global::System.String? Trigger { get; } - public global::System.Collections.Generic.IReadOnlyList Details { get; } - public global::Foo.Bar.IGetFeatById_Feats_Items_ActionType ActionType { get; } } @@ -812,6 +790,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _frequencySortInputFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _rollableEffectSortInputFormatter = default !; public global::System.String TypeName => "FeatSortInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _sortEnumTypeFormatter = serializerResolver.GetInputValueFormatter("SortEnumType"); @@ -1240,6 +1219,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IFeatSortInputInfo.IsNameSet => _set_name; + public global::Foo.Bar.SortEnumType? CanBeLearnedMoreThanOnce { get => _value_canBeLearnedMoreThanOnce; @@ -1251,6 +1231,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IFeatSortInputInfo.IsCanBeLearnedMoreThanOnceSet => _set_canBeLearnedMoreThanOnce; + public global::Foo.Bar.SortEnumType? Special { get => _value_special; @@ -1262,6 +1243,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IFeatSortInputInfo.IsSpecialSet => _set_special; + public global::Foo.Bar.SortEnumType? Trigger { get => _value_trigger; @@ -1273,6 +1255,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IFeatSortInputInfo.IsTriggerSet => _set_trigger; + public global::Foo.Bar.SortEnumType? Level { get => _value_level; @@ -1284,6 +1267,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IFeatSortInputInfo.IsLevelSet => _set_level; + public global::Foo.Bar.SortEnumType? ActionTypeId { get => _value_actionTypeId; @@ -1295,6 +1279,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IFeatSortInputInfo.IsActionTypeIdSet => _set_actionTypeId; + public global::Foo.Bar.ActionTypeSortInput? ActionType { get => _value_actionType; @@ -1306,6 +1291,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IFeatSortInputInfo.IsActionTypeSet => _set_actionType; + public global::Foo.Bar.SortEnumType? FeatTypeId { get => _value_featTypeId; @@ -1317,6 +1303,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IFeatSortInputInfo.IsFeatTypeIdSet => _set_featTypeId; + public global::Foo.Bar.FeatTypeSortInput? FeatType { get => _value_featType; @@ -1328,6 +1315,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IFeatSortInputInfo.IsFeatTypeSet => _set_featType; + public global::Foo.Bar.SortEnumType? FrequencyId { get => _value_frequencyId; @@ -1339,6 +1327,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IFeatSortInputInfo.IsFrequencyIdSet => _set_frequencyId; + public global::Foo.Bar.FrequencySortInput? Frequency { get => _value_frequency; @@ -1350,6 +1339,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IFeatSortInputInfo.IsFrequencySet => _set_frequency; + public global::Foo.Bar.RollableEffectSortInput? RollableEffect { get => _value_rollableEffect; @@ -1361,6 +1351,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IFeatSortInputInfo.IsRollableEffectSet => _set_rollableEffect; + public global::Foo.Bar.SortEnumType? RollableEffectId { get => _value_rollableEffectId; @@ -1372,6 +1363,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IFeatSortInputInfo.IsRollableEffectIdSet => _set_rollableEffectId; + public global::Foo.Bar.SortEnumType? Id { get => _value_id; @@ -1391,6 +1383,7 @@ namespace Foo.Bar { private global::StrawberryShake.Serialization.IInputValueFormatter _sortEnumTypeFormatter = default !; public global::System.String TypeName => "ActionTypeSortInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _sortEnumTypeFormatter = serializerResolver.GetInputValueFormatter("SortEnumType"); @@ -1527,6 +1520,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IActionTypeSortInputInfo.IsNameSet => _set_name; + public global::Foo.Bar.SortEnumType? Id { get => _value_id; @@ -1546,6 +1540,7 @@ namespace Foo.Bar { private global::StrawberryShake.Serialization.IInputValueFormatter _sortEnumTypeFormatter = default !; public global::System.String TypeName => "FeatTypeSortInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _sortEnumTypeFormatter = serializerResolver.GetInputValueFormatter("SortEnumType"); @@ -1682,6 +1677,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IFeatTypeSortInputInfo.IsNameSet => _set_name; + public global::Foo.Bar.SortEnumType? Id { get => _value_id; @@ -1701,6 +1697,7 @@ namespace Foo.Bar { private global::StrawberryShake.Serialization.IInputValueFormatter _sortEnumTypeFormatter = default !; public global::System.String TypeName => "FrequencySortInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _sortEnumTypeFormatter = serializerResolver.GetInputValueFormatter("SortEnumType"); @@ -1885,6 +1882,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IFrequencySortInputInfo.IsNameSet => _set_name; + public global::Foo.Bar.SortEnumType? Amount { get => _value_amount; @@ -1896,6 +1894,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IFrequencySortInputInfo.IsAmountSet => _set_amount; + public global::Foo.Bar.SortEnumType? TimeSpan { get => _value_timeSpan; @@ -1907,6 +1906,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IFrequencySortInputInfo.IsTimeSpanSet => _set_timeSpan; + public global::Foo.Bar.SortEnumType? Id { get => _value_id; @@ -1926,6 +1926,7 @@ namespace Foo.Bar { private global::StrawberryShake.Serialization.IInputValueFormatter _sortEnumTypeFormatter = default !; public global::System.String TypeName => "RollableEffectSortInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _sortEnumTypeFormatter = serializerResolver.GetInputValueFormatter("SortEnumType"); @@ -2134,6 +2135,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IRollableEffectSortInputInfo.IsCriticalSuccessSet => _set_criticalSuccess; + public global::Foo.Bar.SortEnumType? Success { get => _value_success; @@ -2145,6 +2147,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IRollableEffectSortInputInfo.IsSuccessSet => _set_success; + public global::Foo.Bar.SortEnumType? Failure { get => _value_failure; @@ -2156,6 +2159,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IRollableEffectSortInputInfo.IsFailureSet => _set_failure; + public global::Foo.Bar.SortEnumType? CriticalFailure { get => _value_criticalFailure; @@ -2167,6 +2171,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IRollableEffectSortInputInfo.IsCriticalFailureSet => _set_criticalFailure; + public global::Foo.Bar.SortEnumType? Id { get => _value_id; @@ -2193,6 +2198,7 @@ namespace Foo.Bar public partial class SortEnumTypeSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "SortEnumType"; + public SortEnumType Parse(global::System.String serializedValue) { return serializedValue switch @@ -2254,8 +2260,503 @@ namespace Foo.Bar public static GetFeatsPageQueryDocument Instance { get; } = new GetFeatsPageQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x46, 0x65, 0x61, 0x74, 0x73, 0x50, 0x61, 0x67, 0x65, 0x28, 0x24, 0x73, 0x6b, 0x69, 0x70, 0x3a, 0x20, 0x49, 0x6e, 0x74, 0x21, 0x2c, 0x20, 0x24, 0x74, 0x61, 0x6b, 0x65, 0x3a, 0x20, 0x49, 0x6e, 0x74, 0x21, 0x2c, 0x20, 0x24, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x54, 0x65, 0x72, 0x6d, 0x3a, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x21, 0x20, 0x3d, 0x20, 0x22, 0x22, 0x2c, 0x20, 0x24, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x20, 0x5b, 0x46, 0x65, 0x61, 0x74, 0x53, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x21, 0x5d, 0x20, 0x3d, 0x20, 0x5b, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x41, 0x53, 0x43, 0x20, 0x7d, 0x20, 0x5d, 0x29, 0x20, 0x7b, 0x20, 0x66, 0x65, 0x61, 0x74, 0x73, 0x28, 0x73, 0x6b, 0x69, 0x70, 0x3a, 0x20, 0x24, 0x73, 0x6b, 0x69, 0x70, 0x2c, 0x20, 0x74, 0x61, 0x6b, 0x65, 0x3a, 0x20, 0x24, 0x74, 0x61, 0x6b, 0x65, 0x2c, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x20, 0x24, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2c, 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x3a, 0x20, 0x7b, 0x20, 0x6f, 0x72, 0x3a, 0x20, 0x5b, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x7b, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x3a, 0x20, 0x24, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x54, 0x65, 0x72, 0x6d, 0x20, 0x7d, 0x20, 0x7d, 0x2c, 0x20, 0x7b, 0x20, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, 0x3a, 0x20, 0x7b, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x3a, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x7b, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x3a, 0x20, 0x24, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x54, 0x65, 0x72, 0x6d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x5d, 0x20, 0x7d, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x46, 0x65, 0x61, 0x74, 0x73, 0x50, 0x61, 0x67, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x46, 0x65, 0x61, 0x74, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x46, 0x65, 0x61, 0x74, 0x73, 0x50, 0x61, 0x67, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x46, 0x65, 0x61, 0x74, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x63, 0x61, 0x6e, 0x42, 0x65, 0x4c, 0x65, 0x61, 0x72, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x72, 0x65, 0x54, 0x68, 0x61, 0x6e, 0x4f, 0x6e, 0x63, 0x65, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x74, 0x65, 0x78, 0x74, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x46, 0x65, 0x61, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x46, + 0x65, + 0x61, + 0x74, + 0x73, + 0x50, + 0x61, + 0x67, + 0x65, + 0x28, + 0x24, + 0x73, + 0x6b, + 0x69, + 0x70, + 0x3a, + 0x20, + 0x49, + 0x6e, + 0x74, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x74, + 0x61, + 0x6b, + 0x65, + 0x3a, + 0x20, + 0x49, + 0x6e, + 0x74, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x73, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x54, + 0x65, + 0x72, + 0x6d, + 0x3a, + 0x20, + 0x53, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x21, + 0x20, + 0x3d, + 0x20, + 0x22, + 0x22, + 0x2c, + 0x20, + 0x24, + 0x6f, + 0x72, + 0x64, + 0x65, + 0x72, + 0x3a, + 0x20, + 0x5b, + 0x46, + 0x65, + 0x61, + 0x74, + 0x53, + 0x6f, + 0x72, + 0x74, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x21, + 0x5d, + 0x20, + 0x3d, + 0x20, + 0x5b, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x3a, + 0x20, + 0x41, + 0x53, + 0x43, + 0x20, + 0x7d, + 0x20, + 0x5d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x65, + 0x61, + 0x74, + 0x73, + 0x28, + 0x73, + 0x6b, + 0x69, + 0x70, + 0x3a, + 0x20, + 0x24, + 0x73, + 0x6b, + 0x69, + 0x70, + 0x2c, + 0x20, + 0x74, + 0x61, + 0x6b, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x74, + 0x61, + 0x6b, + 0x65, + 0x2c, + 0x20, + 0x6f, + 0x72, + 0x64, + 0x65, + 0x72, + 0x3a, + 0x20, + 0x24, + 0x6f, + 0x72, + 0x64, + 0x65, + 0x72, + 0x2c, + 0x20, + 0x77, + 0x68, + 0x65, + 0x72, + 0x65, + 0x3a, + 0x20, + 0x7b, + 0x20, + 0x6f, + 0x72, + 0x3a, + 0x20, + 0x5b, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x3a, + 0x20, + 0x7b, + 0x20, + 0x63, + 0x6f, + 0x6e, + 0x74, + 0x61, + 0x69, + 0x6e, + 0x73, + 0x3a, + 0x20, + 0x24, + 0x73, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x54, + 0x65, + 0x72, + 0x6d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x2c, + 0x20, + 0x7b, + 0x20, + 0x74, + 0x72, + 0x61, + 0x69, + 0x74, + 0x73, + 0x3a, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x6f, + 0x6d, + 0x65, + 0x3a, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x3a, + 0x20, + 0x7b, + 0x20, + 0x63, + 0x6f, + 0x6e, + 0x74, + 0x61, + 0x69, + 0x6e, + 0x73, + 0x3a, + 0x20, + 0x24, + 0x73, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x54, + 0x65, + 0x72, + 0x6d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x5d, + 0x20, + 0x7d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x74, + 0x6f, + 0x74, + 0x61, + 0x6c, + 0x43, + 0x6f, + 0x75, + 0x6e, + 0x74, + 0x20, + 0x69, + 0x74, + 0x65, + 0x6d, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x46, + 0x65, + 0x61, + 0x74, + 0x73, + 0x50, + 0x61, + 0x67, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x46, + 0x65, + 0x61, + 0x74, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x46, + 0x65, + 0x61, + 0x74, + 0x73, + 0x50, + 0x61, + 0x67, + 0x65, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x46, + 0x65, + 0x61, + 0x74, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6c, + 0x65, + 0x76, + 0x65, + 0x6c, + 0x20, + 0x63, + 0x61, + 0x6e, + 0x42, + 0x65, + 0x4c, + 0x65, + 0x61, + 0x72, + 0x6e, + 0x65, + 0x64, + 0x4d, + 0x6f, + 0x72, + 0x65, + 0x54, + 0x68, + 0x61, + 0x6e, + 0x4f, + 0x6e, + 0x63, + 0x65, + 0x20, + 0x64, + 0x65, + 0x74, + 0x61, + 0x69, + 0x6c, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x74, + 0x65, + 0x78, + 0x74, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x46, + 0x65, + 0x61, + 0x74, + 0x44, + 0x65, + 0x74, + 0x61, + 0x69, + 0x6c, + 0x73, + 0x42, + 0x6c, + 0x6f, + 0x63, + 0x6b, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "defcd7f67f31345e43429d1db7aa93bc8ca8af7d"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -2315,6 +2816,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetFeatsPageResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Int32 skip, global::System.Int32 take, global::System.String searchTerm, global::System.Collections.Generic.IReadOnlyList? order, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(skip, take, searchTerm, order); @@ -2480,8 +2982,321 @@ namespace Foo.Bar public static GetFeatByIdQueryDocument Instance { get; } = new GetFeatByIdQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x46, 0x65, 0x61, 0x74, 0x42, 0x79, 0x49, 0x64, 0x28, 0x24, 0x69, 0x64, 0x3a, 0x20, 0x55, 0x55, 0x49, 0x44, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x66, 0x65, 0x61, 0x74, 0x73, 0x28, 0x77, 0x68, 0x65, 0x72, 0x65, 0x3a, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x3a, 0x20, 0x7b, 0x20, 0x65, 0x71, 0x3a, 0x20, 0x24, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x46, 0x65, 0x61, 0x74, 0x42, 0x79, 0x49, 0x64, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x46, 0x65, 0x61, 0x74, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x46, 0x65, 0x61, 0x74, 0x42, 0x79, 0x49, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x46, 0x65, 0x61, 0x74, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x20, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x74, 0x65, 0x78, 0x74, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x46, 0x65, 0x61, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x46, + 0x65, + 0x61, + 0x74, + 0x42, + 0x79, + 0x49, + 0x64, + 0x28, + 0x24, + 0x69, + 0x64, + 0x3a, + 0x20, + 0x55, + 0x55, + 0x49, + 0x44, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x66, + 0x65, + 0x61, + 0x74, + 0x73, + 0x28, + 0x77, + 0x68, + 0x65, + 0x72, + 0x65, + 0x3a, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x3a, + 0x20, + 0x7b, + 0x20, + 0x65, + 0x71, + 0x3a, + 0x20, + 0x24, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x74, + 0x65, + 0x6d, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x46, + 0x65, + 0x61, + 0x74, + 0x42, + 0x79, + 0x49, + 0x64, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x46, + 0x65, + 0x61, + 0x74, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x46, + 0x65, + 0x61, + 0x74, + 0x42, + 0x79, + 0x49, + 0x64, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x46, + 0x65, + 0x61, + 0x74, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6c, + 0x65, + 0x76, + 0x65, + 0x6c, + 0x20, + 0x73, + 0x70, + 0x65, + 0x63, + 0x69, + 0x61, + 0x6c, + 0x20, + 0x74, + 0x72, + 0x69, + 0x67, + 0x67, + 0x65, + 0x72, + 0x20, + 0x64, + 0x65, + 0x74, + 0x61, + 0x69, + 0x6c, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x74, + 0x65, + 0x78, + 0x74, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x46, + 0x65, + 0x61, + 0x74, + 0x44, + 0x65, + 0x74, + 0x61, + 0x69, + 0x6c, + 0x73, + 0x42, + 0x6c, + 0x6f, + 0x63, + 0x6b, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x61, + 0x63, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x41, + 0x63, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x54, + 0x79, + 0x70, + 0x65, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "9ebaff788b63cffe97932e6ad7792fa29e168e73"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -2544,6 +3359,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetFeatByIdResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Guid id, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(id); @@ -2678,19 +3494,12 @@ namespace Foo.Bar.State } public global::System.Guid Id { get; } - public global::System.String Name { get; } - public global::System.Int32 Level { get; } - public global::System.Boolean CanBeLearnedMoreThanOnce { get; } - public global::System.Collections.Generic.IReadOnlyList Details { get; } - public global::System.String? Special { get; } - public global::System.String? Trigger { get; } - public global::StrawberryShake.EntityId ActionType { get; } } @@ -2733,6 +3542,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetFeatsPageResult); + public GetFeatsPageResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -2845,9 +3655,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.FeatCollectionSegmentData? Feats { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetFeatsPageResultInfo(Feats, _entityIds, version); @@ -2871,6 +3681,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetFeatByIdResult); + public GetFeatByIdResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -2993,9 +3804,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.FeatCollectionSegmentData? Feats { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetFeatByIdResultInfo(Feats, _entityIds, version); @@ -3568,9 +4379,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Int32? TotalCount { get; } - public global::System.Collections.Generic.IReadOnlyList? Items { get; } } @@ -3752,7 +4561,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Query_With_Nested_Fragments.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Query_With_Nested_Fragments.snap index 7cd5e9eb8f0..8899638ec76 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Query_With_Nested_Fragments.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Query_With_Nested_Fragments.snap @@ -156,7 +156,6 @@ namespace Foo.Bar } public global::System.String ListingId { get; } - public global::System.Int32 StartingPrice { get; } public virtual global::System.Boolean Equals(GetAll_Listings_Items_Auction? other) @@ -222,7 +221,6 @@ namespace Foo.Bar } public global::System.String ListingId { get; } - public global::System.Int32 Price { get; } public virtual global::System.Boolean Equals(GetAll_Listings_Items_Offer? other) @@ -384,8 +382,306 @@ namespace Foo.Bar public static GetAllQueryDocument Instance { get; } = new GetAllQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x20, 0x7b, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x48, 0x61, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x48, 0x61, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x7b, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x20, 0x6f, 0x6e, 0x20, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x20, 0x7b, 0x20, 0x70, 0x72, 0x69, 0x63, 0x65, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7b, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x69, 0x63, 0x65, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x41, + 0x6c, + 0x6c, + 0x20, + 0x7b, + 0x20, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x73, + 0x50, + 0x61, + 0x79, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x73, + 0x50, + 0x61, + 0x79, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x73, + 0x50, + 0x61, + 0x79, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x74, + 0x65, + 0x6d, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x48, + 0x61, + 0x73, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x49, + 0x64, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x4f, + 0x66, + 0x66, + 0x65, + 0x72, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x41, + 0x75, + 0x63, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x48, + 0x61, + 0x73, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x49, + 0x64, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x20, + 0x7b, + 0x20, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x49, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x4f, + 0x66, + 0x66, + 0x65, + 0x72, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4f, + 0x66, + 0x66, + 0x65, + 0x72, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x72, + 0x69, + 0x63, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x41, + 0x75, + 0x63, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x41, + 0x75, + 0x63, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x74, + 0x61, + 0x72, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x50, + 0x72, + 0x69, + 0x63, + 0x65, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "c2ce13cb04932b7d4f0a3b22a6566fa34494b068"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -439,6 +735,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetAllResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -548,6 +845,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetAllResult); + public GetAllResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -643,9 +941,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.ListingsPayloadData Listings { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetAllResultInfo(Listings, _entityIds, version); @@ -792,7 +1090,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Collections.Generic.IReadOnlyList? Items { get; } } @@ -815,9 +1112,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? ListingId { get; } - public global::System.Int32? StartingPrice { get; } } @@ -833,9 +1128,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.String? ListingId { get; } - public global::System.Int32? Price { get; } } @@ -844,7 +1137,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Schema_With_Spec_Errors.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Schema_With_Spec_Errors.snap index a011051dc2d..43f3ad38d50 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Schema_With_Spec_Errors.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/SchemaGeneratorTests.Schema_With_Spec_Errors.snap @@ -204,8 +204,135 @@ namespace Foo.Bar public static GetListingsCountQueryDocument Instance { get; } = new GetListingsCountQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x7b, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x7b, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x73, + 0x43, + 0x6f, + 0x75, + 0x6e, + 0x74, + 0x20, + 0x7b, + 0x20, + 0x6c, + 0x69, + 0x73, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x73, + 0x50, + 0x61, + 0x79, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x73, + 0x50, + 0x61, + 0x79, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x4c, + 0x69, + 0x73, + 0x74, + 0x69, + 0x6e, + 0x67, + 0x73, + 0x50, + 0x61, + 0x79, + 0x6c, + 0x6f, + 0x61, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x63, + 0x6f, + 0x75, + 0x6e, + 0x74, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "c3a13333bd2282e2d7ed111b99934a7610014ba3"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -242,6 +369,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetListingsCountResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -334,6 +462,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetListingsCountResult); + public GetListingsCountResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -387,9 +516,9 @@ namespace Foo.Bar.State /// Vyhledávání mezi inzeráty /// public global::Foo.Bar.State.ListingsPayloadData Listings { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetListingsCountResultInfo(Listings, _entityIds, version); @@ -472,7 +601,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Int32? Count { get; } } @@ -481,7 +609,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Generate_Client_With_Internal_Access_Modifier.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Generate_Client_With_Internal_Access_Modifier.snap index 3f530d5621c..ad74b864f60 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Generate_Client_With_Internal_Access_Modifier.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Generate_Client_With_Internal_Access_Modifier.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Droid? other) @@ -170,7 +169,6 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Human? other) @@ -247,7 +245,6 @@ namespace Foo.Bar internal partial interface IGetHero_Hero { public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } } @@ -277,6 +274,7 @@ namespace Foo.Bar internal partial class EpisodeSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "Episode"; + public Episode Parse(global::System.String serializedValue) { return serializedValue switch @@ -326,8 +324,122 @@ namespace Foo.Bar public static GetHeroQueryDocument Instance { get; } = new GetHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x7b, 0x20, 0x68, 0x65, 0x72, 0x6f, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x4e, 0x45, 0x57, 0x5f, 0x48, 0x4f, 0x50, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x73, 0x49, 0x6e, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x68, + 0x65, + 0x72, + 0x6f, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x4e, + 0x45, + 0x57, + 0x5f, + 0x48, + 0x4f, + 0x50, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x61, + 0x70, + 0x70, + 0x65, + 0x61, + 0x72, + 0x73, + 0x49, + 0x6e, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "a0ab93285495bb156c6c436ef4b49a3922666647"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -367,6 +479,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -462,7 +575,6 @@ namespace Foo.Bar.State } public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } } @@ -477,7 +589,6 @@ namespace Foo.Bar.State } public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } } @@ -496,6 +607,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetHeroResult); + public GetHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -551,9 +663,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? Hero { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetHeroResultInfo(Hero, _entityIds, version); @@ -736,7 +848,9 @@ namespace Foo.Bar.State internal partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Generate_StarWarsIntegrationTest.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Generate_StarWarsIntegrationTest.snap index 2379ccc9226..3cb225d579f 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Generate_StarWarsIntegrationTest.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Generate_StarWarsIntegrationTest.snap @@ -326,8 +326,148 @@ namespace Foo.Bar public static CreateReviewMutationDocument Instance { get; } = new CreateReviewMutationDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Mutation; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x28, 0x24, 0x73, 0x74, 0x61, 0x72, 0x73, 0x3a, 0x20, 0x49, 0x6e, 0x74, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x45, 0x4d, 0x50, 0x49, 0x52, 0x45, 0x2c, 0x20, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x3a, 0x20, 0x7b, 0x20, 0x73, 0x74, 0x61, 0x72, 0x73, 0x3a, 0x20, 0x24, 0x73, 0x74, 0x61, 0x72, 0x73, 0x2c, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x3a, 0x20, 0x22, 0x67, 0x6f, 0x6f, 0x64, 0x22, 0x20, 0x7d, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x74, 0x61, 0x72, 0x73, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x6d, + 0x75, + 0x74, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x43, + 0x72, + 0x65, + 0x61, + 0x74, + 0x65, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x28, + 0x24, + 0x73, + 0x74, + 0x61, + 0x72, + 0x73, + 0x3a, + 0x20, + 0x49, + 0x6e, + 0x74, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x63, + 0x72, + 0x65, + 0x61, + 0x74, + 0x65, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x45, + 0x4d, + 0x50, + 0x49, + 0x52, + 0x45, + 0x2c, + 0x20, + 0x72, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x3a, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x74, + 0x61, + 0x72, + 0x73, + 0x3a, + 0x20, + 0x24, + 0x73, + 0x74, + 0x61, + 0x72, + 0x73, + 0x2c, + 0x20, + 0x63, + 0x6f, + 0x6d, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x61, + 0x72, + 0x79, + 0x3a, + 0x20, + 0x22, + 0x67, + 0x6f, + 0x6f, + 0x64, + 0x22, + 0x20, + 0x7d, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x74, + 0x61, + 0x72, + 0x73, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "409320ca8b7539016115e55a6bbeceeae0184bdf"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -362,6 +502,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ICreateReviewResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Int32 stars, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(stars); @@ -437,8 +578,83 @@ namespace Foo.Bar public static OnReviewSubscriptionDocument Instance { get; } = new OnReviewSubscriptionDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Subscription; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x20, 0x7b, 0x20, 0x6f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x45, 0x4d, 0x50, 0x49, 0x52, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x74, 0x61, 0x72, 0x73, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x73, + 0x75, + 0x62, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x4f, + 0x6e, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x20, + 0x7b, + 0x20, + 0x6f, + 0x6e, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x45, + 0x4d, + 0x50, + 0x49, + 0x52, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x74, + 0x61, + 0x72, + 0x73, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "57bd8aa0a7a43840c2b938fb5b484014327cf406"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -471,6 +687,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IOnReviewResult); + public global::System.IObservable> Watch(global::StrawberryShake.ExecutionStrategy? strategy = null) { var request = CreateRequest(); @@ -557,6 +774,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ICreateReviewResult); + public CreateReviewResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -607,9 +825,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.ReviewData CreateReview { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new CreateReviewResultInfo(CreateReview, _entityIds, version); @@ -627,6 +845,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IOnReviewResult); + public OnReviewResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -677,9 +896,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.ReviewData OnReview { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new OnReviewResultInfo(OnReview, _entityIds, version); @@ -827,7 +1046,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Int32? Stars { get; } } @@ -836,7 +1054,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Interface_With_Default_Names.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Interface_With_Default_Names.snap index 83a9b304cc9..2ff4ceef1fa 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Interface_With_Default_Names.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Interface_With_Default_Names.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Droid? other) @@ -170,7 +169,6 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Human? other) @@ -247,7 +245,6 @@ namespace Foo.Bar public partial interface IGetHero_Hero { public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } } @@ -277,6 +274,7 @@ namespace Foo.Bar public partial class EpisodeSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "Episode"; + public Episode Parse(global::System.String serializedValue) { return serializedValue switch @@ -326,8 +324,122 @@ namespace Foo.Bar public static GetHeroQueryDocument Instance { get; } = new GetHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x7b, 0x20, 0x68, 0x65, 0x72, 0x6f, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x4e, 0x45, 0x57, 0x5f, 0x48, 0x4f, 0x50, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x73, 0x49, 0x6e, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x68, + 0x65, + 0x72, + 0x6f, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x4e, + 0x45, + 0x57, + 0x5f, + 0x48, + 0x4f, + 0x50, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x61, + 0x70, + 0x70, + 0x65, + 0x61, + 0x72, + 0x73, + 0x49, + 0x6e, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "a0ab93285495bb156c6c436ef4b49a3922666647"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -367,6 +479,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -462,7 +575,6 @@ namespace Foo.Bar.State } public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } } @@ -477,7 +589,6 @@ namespace Foo.Bar.State } public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } } @@ -496,6 +607,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetHeroResult); + public GetHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -551,9 +663,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? Hero { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetHeroResultInfo(Hero, _entityIds, version); @@ -736,7 +848,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Interface_With_Fragment_Definition_Two_Models.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Interface_With_Fragment_Definition_Two_Models.snap index 505cfb3ccf2..25a856f0b08 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Interface_With_Fragment_Definition_Two_Models.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Interface_With_Fragment_Definition_Two_Models.snap @@ -95,9 +95,7 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.String? PrimaryFunction { get; } - public global::Foo.Bar.IGetHero_Hero_Friends? Friends { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Droid? other) @@ -173,9 +171,7 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.String? HomePlanet { get; } - public global::Foo.Bar.IGetHero_Hero_Friends? Friends { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Human? other) @@ -453,7 +449,6 @@ namespace Foo.Bar public partial interface IHero { public global::System.String Name { get; } - public global::Foo.Bar.IGetHero_Hero_Friends? Friends { get; } } @@ -475,7 +470,6 @@ namespace Foo.Bar public partial interface IHero_Droid : IDroid { public global::System.String Name { get; } - public global::Foo.Bar.IGetHero_Hero_Friends? Friends { get; } } @@ -497,7 +491,6 @@ namespace Foo.Bar public partial interface IHero_Human : IHuman { public global::System.String Name { get; } - public global::Foo.Bar.IGetHero_Hero_Friends? Friends { get; } } @@ -602,8 +595,344 @@ namespace Foo.Bar public static GetHeroQueryDocument Instance { get; } = new GetHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x7b, 0x20, 0x68, 0x65, 0x72, 0x6f, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x4e, 0x45, 0x57, 0x5f, 0x48, 0x4f, 0x50, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x6f, 0x6e, 0x20, 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x68, 0x6f, 0x6d, 0x65, 0x50, 0x6c, 0x61, 0x6e, 0x65, 0x74, 0x20, 0x7d, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x68, + 0x65, + 0x72, + 0x6f, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x4e, + 0x45, + 0x57, + 0x5f, + 0x48, + 0x4f, + 0x50, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x43, + 0x68, + 0x61, + 0x72, + 0x61, + 0x63, + 0x74, + 0x65, + 0x72, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x66, + 0x72, + 0x69, + 0x65, + 0x6e, + 0x64, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x6f, + 0x64, + 0x65, + 0x73, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x68, + 0x6f, + 0x6d, + 0x65, + 0x50, + 0x6c, + 0x61, + 0x6e, + 0x65, + 0x74, + 0x20, + 0x7d, + 0x20, + 0x66, + 0x72, + 0x61, + 0x67, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x70, + 0x72, + 0x69, + 0x6d, + 0x61, + 0x72, + 0x79, + 0x46, + 0x75, + 0x6e, + 0x63, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "180df66e91f5da244f1c1775dfec073d435d8faf"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -669,6 +998,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -791,9 +1121,7 @@ namespace Foo.Bar.State } public global::System.String Name { get; } - public global::System.String? PrimaryFunction { get; } - public global::Foo.Bar.State.FriendsConnectionData? Friends { get; } } @@ -809,9 +1137,7 @@ namespace Foo.Bar.State } public global::System.String Name { get; } - public global::System.String? HomePlanet { get; } - public global::Foo.Bar.State.FriendsConnectionData? Friends { get; } } @@ -830,6 +1156,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetHeroResult); + public GetHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -885,9 +1212,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? Hero { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetHeroResultInfo(Hero, _entityIds, version); @@ -1099,7 +1426,6 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - ///A flattened list of the nodes. public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } } @@ -1313,7 +1639,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Operation_With_Leaf_Argument.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Operation_With_Leaf_Argument.snap index 119ab71febe..6687381835d 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Operation_With_Leaf_Argument.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Operation_With_Leaf_Argument.snap @@ -94,7 +94,6 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Droid? other) @@ -170,7 +169,6 @@ namespace Foo.Bar } public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } public virtual global::System.Boolean Equals(GetHero_Hero_Human? other) @@ -247,7 +245,6 @@ namespace Foo.Bar public partial interface IGetHero_Hero { public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } } @@ -277,6 +274,7 @@ namespace Foo.Bar public partial class EpisodeSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "Episode"; + public Episode Parse(global::System.String serializedValue) { return serializedValue switch @@ -326,8 +324,141 @@ namespace Foo.Bar public static GetHeroQueryDocument Instance { get; } = new GetHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x48, 0x65, 0x72, 0x6f, 0x28, 0x24, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x45, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x29, 0x20, 0x7b, 0x20, 0x68, 0x65, 0x72, 0x6f, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x24, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x73, 0x49, 0x6e, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x28, + 0x24, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x45, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x68, + 0x65, + 0x72, + 0x6f, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x61, + 0x70, + 0x70, + 0x65, + 0x61, + 0x72, + 0x73, + 0x49, + 0x6e, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "d241b83259d20fe706e2aa7c38e6171fe3ccae44"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -369,6 +500,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.Episode? episode, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(episode); @@ -478,7 +610,6 @@ namespace Foo.Bar.State } public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } } @@ -493,7 +624,6 @@ namespace Foo.Bar.State } public global::System.String Name { get; } - public global::System.Collections.Generic.IReadOnlyList? AppearsIn { get; } } @@ -512,6 +642,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetHeroResult); + public GetHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -567,9 +698,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? Hero { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetHeroResultInfo(Hero, _entityIds, version); @@ -752,7 +883,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Operation_With_Type_Argument.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Operation_With_Type_Argument.snap index c6b59091960..54c88e2a60a 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Operation_With_Type_Argument.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Operation_With_Type_Argument.snap @@ -90,7 +90,6 @@ namespace Foo.Bar } public global::System.Int32 Stars { get; } - public global::System.String? Commentary { get; } public virtual global::System.Boolean Equals(CreateReviewMut_CreateReview_Review? other) @@ -161,7 +160,6 @@ namespace Foo.Bar public partial interface ICreateReviewMut_CreateReview { public global::System.Int32 Stars { get; } - public global::System.String? Commentary { get; } } @@ -178,6 +176,7 @@ namespace Foo.Bar private global::StrawberryShake.Serialization.IInputValueFormatter _intFormatter = default !; private global::StrawberryShake.Serialization.IInputValueFormatter _stringFormatter = default !; public global::System.String TypeName => "ReviewInput"; + public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _intFormatter = serializerResolver.GetInputValueFormatter("Int"); @@ -304,6 +303,7 @@ namespace Foo.Bar } global::System.Boolean global::Foo.Bar.State.IReviewInputInfo.IsStarsSet => _set_stars; + public global::System.String? Commentary { get => _value_commentary; @@ -331,6 +331,7 @@ namespace Foo.Bar public partial class EpisodeSerializer : global::StrawberryShake.Serialization.IInputValueFormatter, global::StrawberryShake.Serialization.ILeafValueParser { public global::System.String TypeName => "Episode"; + public Episode Parse(global::System.String serializedValue) { return serializedValue switch @@ -374,8 +375,163 @@ namespace Foo.Bar public static CreateReviewMutMutationDocument Instance { get; } = new CreateReviewMutMutationDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Mutation; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x4d, 0x75, 0x74, 0x28, 0x24, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x45, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x21, 0x2c, 0x20, 0x24, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x3a, 0x20, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x24, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x3a, 0x20, 0x24, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x74, 0x61, 0x72, 0x73, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x6d, + 0x75, + 0x74, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x43, + 0x72, + 0x65, + 0x61, + 0x74, + 0x65, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x4d, + 0x75, + 0x74, + 0x28, + 0x24, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x45, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x72, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x3a, + 0x20, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x49, + 0x6e, + 0x70, + 0x75, + 0x74, + 0x21, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x63, + 0x72, + 0x65, + 0x61, + 0x74, + 0x65, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x24, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x2c, + 0x20, + 0x72, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x3a, + 0x20, + 0x24, + 0x72, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x74, + 0x61, + 0x72, + 0x73, + 0x20, + 0x63, + 0x6f, + 0x6d, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x61, + 0x72, + 0x79, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "7b7488dce3bce5700fe4fab0d349728a5121c153"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -413,6 +569,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ICreateReviewMutResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::Foo.Bar.Episode episode, global::Foo.Bar.ReviewInput review, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(episode, review); @@ -520,6 +677,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ICreateReviewMutResult); + public CreateReviewMutResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -570,9 +728,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.ReviewData CreateReview { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new CreateReviewMutResultInfo(CreateReview, _entityIds, version); @@ -684,9 +842,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Int32? Stars { get; } - public global::System.String? Commentary { get; } } @@ -695,7 +851,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.StarWarsTypeNameOnUnions.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.StarWarsTypeNameOnUnions.snap index 7c934106e58..b482efa3a73 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.StarWarsTypeNameOnUnions.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.StarWarsTypeNameOnUnions.snap @@ -345,8 +345,127 @@ namespace Foo.Bar public static SearchHeroQueryDocument Instance { get; } = new SearchHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x28, 0x74, 0x65, 0x78, 0x74, 0x3a, 0x20, 0x22, 0x6c, 0x22, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x72, 0x73, 0x68, 0x69, 0x70, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x53, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x28, + 0x74, + 0x65, + 0x78, + 0x74, + 0x3a, + 0x20, + 0x22, + 0x6c, + 0x22, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x53, + 0x74, + 0x61, + 0x72, + 0x73, + 0x68, + 0x69, + 0x70, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "e2347e3fc516d7742122125fa68a1aca286f128c"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -387,6 +506,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ISearchHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -528,6 +648,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ISearchHeroResult); + public SearchHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -604,9 +725,9 @@ namespace Foo.Bar.State } public global::System.Collections.Generic.IReadOnlyList? Search { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new SearchHeroResultInfo(Search, _entityIds, version); @@ -807,7 +928,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.StarWarsUnionList.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.StarWarsUnionList.snap index e6d803a307d..423c405bf4e 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.StarWarsUnionList.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.StarWarsUnionList.snap @@ -339,8 +339,171 @@ namespace Foo.Bar public static SearchHeroQueryDocument Instance { get; } = new SearchHeroQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x48, 0x65, 0x72, 0x6f, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x28, 0x74, 0x65, 0x78, 0x74, 0x3a, 0x20, 0x22, 0x6c, 0x22, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x72, 0x73, 0x68, 0x69, 0x70, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x53, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x48, + 0x65, + 0x72, + 0x6f, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x65, + 0x61, + 0x72, + 0x63, + 0x68, + 0x28, + 0x74, + 0x65, + 0x78, + 0x74, + 0x3a, + 0x20, + 0x22, + 0x6c, + 0x22, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x53, + 0x74, + 0x61, + 0x72, + 0x73, + 0x68, + 0x69, + 0x70, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x48, + 0x75, + 0x6d, + 0x61, + 0x6e, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x44, + 0x72, + 0x6f, + 0x69, + 0x64, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "ff8a1467e05c6c19bce649705a6bb53957883a86"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -387,6 +550,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ISearchHeroResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(); @@ -525,6 +689,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ISearchHeroResult); + public SearchHeroResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -601,9 +766,9 @@ namespace Foo.Bar.State } public global::System.Collections.Generic.IReadOnlyList? Search { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new SearchHeroResultInfo(Search, _entityIds, version); @@ -804,7 +969,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Subscription_With_Default_Names.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Subscription_With_Default_Names.snap index d831bac2230..d8181989937 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Subscription_With_Default_Names.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/__snapshots__/StarWarsGeneratorTests.Subscription_With_Default_Names.snap @@ -90,7 +90,6 @@ namespace Foo.Bar } public global::System.Int32 Stars { get; } - public global::System.String? Commentary { get; } public virtual global::System.Boolean Equals(OnReviewSub_OnReview_Review? other) @@ -161,7 +160,6 @@ namespace Foo.Bar public partial interface IOnReviewSub_OnReview { public global::System.Int32 Stars { get; } - public global::System.String? Commentary { get; } } @@ -193,8 +191,99 @@ namespace Foo.Bar public static OnReviewSubSubscriptionDocument Instance { get; } = new OnReviewSubSubscriptionDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Subscription; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x20, 0x7b, 0x20, 0x6f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x28, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x3a, 0x20, 0x4e, 0x45, 0x57, 0x5f, 0x48, 0x4f, 0x50, 0x45, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x74, 0x61, 0x72, 0x73, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x73, + 0x75, + 0x62, + 0x73, + 0x63, + 0x72, + 0x69, + 0x70, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x4f, + 0x6e, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x53, + 0x75, + 0x62, + 0x20, + 0x7b, + 0x20, + 0x6f, + 0x6e, + 0x52, + 0x65, + 0x76, + 0x69, + 0x65, + 0x77, + 0x28, + 0x65, + 0x70, + 0x69, + 0x73, + 0x6f, + 0x64, + 0x65, + 0x3a, + 0x20, + 0x4e, + 0x45, + 0x57, + 0x5f, + 0x48, + 0x4f, + 0x50, + 0x45, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x73, + 0x74, + 0x61, + 0x72, + 0x73, + 0x20, + 0x63, + 0x6f, + 0x6d, + 0x6d, + 0x65, + 0x6e, + 0x74, + 0x61, + 0x72, + 0x79, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "92220fce37342d7ade3d63a2a81342eb1fb14bac"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -228,6 +317,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IOnReviewSubResult); + public global::System.IObservable> Watch(global::StrawberryShake.ExecutionStrategy? strategy = null) { var request = CreateRequest(); @@ -310,6 +400,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IOnReviewSubResult); + public OnReviewSubResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -360,9 +451,9 @@ namespace Foo.Bar.State } public global::Foo.Bar.State.ReviewData OnReview { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new OnReviewSubResultInfo(OnReview, _entityIds, version); @@ -463,9 +554,7 @@ namespace Foo.Bar.State } public global::System.String __typename { get; } - public global::System.Int32? Stars { get; } - public global::System.String? Commentary { get; } } @@ -474,7 +563,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; diff --git a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.Razor.Tests/__snapshots__/RazorGeneratorTests.Query_And_Mutation.snap b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.Razor.Tests/__snapshots__/RazorGeneratorTests.Query_And_Mutation.snap index 07a8d37b3bd..56f9e28f11f 100644 --- a/src/StrawberryShake/CodeGeneration/test/CodeGeneration.Razor.Tests/__snapshots__/RazorGeneratorTests.Query_And_Mutation.snap +++ b/src/StrawberryShake/CodeGeneration/test/CodeGeneration.Razor.Tests/__snapshots__/RazorGeneratorTests.Query_And_Mutation.snap @@ -100,7 +100,6 @@ namespace Foo.Bar } public global::System.String Id { get; } - public global::System.String? Name { get; } public virtual global::System.Boolean Equals(GetBars_Bars_Bar? other) @@ -171,7 +170,6 @@ namespace Foo.Bar public partial interface IGetBars_Bars { public global::System.String Id { get; } - public global::System.String? Name { get; } } @@ -258,7 +256,6 @@ namespace Foo.Bar } public global::System.String Id { get; } - public global::System.String? Name { get; } public virtual global::System.Boolean Equals(SaveBars_SaveBar_Bar? other) @@ -329,7 +326,6 @@ namespace Foo.Bar public partial interface ISaveBars_SaveBar { public global::System.String Id { get; } - public global::System.String? Name { get; } } @@ -364,8 +360,113 @@ namespace Foo.Bar public static GetBarsQueryDocument Instance { get; } = new GetBarsQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x47, 0x65, 0x74, 0x42, 0x61, 0x72, 0x73, 0x28, 0x24, 0x61, 0x3a, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x21, 0x2c, 0x20, 0x24, 0x62, 0x3a, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x29, 0x20, 0x7b, 0x20, 0x62, 0x61, 0x72, 0x73, 0x28, 0x61, 0x3a, 0x20, 0x24, 0x61, 0x2c, 0x20, 0x62, 0x3a, 0x20, 0x24, 0x62, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x72, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x71, + 0x75, + 0x65, + 0x72, + 0x79, + 0x20, + 0x47, + 0x65, + 0x74, + 0x42, + 0x61, + 0x72, + 0x73, + 0x28, + 0x24, + 0x61, + 0x3a, + 0x20, + 0x53, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x62, + 0x3a, + 0x20, + 0x53, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x62, + 0x61, + 0x72, + 0x73, + 0x28, + 0x61, + 0x3a, + 0x20, + 0x24, + 0x61, + 0x2c, + 0x20, + 0x62, + 0x3a, + 0x20, + 0x24, + 0x62, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x64, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x72, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "d77fc7854088f9716b48874b752a2d2b8be41aef"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -404,6 +505,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetBarsResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.String a, global::System.String? b, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(a, b); @@ -505,8 +607,120 @@ namespace Foo.Bar public static SaveBarsMutationDocument Instance { get; } = new SaveBarsMutationDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Mutation; - public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x61, 0x76, 0x65, 0x42, 0x61, 0x72, 0x73, 0x28, 0x24, 0x61, 0x3a, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x21, 0x2c, 0x20, 0x24, 0x62, 0x3a, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x29, 0x20, 0x7b, 0x20, 0x73, 0x61, 0x76, 0x65, 0x42, 0x61, 0x72, 0x28, 0x61, 0x3a, 0x20, 0x24, 0x61, 0x2c, 0x20, 0x62, 0x3a, 0x20, 0x24, 0x62, 0x29, 0x20, 0x7b, 0x20, 0x5f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x72, 0x20, 0x7b, 0x20, 0x69, 0x64, 0x20, 0x7d, 0x20, 0x7d, 0x20, 0x7d}; + public global::System.ReadOnlySpan Body => new global::System.Byte[] + { + 0x6d, + 0x75, + 0x74, + 0x61, + 0x74, + 0x69, + 0x6f, + 0x6e, + 0x20, + 0x53, + 0x61, + 0x76, + 0x65, + 0x42, + 0x61, + 0x72, + 0x73, + 0x28, + 0x24, + 0x61, + 0x3a, + 0x20, + 0x53, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x21, + 0x2c, + 0x20, + 0x24, + 0x62, + 0x3a, + 0x20, + 0x53, + 0x74, + 0x72, + 0x69, + 0x6e, + 0x67, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x73, + 0x61, + 0x76, + 0x65, + 0x42, + 0x61, + 0x72, + 0x28, + 0x61, + 0x3a, + 0x20, + 0x24, + 0x61, + 0x2c, + 0x20, + 0x62, + 0x3a, + 0x20, + 0x24, + 0x62, + 0x29, + 0x20, + 0x7b, + 0x20, + 0x5f, + 0x5f, + 0x74, + 0x79, + 0x70, + 0x65, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x69, + 0x64, + 0x20, + 0x6e, + 0x61, + 0x6d, + 0x65, + 0x20, + 0x2e, + 0x2e, + 0x2e, + 0x20, + 0x6f, + 0x6e, + 0x20, + 0x42, + 0x61, + 0x72, + 0x20, + 0x7b, + 0x20, + 0x69, + 0x64, + 0x20, + 0x7d, + 0x20, + 0x7d, + 0x20, + 0x7d + }; public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "46ced9034dad969a5b30d75b8a91366be7ad75b5"); + public override global::System.String ToString() { #if NETCOREAPP3_1_OR_GREATER @@ -545,6 +759,7 @@ namespace Foo.Bar } global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ISaveBarsResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.String a, global::System.String? b, global::System.Threading.CancellationToken cancellationToken = default) { var request = CreateRequest(a, b); @@ -667,7 +882,6 @@ namespace Foo.Bar.State } public global::System.String Id { get; } - public global::System.String? Name { get; } } @@ -684,6 +898,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.IGetBarsResult); + public GetBarsResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -750,9 +965,9 @@ namespace Foo.Bar.State } public global::System.Collections.Generic.IReadOnlyList? Bars { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new GetBarsResultInfo(Bars, _entityIds, version); @@ -772,6 +987,7 @@ namespace Foo.Bar.State } global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Foo.Bar.ISaveBarsResult); + public SaveBarsResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -822,9 +1038,9 @@ namespace Foo.Bar.State } public global::StrawberryShake.EntityId? SaveBar { get; } - public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) { return new SaveBarsResultInfo(SaveBar, _entityIds, version); @@ -1083,7 +1299,9 @@ namespace Foo.Bar.State public partial class FooClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer { private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions() - {Indented = false}; + { + Indented = false + }; public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj) { global::System.String __typename = obj.GetProperty("__typename").GetString()!; @@ -1240,8 +1458,10 @@ namespace Foo.Bar.Components { [global::Microsoft.AspNetCore.Components.InjectAttribute] internal global::Foo.Bar.GetBarsQuery Operation { get; set; } = default !; + [global::Microsoft.AspNetCore.Components.ParameterAttribute] public global::System.String A { get; set; } = default !; + [global::Microsoft.AspNetCore.Components.ParameterAttribute] public global::System.String? B { get; set; } diff --git a/src/StrawberryShake/CodeGeneration/test/Directory.Build.props b/src/StrawberryShake/CodeGeneration/test/Directory.Build.props index 6895eafc3bc..895e450bc18 100644 --- a/src/StrawberryShake/CodeGeneration/test/Directory.Build.props +++ b/src/StrawberryShake/CodeGeneration/test/Directory.Build.props @@ -2,7 +2,6 @@ - $(TestTargetFrameworks) false false diff --git a/src/StrawberryShake/Directory.Build.props b/src/StrawberryShake/Directory.Build.props index 5a4f40302f5..7ba478b9969 100644 --- a/src/StrawberryShake/Directory.Build.props +++ b/src/StrawberryShake/Directory.Build.props @@ -7,9 +7,4 @@ strawberryshake-signet.png - - net8.0; net7.0; net6.0; netstandard2.1; netstandard2.0 - net8.0; net7.0; net6.0 - - diff --git a/src/StrawberryShake/MetaPackages/Blazor/StrawberryShake.Blazor.csproj b/src/StrawberryShake/MetaPackages/Blazor/StrawberryShake.Blazor.csproj index af5ea7560f6..12d5d27e29e 100644 --- a/src/StrawberryShake/MetaPackages/Blazor/StrawberryShake.Blazor.csproj +++ b/src/StrawberryShake/MetaPackages/Blazor/StrawberryShake.Blazor.csproj @@ -24,8 +24,6 @@ - - diff --git a/src/StrawberryShake/MetaPackages/Common/MSBuild/StrawberryShake.targets b/src/StrawberryShake/MetaPackages/Common/MSBuild/StrawberryShake.targets index 92d006a20a1..14591f2c621 100644 --- a/src/StrawberryShake/MetaPackages/Common/MSBuild/StrawberryShake.targets +++ b/src/StrawberryShake/MetaPackages/Common/MSBuild/StrawberryShake.targets @@ -39,20 +39,18 @@ Condition="'@(GraphQL)' != ''"> - 6 - 7 8 + 9 + Text="The Strawberry Shake code generation requires .NET SDK 8 or .NET SDK 9 to work." + Condition="'$(DotNetMajor)' != '8' AND '$(DotNetMajor)' != '9'" /> $(MSBuildProjectDirectory)\$(GraphQLPersistedOperationOutput.TrimEnd('/').TrimEnd('\')) - $([System.IO.Path]::Combine($(MSBuildThisFileDirectory), "..", "tools", "net6", "dotnet-graphql.dll")) - $([System.IO.Path]::Combine($(MSBuildThisFileDirectory), "..", "tools", "net7", "dotnet-graphql.dll")) $([System.IO.Path]::Combine($(MSBuildThisFileDirectory), "..", "tools", "net8", "dotnet-graphql.dll")) + $([System.IO.Path]::Combine($(MSBuildThisFileDirectory), "..", "tools", "net9", "dotnet-graphql.dll")) diff --git a/src/StrawberryShake/MetaPackages/Directory.Build.props b/src/StrawberryShake/MetaPackages/Directory.Build.props index b2a47c25ad7..c6b2da658ca 100644 --- a/src/StrawberryShake/MetaPackages/Directory.Build.props +++ b/src/StrawberryShake/MetaPackages/Directory.Build.props @@ -2,7 +2,6 @@ - $(Library2TargetFrameworks) $(NoWarn);CA1812 diff --git a/src/StrawberryShake/MetaPackages/Maui/StrawberryShake.Maui.csproj b/src/StrawberryShake/MetaPackages/Maui/StrawberryShake.Maui.csproj index bab3fbdc187..e3fd85cc910 100644 --- a/src/StrawberryShake/MetaPackages/Maui/StrawberryShake.Maui.csproj +++ b/src/StrawberryShake/MetaPackages/Maui/StrawberryShake.Maui.csproj @@ -23,8 +23,6 @@ - - diff --git a/src/StrawberryShake/MetaPackages/Server/StrawberryShake.Server.csproj b/src/StrawberryShake/MetaPackages/Server/StrawberryShake.Server.csproj index 4db0fcbd403..95ce1f4045b 100644 --- a/src/StrawberryShake/MetaPackages/Server/StrawberryShake.Server.csproj +++ b/src/StrawberryShake/MetaPackages/Server/StrawberryShake.Server.csproj @@ -23,8 +23,6 @@ - - diff --git a/src/StrawberryShake/Tooling/.vscode/launch.json b/src/StrawberryShake/Tooling/.vscode/launch.json deleted file mode 100644 index 58443c07c51..00000000000 --- a/src/StrawberryShake/Tooling/.vscode/launch.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": ".NET Core Launch (console)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - "program": "${workspaceFolder}/src/dotnet-graphql/bin/Debug/net7.0/dotnet-graphql.dll", - "args": [ - "generate", - "/Users/michael/local/play/StrawberryTest", - "-o /Users/michael/local/play/StrawberryTest/obj/Debug/net7.0/berry/", - "-q /Users/michael/local/play/StrawberryTest/default", - "-n StrawberryBuildTests", - "-a md5", - //"--relayFormat" - ], - "cwd": "${workspaceFolder}/src/dotnet-graphql", - "console": "internalConsole", - "stopAtEntry": false - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach", - "processId": "${command:pickProcess}" - } - ] -} diff --git a/src/StrawberryShake/Tooling/.vscode/tasks.json b/src/StrawberryShake/Tooling/.vscode/tasks.json deleted file mode 100644 index 4c82f9671e0..00000000000 --- a/src/StrawberryShake/Tooling/.vscode/tasks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "shell", - "args": [ - "build", - // Ask dotnet build to generate full paths for file names. - "/property:GenerateFullPaths=true", - // Do not generate summary otherwise it leads to duplicate errors in Problems panel - "/consoleloggerparameters:NoSummary" - ], - "group": "build", - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - } - ] -} diff --git a/src/StrawberryShake/Tooling/Directory.Build.props b/src/StrawberryShake/Tooling/Directory.Build.props index 04b9ed6eb0b..ea6e2bc3aaf 100644 --- a/src/StrawberryShake/Tooling/Directory.Build.props +++ b/src/StrawberryShake/Tooling/Directory.Build.props @@ -1,8 +1,4 @@ - - $(ToolingTargetFrameworks) - - diff --git a/src/StrawberryShake/Tooling/src/Configuration/StrawberryShake.Tools.Configuration.csproj b/src/StrawberryShake/Tooling/src/Configuration/StrawberryShake.Tools.Configuration.csproj index af9dce1f46d..0436cd806da 100644 --- a/src/StrawberryShake/Tooling/src/Configuration/StrawberryShake.Tools.Configuration.csproj +++ b/src/StrawberryShake/Tooling/src/Configuration/StrawberryShake.Tools.Configuration.csproj @@ -1,7 +1,6 @@ - $(LibraryTargetFrameworks) StrawberryShake.Tools.Configuration diff --git a/src/StrawberryShake/Tooling/src/dotnet-graphql/JsonConsoleOutputCommand.cs b/src/StrawberryShake/Tooling/src/dotnet-graphql/JsonConsoleOutputCommand.cs index 82565ad790b..dd10c9bbfa0 100644 --- a/src/StrawberryShake/Tooling/src/dotnet-graphql/JsonConsoleOutputCommand.cs +++ b/src/StrawberryShake/Tooling/src/dotnet-graphql/JsonConsoleOutputCommand.cs @@ -16,11 +16,7 @@ public void Dispose() { var json = JsonSerializer.Serialize(_data, new JsonSerializerOptions { -#if NET5_0_OR_GREATER DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, -#else - IgnoreNullValues = true, -#endif IgnoreReadOnlyProperties = false, }); Console.WriteLine(json); diff --git a/templates/StarWars/content/StarWars.csproj b/templates/StarWars/content/StarWars.csproj index ea59d979c2e..31099a0e841 100644 --- a/templates/StarWars/content/StarWars.csproj +++ b/templates/StarWars/content/StarWars.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 enable diff --git a/templates/v12/function-isolated/.template.config/template.json b/templates/v12/function-isolated/.template.config/template.json index 346765e515d..4308bc64026 100644 --- a/templates/v12/function-isolated/.template.config/template.json +++ b/templates/v12/function-isolated/.template.config/template.json @@ -20,12 +20,16 @@ "datatype": "choice", "choices": [ { - "choice": "net6.0", - "description": "Target .NET 6" + "choice": "net8.0", + "description": "Target .NET 8" + }, + { + "choice": "net9.0", + "description": "Target .NET 9" } ], - "replaces": "net6.0", - "defaultValue": "net6.0" + "replaces": "net8.0", + "defaultValue": "net8.0" } }, "postActions": [ diff --git a/templates/v12/function-isolated/HotChocolate.Template.AzureFunctions.Isolated.csproj b/templates/v12/function-isolated/HotChocolate.Template.AzureFunctions.Isolated.csproj index efa15e739cc..3ce4b9eabb3 100644 --- a/templates/v12/function-isolated/HotChocolate.Template.AzureFunctions.Isolated.csproj +++ b/templates/v12/function-isolated/HotChocolate.Template.AzureFunctions.Isolated.csproj @@ -1,6 +1,6 @@ - net6.0 + net8.0 v4 Exe enable @@ -15,9 +15,9 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/templates/v12/function-isolated/local.settings.json b/templates/v12/function-isolated/local.settings.json index 9803d637f40..e480517cfe5 100644 --- a/templates/v12/function-isolated/local.settings.json +++ b/templates/v12/function-isolated/local.settings.json @@ -1,7 +1,6 @@ -{ - "IsEncrypted": false, - "Values": { - "AzureWebJobsStorage": "UseDevelopmentStorage=true", - "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated" - } +{ + "IsEncrypted": false, + "Values": { + "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated" + } } \ No newline at end of file diff --git a/templates/v12/function/.template.config/template.json b/templates/v12/function/.template.config/template.json index a65146d974d..5947f69931b 100644 --- a/templates/v12/function/.template.config/template.json +++ b/templates/v12/function/.template.config/template.json @@ -20,12 +20,16 @@ "datatype": "choice", "choices": [ { - "choice": "net6.0", - "description": "Target .NET 6" + "choice": "net8.0", + "description": "Target .NET 8" + }, + { + "choice": "net9.0", + "description": "Target .NET 9" } ], - "replaces": "net6.0", - "defaultValue": "net6.0" + "replaces": "net8.0", + "defaultValue": "net8.0" } }, "postActions": [ diff --git a/templates/v12/gateway-aspire/.template.config/template.json b/templates/v12/gateway-aspire/.template.config/template.json index 657a069d55f..b5b420074be 100644 --- a/templates/v12/gateway-aspire/.template.config/template.json +++ b/templates/v12/gateway-aspire/.template.config/template.json @@ -19,16 +19,16 @@ "description": "The target framework for the project.", "datatype": "choice", "choices": [ - { - "choice": "net7.0", - "description": "Target .NET 7" - }, { "choice": "net8.0", "description": "Target .NET 8" + }, + { + "choice": "net9.0", + "description": "Target .NET 9" } ], - "replaces": "net7.0", + "replaces": "net8.0", "defaultValue": "net8.0" } }, diff --git a/templates/v12/gateway-aspire/.vscode/tasks.json b/templates/v12/gateway-aspire/.vscode/tasks.json deleted file mode 100644 index 31c32bd3457..00000000000 --- a/templates/v12/gateway-aspire/.vscode/tasks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "shell", - "args": [ - "build", - // Ask dotnet build to generate full paths for file names. - "/property:GenerateFullPaths=true", - // Do not generate summary otherwise it leads to duplicate errors in Problems panel - "/consoleloggerparameters:NoSummary" - ], - "group": "build", - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/templates/v12/gateway-aspire/HotChocolate.Template.Gateway.Aspire.csproj b/templates/v12/gateway-aspire/HotChocolate.Template.Gateway.Aspire.csproj index 16b01acc902..a51a366bc5c 100644 --- a/templates/v12/gateway-aspire/HotChocolate.Template.Gateway.Aspire.csproj +++ b/templates/v12/gateway-aspire/HotChocolate.Template.Gateway.Aspire.csproj @@ -1,14 +1,14 @@ - net7.0 + net8.0 enable enable Gateway - + diff --git a/templates/v12/gateway-bcp/.template.config/template.json b/templates/v12/gateway-bcp/.template.config/template.json index 8c0477fa567..c1b186013e7 100644 --- a/templates/v12/gateway-bcp/.template.config/template.json +++ b/templates/v12/gateway-bcp/.template.config/template.json @@ -19,16 +19,16 @@ "description": "The target framework for the project.", "datatype": "choice", "choices": [ - { - "choice": "net7.0", - "description": "Target .NET 7" - }, { "choice": "net8.0", "description": "Target .NET 8" + }, + { + "choice": "net9.0", + "description": "Target .NET 9" } ], - "replaces": "net7.0", + "replaces": "net8.0", "defaultValue": "net8.0" } }, diff --git a/templates/v12/gateway-bcp/.vscode/tasks.json b/templates/v12/gateway-bcp/.vscode/tasks.json deleted file mode 100644 index 31c32bd3457..00000000000 --- a/templates/v12/gateway-bcp/.vscode/tasks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "shell", - "args": [ - "build", - // Ask dotnet build to generate full paths for file names. - "/property:GenerateFullPaths=true", - // Do not generate summary otherwise it leads to duplicate errors in Problems panel - "/consoleloggerparameters:NoSummary" - ], - "group": "build", - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/templates/v12/gateway-bcp/HotChocolate.Template.Gateway.Managed.csproj b/templates/v12/gateway-bcp/HotChocolate.Template.Gateway.Managed.csproj index 16b01acc902..a51a366bc5c 100644 --- a/templates/v12/gateway-bcp/HotChocolate.Template.Gateway.Managed.csproj +++ b/templates/v12/gateway-bcp/HotChocolate.Template.Gateway.Managed.csproj @@ -1,14 +1,14 @@ - net7.0 + net8.0 enable enable Gateway - + diff --git a/templates/v12/gateway/.template.config/template.json b/templates/v12/gateway/.template.config/template.json index a413fb41456..f89792d844f 100644 --- a/templates/v12/gateway/.template.config/template.json +++ b/templates/v12/gateway/.template.config/template.json @@ -19,16 +19,16 @@ "description": "The target framework for the project.", "datatype": "choice", "choices": [ - { - "choice": "net7.0", - "description": "Target .NET 7" - }, { "choice": "net8.0", "description": "Target .NET 8" + }, + { + "choice": "net9.0", + "description": "Target .NET 9" } ], - "replaces": "net7.0", + "replaces": "net8.0", "defaultValue": "net8.0" } }, diff --git a/templates/v12/gateway/.vscode/tasks.json b/templates/v12/gateway/.vscode/tasks.json deleted file mode 100644 index 31c32bd3457..00000000000 --- a/templates/v12/gateway/.vscode/tasks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "shell", - "args": [ - "build", - // Ask dotnet build to generate full paths for file names. - "/property:GenerateFullPaths=true", - // Do not generate summary otherwise it leads to duplicate errors in Problems panel - "/consoleloggerparameters:NoSummary" - ], - "group": "build", - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/templates/v12/gateway/HotChocolate.Template.Gateway.csproj b/templates/v12/gateway/HotChocolate.Template.Gateway.csproj index d2c8d413903..ff667a4f4ca 100644 --- a/templates/v12/gateway/HotChocolate.Template.Gateway.csproj +++ b/templates/v12/gateway/HotChocolate.Template.Gateway.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/templates/v12/server/.template.config/template.json b/templates/v12/server/.template.config/template.json index a522ec108b1..9e367e66592 100644 --- a/templates/v12/server/.template.config/template.json +++ b/templates/v12/server/.template.config/template.json @@ -19,20 +19,16 @@ "description": "The target framework for the project.", "datatype": "choice", "choices": [ - { - "choice": "net6.0", - "description": "Target .NET 6" - }, - { - "choice": "net7.0", - "description": "Target .NET 7" - }, { "choice": "net8.0", "description": "Target .NET 8" + }, + { + "choice": "net9.0", + "description": "Target .NET 9" } ], - "replaces": "net6.0", + "replaces": "net8.0", "defaultValue": "net8.0" } }, diff --git a/templates/v12/server/.vscode/tasks.json b/templates/v12/server/.vscode/tasks.json deleted file mode 100644 index 31c32bd3457..00000000000 --- a/templates/v12/server/.vscode/tasks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "shell", - "args": [ - "build", - // Ask dotnet build to generate full paths for file names. - "/property:GenerateFullPaths=true", - // Do not generate summary otherwise it leads to duplicate errors in Problems panel - "/consoleloggerparameters:NoSummary" - ], - "group": "build", - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/templates/v12/server/HotChocolate.Template.Server.csproj b/templates/v12/server/HotChocolate.Template.Server.csproj index f94695cec1a..78fdd691c0b 100644 --- a/templates/v12/server/HotChocolate.Template.Server.csproj +++ b/templates/v12/server/HotChocolate.Template.Server.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 enable enable preview From e21a91638a2fe999ff2ea3a84a6062d4ce363fdb Mon Sep 17 00:00:00 2001 From: Michael Staib Date: Mon, 23 Sep 2024 10:02:21 +0200 Subject: [PATCH 2/5] Switched to new activator tools and removed service factory --- .../Core/src/Types/SchemaBuilder.Setup.cs | 2 +- .../DependencyInjection/ServiceFactory.cs | 48 -------- .../Utilities.Tests/ServiceFactoryTests.cs | 108 ------------------ 3 files changed, 1 insertion(+), 157 deletions(-) delete mode 100644 src/HotChocolate/Utilities/src/Utilities/DependencyInjection/ServiceFactory.cs delete mode 100644 src/HotChocolate/Utilities/test/Utilities.Tests/ServiceFactoryTests.cs diff --git a/src/HotChocolate/Core/src/Types/SchemaBuilder.Setup.cs b/src/HotChocolate/Core/src/Types/SchemaBuilder.Setup.cs index 21fa29f2fc5..705239fe4d3 100644 --- a/src/HotChocolate/Core/src/Types/SchemaBuilder.Setup.cs +++ b/src/HotChocolate/Core/src/Types/SchemaBuilder.Setup.cs @@ -270,7 +270,7 @@ private static void InitializeInterceptors( { if (interceptorOrType is Type type) { - var obj = ServiceFactory.CreateInstance(services, type); + var obj = ActivatorUtilities.CreateInstance(services, type); if (obj is T casted) { interceptors.Add(casted); diff --git a/src/HotChocolate/Utilities/src/Utilities/DependencyInjection/ServiceFactory.cs b/src/HotChocolate/Utilities/src/Utilities/DependencyInjection/ServiceFactory.cs deleted file mode 100644 index 679e118943e..00000000000 --- a/src/HotChocolate/Utilities/src/Utilities/DependencyInjection/ServiceFactory.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Collections.Concurrent; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using HotChocolate.Utilities.Properties; -using Microsoft.Extensions.DependencyInjection; -using static System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes; - -namespace HotChocolate.Utilities; - -public static class ServiceFactory -{ - private static readonly ConcurrentDictionary _factories = new(); - - public static object CreateInstance( - IServiceProvider services, - [DynamicallyAccessedMembers(PublicConstructors)] Type type) - { - if (services is null) - { - throw new ArgumentNullException(nameof(services)); - } - - if (type is null) - { - throw new ArgumentNullException(nameof(type)); - } - - try - { - var factory = _factories.GetOrAdd(type, CreateFactory); - return factory(services, null); - } - catch (Exception ex) - { - throw new ServiceException( - string.Format( - CultureInfo.InvariantCulture, - UtilityResources.ServiceFactory_CreateInstanceFailed, - type.FullName), - ex); - } - - static ObjectFactory CreateFactory(Type instanceType) -#pragma warning disable IL2067 // FIXME - => ActivatorUtilities.CreateFactory(instanceType, []); -#pragma warning restore IL2067 - } -} diff --git a/src/HotChocolate/Utilities/test/Utilities.Tests/ServiceFactoryTests.cs b/src/HotChocolate/Utilities/test/Utilities.Tests/ServiceFactoryTests.cs deleted file mode 100644 index 67e37ce1130..00000000000 --- a/src/HotChocolate/Utilities/test/Utilities.Tests/ServiceFactoryTests.cs +++ /dev/null @@ -1,108 +0,0 @@ -using Snapshooter.Xunit; -using Xunit; - -namespace HotChocolate.Utilities; - -public class ServiceFactoryTests -{ - [Fact] - public void TypeArgumentValidation() - { - // arrange - // act - void Error() => ServiceFactory.CreateInstance(EmptyServiceProvider.Instance, null!); - - // assert - Assert.Throws(Error); - } - - [Fact] - public void CreateInstanceWithoutServiceProvider() - { - // arrange - // act - var instance = ServiceFactory.CreateInstance(EmptyServiceProvider.Instance, typeof(ClassWithNoDependencies)); - - // assert - Assert.NotNull(instance); - Assert.IsType(instance); - } - - [Fact] - public void CreateInstanceWithServiceProvider() - { - // arrange - var serviceProvider = new DictionaryServiceProvider( - typeof(ClassWithNoDependencies), - new ClassWithNoDependencies()); - - // act - var instance = ServiceFactory.CreateInstance(serviceProvider, typeof(ClassWithDependencies)); - - // assert - Assert.NotNull(instance); - Assert.IsType(instance); - - var classWithDependencies = - (ClassWithDependencies)instance; - Assert.NotNull(classWithDependencies.Dependency); - } - - [Fact] - public void Catch_Exception_On_Create() - { - // arrange - var type = typeof(ClassWithException); - - // act - void Error() => ServiceFactory.CreateInstance(EmptyServiceProvider.Instance, type); - - // assert - Assert.Throws(Error) - .Message.MatchSnapshot(); - } - - [Fact] - public void Cannot_Resolve_Dependencies() - { - // arrange - var type = typeof(ClassWithDependencies); - - // act - void Error() => ServiceFactory.CreateInstance(EmptyServiceProvider.Instance, type); - - // assert - Assert.Throws(Error) - .Message.MatchSnapshot(); - } - - [Fact] - public void No_Services_Available() - { - // arrange - var type = typeof(ClassWithDependencies); - - // act - void Error() => ServiceFactory.CreateInstance(EmptyServiceProvider.Instance, type); - - // assert - Assert.Throws(Error) - .Message.MatchSnapshot(); - } - - private sealed class ClassWithNoDependencies; - - private sealed class ClassWithDependencies(ClassWithNoDependencies dependency) - { - public ClassWithNoDependencies Dependency { get; } = - dependency ?? throw new ArgumentNullException(nameof(dependency)); - } - - private sealed class ClassWithException - { - public ClassWithException() - { - throw new NullReferenceException(); - } - } -} From 52a5962b6bd83583f1edc066b26186637fe5c4dc Mon Sep 17 00:00:00 2001 From: Glen Date: Mon, 23 Sep 2024 09:26:11 +0200 Subject: [PATCH 3/5] Removed Spatial.Demo project --- .../Database/ApplicationDbContext.cs | 163 ------------------ .../demo/Spatial.Demo/Database/GolfCourse.cs | 13 -- .../demo/Spatial.Demo/Database/LiquorStore.cs | 16 -- .../demo/Spatial.Demo/Database/Parcel.cs | 16 -- .../Spatial.Demo/DemoResources.Designer.cs | 60 ------- .../demo/Spatial.Demo/DemoResources.resx | 27 --- .../Spatial/demo/Spatial.Demo/Program.cs | 20 --- .../Spatial/demo/Spatial.Demo/Schema/Query.cs | 30 ---- .../demo/Spatial.Demo/Spatial.Demo.csproj | 31 ---- .../Spatial/demo/Spatial.Demo/Startup.cs | 49 ------ 10 files changed, 425 deletions(-) delete mode 100644 src/HotChocolate/Spatial/demo/Spatial.Demo/Database/ApplicationDbContext.cs delete mode 100644 src/HotChocolate/Spatial/demo/Spatial.Demo/Database/GolfCourse.cs delete mode 100644 src/HotChocolate/Spatial/demo/Spatial.Demo/Database/LiquorStore.cs delete mode 100644 src/HotChocolate/Spatial/demo/Spatial.Demo/Database/Parcel.cs delete mode 100644 src/HotChocolate/Spatial/demo/Spatial.Demo/DemoResources.Designer.cs delete mode 100644 src/HotChocolate/Spatial/demo/Spatial.Demo/DemoResources.resx delete mode 100644 src/HotChocolate/Spatial/demo/Spatial.Demo/Program.cs delete mode 100644 src/HotChocolate/Spatial/demo/Spatial.Demo/Schema/Query.cs delete mode 100644 src/HotChocolate/Spatial/demo/Spatial.Demo/Spatial.Demo.csproj delete mode 100644 src/HotChocolate/Spatial/demo/Spatial.Demo/Startup.cs diff --git a/src/HotChocolate/Spatial/demo/Spatial.Demo/Database/ApplicationDbContext.cs b/src/HotChocolate/Spatial/demo/Spatial.Demo/Database/ApplicationDbContext.cs deleted file mode 100644 index 37e87add73e..00000000000 --- a/src/HotChocolate/Spatial/demo/Spatial.Demo/Database/ApplicationDbContext.cs +++ /dev/null @@ -1,163 +0,0 @@ -using Microsoft.EntityFrameworkCore; - -namespace Spatial.Demo -{ - public class ApplicationDbContext : DbContext - { - public ApplicationDbContext( - DbContextOptions options) - : base(options) - { - } - - protected override void OnModelCreating( - ModelBuilder modelBuilder) - { - modelBuilder.Entity( - entity => - { - entity.HasKey(e => e.Xid) - .HasName("salt_lake_county_parcels_lir_pkey"); - - entity.ToTable("salt_lake_county_parcels_lir", "cadastre"); - - entity.HasIndex(e => e.Shape) - .HasDatabaseName("salt_lake_county_parcels_lir_shape_geom_idx") - .HasMethod("gist"); - - entity.Property(e => e.Xid).HasColumnName("xid"); - - entity.Property(e => e.ParcelId) - .HasColumnName("parcel_id") - .HasMaxLength(50); - - entity.Property(e => e.BuildingSqFt) - .HasColumnName("bldg_sqft") - .HasColumnType("numeric(38,8)"); - - entity.Property(e => e.Floors) - .HasColumnName("floors_cnt") - .HasColumnType("numeric(38,8)"); - - entity.Property(e => e.RoomCount) - .HasColumnName("house_cnt") - .HasMaxLength(10); - - entity.Property(e => e.MarketValue) - .HasColumnName("total_mkt_value") - .HasColumnType("numeric(38,8)"); - - entity.Property(e => e.YearBuilt) - .HasColumnName("built_yr") - .HasColumnType("numeric(5,0)"); - - entity.Property(e => e.Shape) - .HasColumnName("shape") - .HasColumnType("geometry(MultiPolygon,26912)"); - - entity.Property(e => e.Shape) - .HasColumnName("shape") - .HasColumnType("geometry"); - }); - - modelBuilder.Entity( - entity => { - entity.HasKey(e => e.Xid) - .HasName("liquor_stores_pkey"); - - entity.ToTable("liquor_stores", "society"); - - entity.HasIndex(e => e.Shape) - .HasDatabaseName("liquor_stores_shape_geom_idx") - .HasMethod("gist"); - - entity.Property(e => e.Xid).HasColumnName("xid"); - - entity.Property(e => e.Shape) - .HasColumnName("shape") - .HasColumnType("geometry"); - - entity.Property(e => e.Shape) - .HasColumnName("shape") - .HasColumnType("geometry(Point,26912)"); - - entity.Property(e => e.StoreNumber) - .HasColumnName("store_number") - .HasColumnType("numeric(5,0)"); - - entity.Property(e => e.Zip) - .HasColumnName("zip") - .HasColumnType("numeric(10,0)"); - - entity.Property(e => e.Name) - .HasColumnName("name") - .HasMaxLength(50); - - entity.Property(e => e.Type) - .HasColumnName("type") - .HasMaxLength(20); - - entity.Property(e => e.Address) - .HasColumnName("address") - .HasMaxLength(50); - - entity.Property(e => e.City) - .HasColumnName("city") - .HasMaxLength(35); - - entity.Property(e => e.County) - .HasColumnName("county") - .HasMaxLength(25); - - entity.Property(e => e.Phone) - .HasColumnName("phone") - .HasMaxLength(15); - }); - modelBuilder.Entity( - entity => { - entity.HasKey(e => e.Xid) - .HasName("golf_courses_pkey"); - - entity.ToTable("golf_courses", "recreation"); - - entity.HasIndex(e => e.Shape) - .HasDatabaseName("golf_courses_shape_geom_idx") - .HasMethod("gist"); - - entity.Property(e => e.Xid).HasColumnName("xid"); - - entity.Property(e => e.Shape) - .HasColumnName("shape") - .HasColumnType("geometry"); - - entity.Property(e => e.Shape) - .HasColumnName("shape") - .HasColumnType("geometry(MultiPolygon,26912)"); - - entity.Property(e => e.Par) - .HasColumnName("par") - .HasColumnType("numeric(10,0)"); - - entity.Property(e => e.Holes) - .HasColumnName("holes") - .HasColumnType("numeric(10,0)"); - - entity.Property(e => e.Name) - .HasColumnName("name") - .HasMaxLength(50); - - entity.Property(e => e.City) - .HasColumnName("city") - .HasMaxLength(30); - - entity.Property(e => e.County) - .HasColumnName("county") - .HasMaxLength(30); - }); - } - - public DbSet Parcels { get; set; } = default!; - public DbSet LiquorStores { get; set; } = default!; - public DbSet GolfCourses { get; set; } = default!; - } -} diff --git a/src/HotChocolate/Spatial/demo/Spatial.Demo/Database/GolfCourse.cs b/src/HotChocolate/Spatial/demo/Spatial.Demo/Database/GolfCourse.cs deleted file mode 100644 index 04d03cfda86..00000000000 --- a/src/HotChocolate/Spatial/demo/Spatial.Demo/Database/GolfCourse.cs +++ /dev/null @@ -1,13 +0,0 @@ -using NetTopologySuite.Geometries; - -namespace Spatial.Demo { - public class GolfCourse { - public int Xid { get; set; } - public string Name { get; set; } - public string City { get; set; } - public string County { get; set; } - public int Par { get; set; } - public int Holes { get; set; } - public MultiPolygon Shape { get; set; } - } -} diff --git a/src/HotChocolate/Spatial/demo/Spatial.Demo/Database/LiquorStore.cs b/src/HotChocolate/Spatial/demo/Spatial.Demo/Database/LiquorStore.cs deleted file mode 100644 index a82cb2c02b0..00000000000 --- a/src/HotChocolate/Spatial/demo/Spatial.Demo/Database/LiquorStore.cs +++ /dev/null @@ -1,16 +0,0 @@ -using NetTopologySuite.Geometries; - -namespace Spatial.Demo { - public class LiquorStore { - public int Xid { get; set; } - public int StoreNumber { get; set; } - public string Type { get; set; } - public string Name { get; set; } - public string Address { get; set; } - public string City { get; set; } - public string County { get; set; } - public string Phone { get; set; } - public int Zip { get; set; } - public Point Shape { get; set; } - } -} diff --git a/src/HotChocolate/Spatial/demo/Spatial.Demo/Database/Parcel.cs b/src/HotChocolate/Spatial/demo/Spatial.Demo/Database/Parcel.cs deleted file mode 100644 index ff21ed46055..00000000000 --- a/src/HotChocolate/Spatial/demo/Spatial.Demo/Database/Parcel.cs +++ /dev/null @@ -1,16 +0,0 @@ -using NetTopologySuite.Geometries; - -namespace Spatial.Demo -{ - public class Parcel - { - public int Xid { get; set; } - public string ParcelId { get; set; } - public int BuildingSqFt { get; set; } - public int Floors { get; set; } - public string RoomCount { get; set; } - public decimal? MarketValue { get; set; } - public int YearBuilt { get; set; } - public MultiPolygon Shape { get; set; } - } -} diff --git a/src/HotChocolate/Spatial/demo/Spatial.Demo/DemoResources.Designer.cs b/src/HotChocolate/Spatial/demo/Spatial.Demo/DemoResources.Designer.cs deleted file mode 100644 index 0a652d4e6f0..00000000000 --- a/src/HotChocolate/Spatial/demo/Spatial.Demo/DemoResources.Designer.cs +++ /dev/null @@ -1,60 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Spatial.Demo { - using System; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class DemoResources { - - private static System.Resources.ResourceManager resourceMan; - - private static System.Globalization.CultureInfo resourceCulture; - - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal DemoResources() { - } - - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - internal static System.Resources.ResourceManager ResourceManager { - get { - if (object.Equals(null, resourceMan)) { - System.Resources.ResourceManager temp = new System.Resources.ResourceManager("Spatial.Demo.DemoResources", typeof(DemoResources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - internal static System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - internal static string CS26912 { - get { - return ResourceManager.GetString("CS26912", resourceCulture); - } - } - - internal static string CS26918 { - get { - return ResourceManager.GetString("CS26918", resourceCulture); - } - } - } -} diff --git a/src/HotChocolate/Spatial/demo/Spatial.Demo/DemoResources.resx b/src/HotChocolate/Spatial/demo/Spatial.Demo/DemoResources.resx deleted file mode 100644 index 4ae23441e5d..00000000000 --- a/src/HotChocolate/Spatial/demo/Spatial.Demo/DemoResources.resx +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - PROJCS["NAD83 \/ UTM zone 12N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","26912"]] - - - PROJCS["NAD83 \/ UTM zone 18N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","26918"]] - - diff --git a/src/HotChocolate/Spatial/demo/Spatial.Demo/Program.cs b/src/HotChocolate/Spatial/demo/Spatial.Demo/Program.cs deleted file mode 100644 index a8ce64fd30c..00000000000 --- a/src/HotChocolate/Spatial/demo/Spatial.Demo/Program.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Hosting; - -namespace Spatial.Demo -{ - public class Program - { - public static void Main(string[] args) - { - CreateHostBuilder(args).Build().Run(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); - } -} diff --git a/src/HotChocolate/Spatial/demo/Spatial.Demo/Schema/Query.cs b/src/HotChocolate/Spatial/demo/Spatial.Demo/Schema/Query.cs deleted file mode 100644 index 2086f385cc4..00000000000 --- a/src/HotChocolate/Spatial/demo/Spatial.Demo/Schema/Query.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Linq; -using HotChocolate; -using HotChocolate.Data; - -namespace Spatial.Demo -{ - public class Query - { - [UseDbContext(typeof(ApplicationDbContext))] - [UseProjection] - [UseFiltering] - public IQueryable GetParcels( - [ScopedService] ApplicationDbContext context) => - context.Parcels; - - [UseDbContext(typeof(ApplicationDbContext))] - [UseProjection] - [UseFiltering] - public IQueryable GetLiquorStores( - [ScopedService] ApplicationDbContext context) => - context.LiquorStores; - - [UseDbContext(typeof(ApplicationDbContext))] - [UseProjection] - [UseFiltering] - public IQueryable GetGolfCourses( - [ScopedService] ApplicationDbContext context) => - context.GolfCourses; - } -} diff --git a/src/HotChocolate/Spatial/demo/Spatial.Demo/Spatial.Demo.csproj b/src/HotChocolate/Spatial/demo/Spatial.Demo/Spatial.Demo.csproj deleted file mode 100644 index 67f3a82eb23..00000000000 --- a/src/HotChocolate/Spatial/demo/Spatial.Demo/Spatial.Demo.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - - net6.0 - - - - - - - - - - - - - - - - - ResXFileCodeGenerator - DemoResources.Designer.cs - - - True - True - DemoResources.resx - - - - diff --git a/src/HotChocolate/Spatial/demo/Spatial.Demo/Startup.cs b/src/HotChocolate/Spatial/demo/Spatial.Demo/Startup.cs deleted file mode 100644 index 1f12ae340c1..00000000000 --- a/src/HotChocolate/Spatial/demo/Spatial.Demo/Startup.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using HotChocolate; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using HotChocolate.Types.Spatial; - -namespace Spatial.Demo -{ - public class Startup - { - private const string CONNECTION_STRING = - "Database=opensgid;Host=opensgid.agrc.utah.gov;Username=agrc;Password=agrc"; - - public void ConfigureServices(IServiceCollection services) - { - services.AddPooledDbContextFactory( - options => options - .UseNpgsql(CONNECTION_STRING, o => o.UseNetTopologySuite()) - .LogTo(Console.WriteLine)) - .AddGraphQLServer() - .AddFiltering() - .AddProjections() - .AddSpatialTypes(x => x - .DefaultSrid(26912) - .AddWebMercator() - .AddWGS84() - .AddCoordinateSystemFromString(29912, DemoResources.CS26912) - .AddCoordinateSystemFromString(29918, DemoResources.CS26918)) - .AddSpatialProjections() - .AddSpatialFiltering() - .AddQueryType(); - } - - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - - app.UseRouting(); - - app.UseEndpoints(endpoints => endpoints.MapGraphQL()); - } - } -} From 0cc1fbc64d9012b8a24a1527426fe633a92aff98 Mon Sep 17 00:00:00 2001 From: Glen Date: Mon, 23 Sep 2024 09:44:18 +0200 Subject: [PATCH 4/5] Fixed BinaryFormatter error --- .build/Build.csproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.build/Build.csproj b/.build/Build.csproj index fc0931ecdcc..b42b1f47ee9 100644 --- a/.build/Build.csproj +++ b/.build/Build.csproj @@ -8,12 +8,14 @@ .. .. 1 + true + From 058c454a6d3fe437e356144258552d49391f8cb0 Mon Sep 17 00:00:00 2001 From: Glen Date: Mon, 23 Sep 2024 10:05:48 +0200 Subject: [PATCH 5/5] Set NuGetAuditMode to direct --- .build/Build.csproj | 1 + src/Directory.Build.props | 1 + 2 files changed, 2 insertions(+) diff --git a/.build/Build.csproj b/.build/Build.csproj index b42b1f47ee9..a10e215c4ff 100644 --- a/.build/Build.csproj +++ b/.build/Build.csproj @@ -9,6 +9,7 @@ .. 1 true + direct diff --git a/src/Directory.Build.props b/src/Directory.Build.props index ea52cc49d4c..727dd6ae56c 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -7,6 +7,7 @@ true enable enable + direct