From c443c834553a650b09bd004ad34631e3e17cbdca Mon Sep 17 00:00:00 2001 From: Michael Staib Date: Mon, 9 Dec 2024 18:16:43 +0100 Subject: [PATCH] [Fusion] Add lookup requirements. (#7804) --- src/Directory.Packages.props | 1 + .../Inspectors/TypeAttributeInspector.cs | 2 +- .../Properties/TypeResources.Designer.cs | 2373 +++++------------ .../src/Types/Properties/TypeResources.resx | 3 - .../Core/src/Types/SchemaPrinter.cs | 2 +- .../Extensions/DirectiveLocationExtensions.cs | 205 -- .../Types/Factories/DirectiveTypeFactory.cs | 108 +- .../Planning/Nodes/ConditionPlanNode.cs | 52 - .../Planning/Nodes/FieldPlanNode.cs | 15 +- .../Nodes/FieldRequirementPlanNode.cs | 31 + .../Planning/Nodes/IPlanNodeProvider.cs | 8 - .../Planning/Nodes/ISerializablePlanNode.cs | 10 - .../Planning/Nodes/InlineFragmentPlanNode.cs | 9 +- .../Planning/Nodes/OperationPlanNode.cs | 44 +- .../Planning/Nodes/PlanNode.cs | 2 +- .../Planning/Nodes/PlanNodeKind.cs | 8 - .../Planning/Nodes/RootPlanNode.cs | 39 +- .../Planning/Nodes/SelectionPlanNode.cs | 129 +- .../Planning/Nodes/SerializationHelper.cs | 29 - .../Planning/OperationPlanner.cs | 548 ++-- .../Planning/OperationVariableBinder.cs | 26 +- .../Planning/PlanNodeJsonFormatter.cs | 131 + .../Planning/PlanNodeYamlFormatter.cs | 110 + .../Types/Completion/CompletionTools.cs | 5 +- .../Completion/CompositeSchemaBuilder.cs | 106 +- .../Completion/CompositeSchemaContext.cs | 170 +- .../Types/CompositeDirective.cs | 4 +- ...efinition.cs => CompositeDirectiveType.cs} | 10 +- .../Fusion.Execution/Types/CompositeSchema.cs | 34 +- .../src/Fusion.Execution/Types/FieldPath.cs | 41 +- .../src/Fusion.Execution/Types/Lookup.cs | 4 - .../src/Fusion.Execution/Types/LookupKind.cs | 7 - .../Fusion-vnext/test/Directory.Build.props | 4 + .../Fusion.Execution.Tests/ConditionTests.cs | 743 +++--- .../OperationPlannerTests.cs | 198 +- ...Plan_Simple_Operation_1_Source_Schema.snap | 10 - ...Plan_Simple_Operation_2_Source_Schema.snap | 17 - ...Plan_Simple_Operation_3_Source_Schema.snap | 24 - ...n_3_Source_Schema_And_Single_Variable.snap | 24 - .../src/Primitives/DirectiveLocationUtils.cs | 207 ++ .../PrimitivesResources.Designer.cs | 6 + .../Properties/PrimitivesResources.resx | 3 + 42 files changed, 2575 insertions(+), 2927 deletions(-) delete mode 100644 src/HotChocolate/Core/src/Types/Types/Extensions/DirectiveLocationExtensions.cs delete mode 100644 src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/ConditionPlanNode.cs create mode 100644 src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/FieldRequirementPlanNode.cs delete mode 100644 src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/IPlanNodeProvider.cs delete mode 100644 src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/ISerializablePlanNode.cs delete mode 100644 src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/PlanNodeKind.cs delete mode 100644 src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/SerializationHelper.cs create mode 100644 src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/PlanNodeJsonFormatter.cs create mode 100644 src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/PlanNodeYamlFormatter.cs rename src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/{CompositeDirectiveDefinition.cs => CompositeDirectiveType.cs} (84%) delete mode 100644 src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/LookupKind.cs delete mode 100644 src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/__snapshots__/OperationPlannerTests.Plan_Simple_Operation_1_Source_Schema.snap delete mode 100644 src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/__snapshots__/OperationPlannerTests.Plan_Simple_Operation_2_Source_Schema.snap delete mode 100644 src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/__snapshots__/OperationPlannerTests.Plan_Simple_Operation_3_Source_Schema.snap delete mode 100644 src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/__snapshots__/OperationPlannerTests.Plan_Simple_Operation_3_Source_Schema_And_Single_Variable.snap create mode 100644 src/HotChocolate/Primitives/src/Primitives/DirectiveLocationUtils.cs diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 48d02d0f9a0..8018a15419c 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -60,6 +60,7 @@ + diff --git a/src/HotChocolate/Core/src/Types.Analyzers/Inspectors/TypeAttributeInspector.cs b/src/HotChocolate/Core/src/Types.Analyzers/Inspectors/TypeAttributeInspector.cs index b86f7b35b48..e771b4f98c7 100644 --- a/src/HotChocolate/Core/src/Types.Analyzers/Inspectors/TypeAttributeInspector.cs +++ b/src/HotChocolate/Core/src/Types.Analyzers/Inspectors/TypeAttributeInspector.cs @@ -34,7 +34,7 @@ public bool TryHandle( var attributeContainingTypeSymbol = attributeSymbol.ContainingType; var fullName = attributeContainingTypeSymbol.ToDisplayString(); - // We do a start with here to capture the generic and non generic variant of + // We do a startWith to capture the generic and non-generic variants of // the object type extension attribute. if (fullName.StartsWith(ExtendObjectTypeAttribute, Ordinal) && context.SemanticModel.GetDeclaredSymbol(possibleType) is { } typeExt) diff --git a/src/HotChocolate/Core/src/Types/Properties/TypeResources.Designer.cs b/src/HotChocolate/Core/src/Types/Properties/TypeResources.Designer.cs index 6d9cddc987c..f54c31aa3a6 100644 --- a/src/HotChocolate/Core/src/Types/Properties/TypeResources.Designer.cs +++ b/src/HotChocolate/Core/src/Types/Properties/TypeResources.Designer.cs @@ -11,46 +11,32 @@ namespace HotChocolate.Properties { using System; - /// - /// 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()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class TypeResources { - private static global::System.Resources.ResourceManager resourceMan; + private static System.Resources.ResourceManager resourceMan; - private static global::System.Globalization.CultureInfo resourceCulture; + private static System.Globalization.CultureInfo resourceCulture; - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal TypeResources() { } - /// - /// 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 { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + internal static System.Resources.ResourceManager ResourceManager { get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HotChocolate.Properties.TypeResources", typeof(TypeResources).Assembly); + if (object.Equals(null, resourceMan)) { + System.Resources.ResourceManager temp = new System.Resources.ResourceManager("HotChocolate.Properties.TypeResources", typeof(TypeResources).Assembly); resourceMan = temp; } return resourceMan; } } - /// - /// 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 { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + internal static System.Globalization.CultureInfo Culture { get { return resourceCulture; } @@ -59,2938 +45,1947 @@ internal TypeResources() { } } - /// - /// Looks up a localized string similar to Cycle in object graph detected.. - /// - internal static string AnyType_CycleInObjectGraph { - get { - return ResourceManager.GetString("AnyType_CycleInObjectGraph", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An Applied Directive is an instances of a directive as applied to a schema element. This type is NOT specified by the graphql specification presently.. - /// - internal static string AppliedDirective_Description { - get { - return ResourceManager.GetString("AppliedDirective_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The argument `{0}` has no type. Specify the type with `.Argument("{0}", a.Type<MyType>())` to fix this issue.. - /// - internal static string Argument_TypeIsNull { + internal static string ThrowHelper_MissingDirectiveIfArgument { get { - return ResourceManager.GetString("Argument_TypeIsNull", resourceCulture); + return ResourceManager.GetString("ThrowHelper_MissingDirectiveIfArgument", resourceCulture); } } - /// - /// Looks up a localized string similar to The argument type has to be an input-type.. - /// internal static string ArgumentDescriptor_InputTypeViolation { get { return ResourceManager.GetString("ArgumentDescriptor_InputTypeViolation", resourceCulture); } } - /// - /// Looks up a localized string similar to Argument `{0}` of non-null type `{1}` must not be null.. - /// internal static string ArgumentValueBuilder_NonNull { get { return ResourceManager.GetString("ArgumentValueBuilder_NonNull", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified binding cannot be handled.. - /// - internal static string BindingCompiler_AddBinding_BindingCannotBeHandled { - get { - return ResourceManager.GetString("BindingCompiler_AddBinding_BindingCannotBeHandled", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The `Boolean` scalar type represents `true` or `false`.. - /// internal static string BooleanType_Description { get { return ResourceManager.GetString("BooleanType_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The `Byte` scalar type represents non-fractional whole numeric values. Byte can represent values between 0 and 255.. - /// internal static string ByteType_Description { get { return ResourceManager.GetString("ByteType_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to Could not resolve the claims principal.. - /// - internal static string ClaimsPrincipalParameterExpressionBuilder_NoClaimsFound { - get { - return ResourceManager.GetString("ClaimsPrincipalParameterExpressionBuilder_NoClaimsFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A segment of a collection.. - /// - internal static string CollectionSegmentType_Description { - get { - return ResourceManager.GetString("CollectionSegmentType_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A flattened list of the items.. - /// - internal static string CollectionSegmentType_Items_Description { - get { - return ResourceManager.GetString("CollectionSegmentType_Items_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Information to aid in pagination.. - /// - internal static string CollectionSegmentType_PageInfo_Description { - get { - return ResourceManager.GetString("CollectionSegmentType_PageInfo_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The specified IComplexTypeFieldBindingBuilder-implementation is not supported.. - /// internal static string ComplexTypeBindingBuilder_FieldBuilderNotSupported { get { return ResourceManager.GetString("ComplexTypeBindingBuilder_FieldBuilderNotSupported", resourceCulture); } } - /// - /// Looks up a localized string similar to The field binding builder is not completed and cannot be added.. - /// internal static string ComplexTypeBindingBuilder_FieldNotComplete { get { return ResourceManager.GetString("ComplexTypeBindingBuilder_FieldNotComplete", resourceCulture); } } - /// - /// Looks up a localized string similar to A connection to a list of items.. - /// - internal static string ConnectionType_Description { - get { - return ResourceManager.GetString("ConnectionType_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A list of edges.. - /// - internal static string ConnectionType_Edges_Description { - get { - return ResourceManager.GetString("ConnectionType_Edges_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A flattened list of the nodes.. - /// - internal static string ConnectionType_Nodes_Description { - get { - return ResourceManager.GetString("ConnectionType_Nodes_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Information to aid in pagination.. - /// - internal static string ConnectionType_PageInfo_Description { - get { - return ResourceManager.GetString("ConnectionType_PageInfo_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Identifies the total count of items in the connection.. - /// - internal static string ConnectionType_TotalCount_Description { - get { - return ResourceManager.GetString("ConnectionType_TotalCount_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The DataLoader key cannot be null or empty.. - /// internal static string DataLoaderRegistry_KeyNullOrEmpty { get { return ResourceManager.GetString("DataLoaderRegistry_KeyNullOrEmpty", resourceCulture); } } - /// - /// Looks up a localized string similar to The DataLoader `{0}` needs to be register with the dependency injection provider.. - /// - internal static string DataLoaderResolverContextExtensions_CreateDataLoader_AbstractType { - get { - return ResourceManager.GetString("DataLoaderResolverContextExtensions_CreateDataLoader_AbstractType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unable to create DataLoader `{0}`.. - /// - internal static string DataLoaderResolverContextExtensions_CreateDataLoader_UnableToCreate { - get { - return ResourceManager.GetString("DataLoaderResolverContextExtensions_CreateDataLoader_UnableToCreate", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No DataLoader registry was registered with your dependency injection.. - /// internal static string DataLoaderResolverContextExtensions_RegistryIsNull { get { return ResourceManager.GetString("DataLoaderResolverContextExtensions_RegistryIsNull", resourceCulture); } } - /// - /// Looks up a localized string similar to Unable to register a DataLoader with your DataLoader registry.. - /// internal static string DataLoaderResolverContextExtensions_UnableToRegister { get { return ResourceManager.GetString("DataLoaderResolverContextExtensions_UnableToRegister", resourceCulture); } } - /// - /// Looks up a localized string similar to The `DateTime` scalar represents an ISO-8601 compliant date time type.. - /// internal static string DateTimeType_Description { get { return ResourceManager.GetString("DateTimeType_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The `Date` scalar represents an ISO-8601 compliant date type.. - /// internal static string DateType_Description { get { return ResourceManager.GetString("DateType_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The `Decimal` scalar type represents a decimal floating-point number.. - /// internal static string DecimalType_Description { get { return ResourceManager.GetString("DecimalType_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The DataLoader `{0}` was not of the requested type `{1}`.. - /// - internal static string DefaultDataLoaderRegistry_GetOrRegister { - get { - return ResourceManager.GetString("DefaultDataLoaderRegistry_GetOrRegister", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The fieldName cannot be null or empty.. - /// - internal static string DefaultNamingConventions_FormatFieldName_EmptyOrNull { - get { - return ResourceManager.GetString("DefaultNamingConventions_FormatFieldName_EmptyOrNull", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Only methods are allowed.. - /// - internal static string DefaultResolverCompilerService_CompileSubscribe_OnlyMethodsAllowed { - get { - return ResourceManager.GetString("DefaultResolverCompilerService_CompileSubscribe_OnlyMethodsAllowed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The public method should already have ensured that we do not have members other than method or property at this point.. - /// - internal static string DefaultResolverCompilerService_CreateResolver_ArgumentValidationError { - get { - return ResourceManager.GetString("DefaultResolverCompilerService_CreateResolver_ArgumentValidationError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The specified member has to be a method or a property.. - /// internal static string DefaultTypeInspector_MemberInvalid { get { return ResourceManager.GetString("DefaultTypeInspector_MemberInvalid", resourceCulture); } } - /// - /// Looks up a localized string similar to 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`.. - /// - internal static string DeferDirectiveType_Description { - get { - return ResourceManager.GetString("DeferDirectiveType_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Deferred when true.. - /// - internal static string DeferDirectiveType_If_Description { - get { - return ResourceManager.GetString("DeferDirectiveType_If_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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.. - /// - internal static string DeferDirectiveType_Label_Description { - get { - return ResourceManager.GetString("DeferDirectiveType_Label_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Only type system objects are allowed as schema type.. - /// internal static string DependencyDescriptorBase_OnlyTsoIsAllowed { get { return ResourceManager.GetString("DependencyDescriptorBase_OnlyTsoIsAllowed", resourceCulture); } } - /// - /// Looks up a localized string similar to Deprecations include a reason for why it is deprecated, which is formatted using Markdown syntax (as specified by CommonMark).. - /// - internal static string DeprecatedDirectiveType_ReasonDescription { - get { - return ResourceManager.GetString("DeprecatedDirectiveType_ReasonDescription", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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.. - /// - internal static string DeprecatedDirectiveType_TypeDescription { - get { - return ResourceManager.GetString("DeprecatedDirectiveType_TypeDescription", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document. - /// - ///In 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.. - /// - internal static string Directive_Description { - get { - return ResourceManager.GetString("Directive_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The argument name is invalid.. - /// - internal static string Directive_GetArgument_ArgumentNameIsInvalid { - get { - return ResourceManager.GetString("Directive_GetArgument_ArgumentNameIsInvalid", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The directive '{0}' has no argument with the name '{1}'.. - /// - internal static string Directive_GetArgumentValue_UnknownArgument { - get { - return ResourceManager.GetString("Directive_GetArgumentValue_UnknownArgument", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Use `locations`.. - /// - internal static string Directive_UseLocation { - get { - return ResourceManager.GetString("Directive_UseLocation", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Directive arguments can have names and values. The values are in graphql SDL syntax printed as a string. This type is NOT specified by the graphql specification presently.. - /// - internal static string DirectiveArgument_Description { - get { - return ResourceManager.GetString("DirectiveArgument_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The specified directive `@{0}` is unique and cannot be added twice.. - /// internal static string DirectiveCollection_DirectiveIsUnique { get { return ResourceManager.GetString("DirectiveCollection_DirectiveIsUnique", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified directive `@{0}` is not allowed on the current location `{1}`.. - /// internal static string DirectiveCollection_LocationNotAllowed { get { return ResourceManager.GetString("DirectiveCollection_LocationNotAllowed", resourceCulture); } } - /// - /// Looks up a localized string similar to Location adjacent to an argument definition. - /// internal static string DirectiveLocation_ArgumentDefinition { get { return ResourceManager.GetString("DirectiveLocation_ArgumentDefinition", resourceCulture); } } - /// - /// Looks up a localized string similar to A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.. - /// internal static string DirectiveLocation_Description { get { return ResourceManager.GetString("DirectiveLocation_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to Location adjacent to an enum definition.. - /// internal static string DirectiveLocation_Enum { get { return ResourceManager.GetString("DirectiveLocation_Enum", resourceCulture); } } - /// - /// Looks up a localized string similar to Location adjacent to an enum value definition.. - /// internal static string DirectiveLocation_EnumValue { get { return ResourceManager.GetString("DirectiveLocation_EnumValue", resourceCulture); } } - /// - /// Looks up a localized string similar to Location adjacent to a field.. - /// internal static string DirectiveLocation_Field { get { return ResourceManager.GetString("DirectiveLocation_Field", resourceCulture); } } - /// - /// Looks up a localized string similar to Location adjacent to a field definition.. - /// internal static string DirectiveLocation_FieldDefinition { get { return ResourceManager.GetString("DirectiveLocation_FieldDefinition", resourceCulture); } } - /// - /// Looks up a localized string similar to Location adjacent to a fragment definition.. - /// internal static string DirectiveLocation_FragmentDefinition { get { return ResourceManager.GetString("DirectiveLocation_FragmentDefinition", resourceCulture); } } - /// - /// Looks up a localized string similar to Location adjacent to a fragment spread.. - /// internal static string DirectiveLocation_FragmentSpread { get { return ResourceManager.GetString("DirectiveLocation_FragmentSpread", resourceCulture); } } - /// - /// Looks up a localized string similar to Location adjacent to an inline fragment.. - /// internal static string DirectiveLocation_InlineFragment { get { return ResourceManager.GetString("DirectiveLocation_InlineFragment", resourceCulture); } } - /// - /// Looks up a localized string similar to Location adjacent to an input object field definition.. - /// internal static string DirectiveLocation_InputFieldDefinition { get { return ResourceManager.GetString("DirectiveLocation_InputFieldDefinition", resourceCulture); } } - /// - /// Looks up a localized string similar to Location adjacent to an input object type definition.. - /// internal static string DirectiveLocation_InputObject { get { return ResourceManager.GetString("DirectiveLocation_InputObject", resourceCulture); } } - /// - /// Looks up a localized string similar to Location adjacent to an interface definition.. - /// internal static string DirectiveLocation_Interface { get { return ResourceManager.GetString("DirectiveLocation_Interface", resourceCulture); } } - /// - /// Looks up a localized string similar to Location adjacent to a mutation operation.. - /// internal static string DirectiveLocation_Mutation { get { return ResourceManager.GetString("DirectiveLocation_Mutation", resourceCulture); } } - /// - /// Looks up a localized string similar to Location adjacent to an object type definition.. - /// internal static string DirectiveLocation_Object { get { return ResourceManager.GetString("DirectiveLocation_Object", resourceCulture); } } - /// - /// Looks up a localized string similar to Location adjacent to a query operation.. - /// internal static string DirectiveLocation_Query { get { return ResourceManager.GetString("DirectiveLocation_Query", resourceCulture); } } - /// - /// Looks up a localized string similar to Location adjacent to a scalar definition.. - /// internal static string DirectiveLocation_Scalar { get { return ResourceManager.GetString("DirectiveLocation_Scalar", resourceCulture); } } - /// - /// Looks up a localized string similar to Location adjacent to a schema definition.. - /// internal static string DirectiveLocation_Schema { get { return ResourceManager.GetString("DirectiveLocation_Schema", resourceCulture); } } - /// - /// Looks up a localized string similar to Location adjacent to a subscription operation.. - /// internal static string DirectiveLocation_Subscription { get { return ResourceManager.GetString("DirectiveLocation_Subscription", resourceCulture); } } - /// - /// Looks up a localized string similar to Location adjacent to a union definition.. - /// internal static string DirectiveLocation_Union { get { return ResourceManager.GetString("DirectiveLocation_Union", resourceCulture); } } - /// - /// Looks up a localized string similar to Location adjacent to a variable definition.. - /// - internal static string DirectiveLocation_VariableDefinition { + internal static string DirectiveTypeDescriptor_OnlyProperties { get { - return ResourceManager.GetString("DirectiveLocation_VariableDefinition", resourceCulture); + return ResourceManager.GetString("DirectiveTypeDescriptor_OnlyProperties", resourceCulture); } } - /// - /// Looks up a localized string similar to The `{0}` directive does not declare any location on which it is valid.. - /// internal static string DirectiveType_NoLocations { get { return ResourceManager.GetString("DirectiveType_NoLocations", resourceCulture); } } - /// - /// Looks up a localized string similar to Replace Middleware with `Use`.. - /// internal static string DirectiveType_ReplaceWithUse { get { return ResourceManager.GetString("DirectiveType_ReplaceWithUse", resourceCulture); } } - /// - /// Looks up a localized string similar to Unable to convert the argument value to the specified type.. - /// internal static string DirectiveType_UnableToConvert { get { return ResourceManager.GetString("DirectiveType_UnableToConvert", resourceCulture); } } - /// - /// Looks up a localized string similar to Only property expressions are allowed to describe a directive type argument.. - /// - internal static string DirectiveTypeDescriptor_OnlyProperties { + internal static string Directive_Description { get { - return ResourceManager.GetString("DirectiveTypeDescriptor_OnlyProperties", resourceCulture); + return ResourceManager.GetString("Directive_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified location `{0}` is not supported.. - /// - internal static string DirectiveTypeFactory_LocationNotSupported { + internal static string Directive_UseLocation { get { - return ResourceManager.GetString("DirectiveTypeFactory_LocationNotSupported", resourceCulture); + return ResourceManager.GetString("Directive_UseLocation", resourceCulture); } } - /// - /// Looks up a localized string similar to A cursor for use in pagination.. - /// - internal static string EdgeType_Cursor_Description { + internal static string EnumTypeExtension_CannotMerge { get { - return ResourceManager.GetString("EdgeType_Cursor_Description", resourceCulture); + return ResourceManager.GetString("EnumTypeExtension_CannotMerge", resourceCulture); } } - /// - /// Looks up a localized string similar to An edge in a connection.. - /// - internal static string EdgeType_Description { + internal static string EnumTypeExtension_ValueTypeInvalid { get { - return ResourceManager.GetString("EdgeType_Description", resourceCulture); + return ResourceManager.GetString("EnumTypeExtension_ValueTypeInvalid", resourceCulture); } } - /// - /// Looks up a localized string similar to Edge types that have a non-object node are not supported.. - /// - internal static string EdgeType_IsInstanceOfType_NonObject { + internal static string EnumType_NoValues { get { - return ResourceManager.GetString("EdgeType_IsInstanceOfType_NonObject", resourceCulture); + return ResourceManager.GetString("EnumType_NoValues", resourceCulture); } } - /// - /// Looks up a localized string similar to The item at the end of the edge.. - /// - internal static string EdgeType_Node_Description { + internal static string EnumValue_Description { get { - return ResourceManager.GetString("EdgeType_Node_Description", resourceCulture); + return ResourceManager.GetString("EnumValue_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The enum type `{0}` has no values.. - /// - internal static string EnumType_NoValues { + internal static string EnumValue_ValueIsNull { get { - return ResourceManager.GetString("EnumType_NoValues", resourceCulture); + return ResourceManager.GetString("EnumValue_ValueIsNull", resourceCulture); } } - /// - /// Looks up a localized string similar to The enum type extension can only be merged with an enum type.. - /// - internal static string EnumTypeExtension_CannotMerge { + internal static string FieldInitHelper_InvalidDefaultValue { get { - return ResourceManager.GetString("EnumTypeExtension_CannotMerge", resourceCulture); + return ResourceManager.GetString("FieldInitHelper_InvalidDefaultValue", resourceCulture); } } - /// - /// Looks up a localized string similar to The enum value `{0}` of the enum type extension is not assignable with the target enum type.. - /// - internal static string EnumTypeExtension_ValueTypeInvalid { + internal static string FieldInitHelper_NoFields { get { - return ResourceManager.GetString("EnumTypeExtension_ValueTypeInvalid", resourceCulture); + return ResourceManager.GetString("FieldInitHelper_NoFields", resourceCulture); } } - /// - /// Looks up a localized string similar to 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.. - /// - internal static string EnumValue_Description { + internal static string Field_Description { get { - return ResourceManager.GetString("EnumValue_Description", resourceCulture); + return ResourceManager.GetString("Field_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The inner value of enum value cannot be null or empty.. - /// - internal static string EnumValue_ValueIsNull { + internal static string FloatType_Description { get { - return ResourceManager.GetString("EnumValue_ValueIsNull", resourceCulture); + return ResourceManager.GetString("FloatType_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The field `{0}` must only declare additional arguments to an implemented field that are nullable.. - /// - internal static string ErrorHelper_AdditionalArgumentNotNullable { + internal static string IdType_Description { get { - return ResourceManager.GetString("ErrorHelper_AdditionalArgumentNotNullable", resourceCulture); + return ResourceManager.GetString("IdType_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The argument `{0}` of the implemented field `{1}` must be defined. The field `{2}` must include an argument of the same name for every argument defined on the implemented field of the interface type `{3}`.. - /// - internal static string ErrorHelper_ArgumentNotImplemented { + internal static string InputField_CannotSetValue { get { - return ResourceManager.GetString("ErrorHelper_ArgumentNotImplemented", resourceCulture); + return ResourceManager.GetString("InputField_CannotSetValue", resourceCulture); } } - /// - /// Looks up a localized string similar to Unable to resolve the interface type. For more details look at the error object.. - /// - internal static string ErrorHelper_CompleteInterfacesHelper_UnableToResolveInterface { + internal static string InputObjectTypeExtension_CannotMerge { get { - return ResourceManager.GetString("ErrorHelper_CompleteInterfacesHelper_UnableToResolveInterface", resourceCulture); + return ResourceManager.GetString("InputObjectTypeExtension_CannotMerge", resourceCulture); } } - /// - /// Looks up a localized string similar to The argument `{0}` does not exist on the directive `{1}`.. - /// - internal static string ErrorHelper_DirectiveCollection_ArgumentDoesNotExist { + internal static string InputObjectType_CannotParseLiteral { get { - return ResourceManager.GetString("ErrorHelper_DirectiveCollection_ArgumentDoesNotExist", resourceCulture); + return ResourceManager.GetString("InputObjectType_CannotParseLiteral", resourceCulture); } } - /// - /// Looks up a localized string similar to The argument `{0}` of directive `{1}` mustn't be null.. - /// - internal static string ErrorHelper_DirectiveCollection_ArgumentNonNullViolation { + internal static string InputObjectType_NoFields { get { - return ResourceManager.GetString("ErrorHelper_DirectiveCollection_ArgumentNonNullViolation", resourceCulture); + return ResourceManager.GetString("InputObjectType_NoFields", resourceCulture); } } - /// - /// Looks up a localized string similar to The directive arguments have invalid values: '{0}' at {1}.. - /// - internal static string ErrorHelper_DirectiveCollection_ArgumentValueTypeIsWrong { + internal static string InputTypeNonNullCheck_ValueIsNull { get { - return ResourceManager.GetString("ErrorHelper_DirectiveCollection_ArgumentValueTypeIsWrong", resourceCulture); + return ResourceManager.GetString("InputTypeNonNullCheck_ValueIsNull", resourceCulture); } } - /// - /// Looks up a localized string similar to The field `{0}` declares the data middleware `{1}` more than once.. - /// - internal static string ErrorHelper_DuplicateDataMiddlewareDetected_Message { + internal static string InputValue_DefaultValue { get { - return ResourceManager.GetString("ErrorHelper_DuplicateDataMiddlewareDetected_Message", resourceCulture); + return ResourceManager.GetString("InputValue_DefaultValue", resourceCulture); } } - /// - /// Looks up a localized string similar to The following {0}{1} `{2}` {3} declared multiple times on `{4}`.. - /// - internal static string ErrorHelper_DuplicateFieldName_Message { + internal static string InputValue_Description { get { - return ResourceManager.GetString("ErrorHelper_DuplicateFieldName_Message", resourceCulture); + return ResourceManager.GetString("InputValue_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The maximum number of nodes that can be fetched at once is {0}. This selection tried to fetch {1} nodes that exceeded the maximum allowed amount.. - /// - internal static string ErrorHelper_FetchedToManyNodesAtOnce { + internal static string InterfaceImplRule_ArgumentsDoNotMatch { get { - return ResourceManager.GetString("ErrorHelper_FetchedToManyNodesAtOnce", resourceCulture); + return ResourceManager.GetString("InterfaceImplRule_ArgumentsDoNotMatch", resourceCulture); } } - /// - /// Looks up a localized string similar to The field `{0}` must be implemented by {1} type `{2}`.. - /// - internal static string ErrorHelper_FieldNotImplemented { + internal static string InterfaceImplRule_ArgumentsNotImpl { get { - return ResourceManager.GetString("ErrorHelper_FieldNotImplemented", resourceCulture); + return ResourceManager.GetString("InterfaceImplRule_ArgumentsNotImpl", resourceCulture); } } - /// - /// Looks up a localized string similar to Cannot reference Input Object `{0}` within itself through a series of non-null fields `{1}`.. - /// - internal static string ErrorHelper_InputObjectMustNotHaveRecursiveNonNullableReferencesToSelf { + internal static string InterfaceImplRule_FieldNotImpl { get { - return ResourceManager.GetString("ErrorHelper_InputObjectMustNotHaveRecursiveNonNullableReferencesToSelf", resourceCulture); + return ResourceManager.GetString("InterfaceImplRule_FieldNotImpl", resourceCulture); } } - /// - /// Looks up a localized string similar to There is no object type implementing interface `{0}`.. - /// - internal static string ErrorHelper_InterfaceHasNoImplementation { + internal static string InterfaceImplRule_FieldTypeInvalid { get { - return ResourceManager.GetString("ErrorHelper_InterfaceHasNoImplementation", resourceCulture); + return ResourceManager.GetString("InterfaceImplRule_FieldTypeInvalid", resourceCulture); } } - /// - /// Looks up a localized string similar to The named argument `{0}` on field `{1}` must accept the same type `{2}` (invariant) as that named argument on the interface `{3}`.. - /// - internal static string ErrorHelper_InvalidArgumentType { + internal static string InterfaceImplRule_ReturnTypeInvalid { get { - return ResourceManager.GetString("ErrorHelper_InvalidArgumentType", resourceCulture); + return ResourceManager.GetString("InterfaceImplRule_ReturnTypeInvalid", resourceCulture); } } - /// - /// Looks up a localized string similar to Field `{0}` must return a type which is equal to or a subtype of (covariant) the return type `{1}` of the interface field.. - /// - internal static string ErrorHelper_InvalidFieldType { + internal static string InterfaceTypeExtension_CannotMerge { get { - return ResourceManager.GetString("ErrorHelper_InvalidFieldType", resourceCulture); + return ResourceManager.GetString("InterfaceTypeExtension_CannotMerge", resourceCulture); } } - /// - /// Looks up a localized string similar to The middleware pipeline order for the field `{0}` is invalid. Middleware order is important especially with data pipelines. The correct order of a data pipeline is as follows: UseDbContext -> UsePaging -> UseProjection -> UseFiltering -> UseSorting. You may omit any of these middleware or have other middleware in between but you need to abide by the overall order. Your order is: {1}.. - /// - internal static string ErrorHelper_MiddlewareOrderInvalid { + internal static string IntType_Description { get { - return ResourceManager.GetString("ErrorHelper_MiddlewareOrderInvalid", resourceCulture); + return ResourceManager.GetString("IntType_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The {0} type `{1}` has to at least define one field in order to be valid.. - /// - internal static string ErrorHelper_NeedsOneAtLeastField { + internal static string LongType_Description { get { - return ResourceManager.GetString("ErrorHelper_NeedsOneAtLeastField", resourceCulture); + return ResourceManager.GetString("LongType_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The node resolver `{0}` must specify exactly one argument.. - /// - internal static string ErrorHelper_NodeResolver_MustHaveExactlyOneIdArg { + internal static string NameType_Description { get { - return ResourceManager.GetString("ErrorHelper_NodeResolver_MustHaveExactlyOneIdArg", resourceCulture); + return ResourceManager.GetString("NameType_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The node resolver `{0}` must return an object type.. - /// - internal static string ErrorHelper_NodeResolver_MustReturnObject { + internal static string Name_Cannot_BeEmpty { get { - return ResourceManager.GetString("ErrorHelper_NodeResolver_MustReturnObject", resourceCulture); + return ResourceManager.GetString("Name_Cannot_BeEmpty", resourceCulture); } } - /// - /// Looks up a localized string similar to The type `{0}` implementing the node interface must expose an id field.. - /// - internal static string ErrorHelper_NodeResolver_NodeTypeHasNoId { + internal static string ObjectFieldDescriptorBase_FieldType { get { - return ResourceManager.GetString("ErrorHelper_NodeResolver_NodeTypeHasNoId", resourceCulture); + return ResourceManager.GetString("ObjectFieldDescriptorBase_FieldType", resourceCulture); } } - /// - /// Looks up a localized string similar to The type `{0}` implements the node interface but does not provide a node resolver for re-fetching.. - /// - internal static string ErrorHelper_NodeResolverMissing { + internal static string ObjectTypeDescriptor_InterfaceBaseClass { get { - return ResourceManager.GetString("ErrorHelper_NodeResolverMissing", resourceCulture); + return ResourceManager.GetString("ObjectTypeDescriptor_InterfaceBaseClass", resourceCulture); } } - /// - /// Looks up a localized string similar to The type {0} is invalid because the runtime type is a {1}. It is not supported to have type system members as runtime types.. - /// - internal static string ErrorHelper_NoSchemaTypesAllowedAsRuntimeType { + internal static string InterfaceTypeDescriptor_InterfaceBaseClass { get { - return ResourceManager.GetString("ErrorHelper_NoSchemaTypesAllowedAsRuntimeType", resourceCulture); + return ResourceManager.GetString("InterfaceTypeDescriptor_InterfaceBaseClass", resourceCulture); } } - /// - /// Looks up a localized string similar to The {0} type must also declare all interfaces declared by implemented interfaces.. - /// - internal static string ErrorHelper_NotTransitivelyImplemented { + internal static string ObjectTypeDescriptor_MustBePropertyOrMethod { get { - return ResourceManager.GetString("ErrorHelper_NotTransitivelyImplemented", resourceCulture); + return ResourceManager.GetString("ObjectTypeDescriptor_MustBePropertyOrMethod", resourceCulture); } } - /// - /// Looks up a localized string similar to The field `{0}.{1}` has no resolver.. - /// - internal static string ErrorHelper_ObjectField_HasNoResolver { + internal static string ObjectTypeDescriptor_ResolveWith_NonAbstract { get { - return ResourceManager.GetString("ErrorHelper_ObjectField_HasNoResolver", resourceCulture); + return ResourceManager.GetString("ObjectTypeDescriptor_ResolveWith_NonAbstract", resourceCulture); } } - /// - /// Looks up a localized string similar to Unable to infer or resolve the type of field {0}.{1}. Try to explicitly provide the type like the following: `descriptor.Field("field").Type<List<StringType>>()`.. - /// - internal static string ErrorHelper_ObjectType_UnableToInferOrResolveType { + internal static string NodeDescriptor_MustBeMethod { get { - return ResourceManager.GetString("ErrorHelper_ObjectType_UnableToInferOrResolveType", resourceCulture); + return ResourceManager.GetString("NodeDescriptor_MustBeMethod", resourceCulture); } } - /// - /// Looks up a localized string similar to Oneof Input Object `{0}` must only have nullable fields without default values. Edit your type and make the field{1} `{2}` nullable and remove any defaults.. - /// - internal static string ErrorHelper_OneofInputObjectMustHaveNullableFieldsWithoutDefaults { + internal static string NodeDescriptor_IdMember { get { - return ResourceManager.GetString("ErrorHelper_OneofInputObjectMustHaveNullableFieldsWithoutDefaults", resourceCulture); + return ResourceManager.GetString("NodeDescriptor_IdMember", resourceCulture); } } - /// - /// Looks up a localized string similar to There is no node resolver registered for type `{0}`.. - /// - internal static string ErrorHelper_Relay_NoNodeResolver { + internal static string ObjectTypeDescriptor_Resolver_SchemaType { get { - return ResourceManager.GetString("ErrorHelper_Relay_NoNodeResolver", resourceCulture); + return ResourceManager.GetString("ObjectTypeDescriptor_Resolver_SchemaType", resourceCulture); } } - /// - /// Looks up a localized string similar to Required argument {0} cannot be deprecated.. - /// - internal static string ErrorHelper_RequiredArgumentCannotBeDeprecated { + internal static string Reflection_MemberMust_BeMethodOrProperty { get { - return ResourceManager.GetString("ErrorHelper_RequiredArgumentCannotBeDeprecated", resourceCulture); + return ResourceManager.GetString("Reflection_MemberMust_BeMethodOrProperty", resourceCulture); } } - /// - /// Looks up a localized string similar to Required input field {0} cannot be deprecated.. - /// - internal static string ErrorHelper_RequiredFieldCannotBeDeprecated { + internal static string ResolverCompiler_UnknownParameterType { get { - return ResourceManager.GetString("ErrorHelper_RequiredFieldCannotBeDeprecated", resourceCulture); + return ResourceManager.GetString("ResolverCompiler_UnknownParameterType", resourceCulture); } } - /// - /// Looks up a localized string similar to Field names starting with `__` are reserved for the GraphQL specification.. - /// - internal static string ErrorHelper_TwoUnderscoresNotAllowedField { + internal static string ResolverTypeBindingBuilder_FieldBuilderNotSupported { get { - return ResourceManager.GetString("ErrorHelper_TwoUnderscoresNotAllowedField", resourceCulture); + return ResourceManager.GetString("ResolverTypeBindingBuilder_FieldBuilderNotSupported", resourceCulture); } } - /// - /// Looks up a localized string similar to Argument names starting with `__` are reserved for the GraphQL specification.. - /// - internal static string ErrorHelper_TwoUnderscoresNotAllowedOnArgument { + internal static string ResolverTypeBindingBuilder_FieldNotComplete { get { - return ResourceManager.GetString("ErrorHelper_TwoUnderscoresNotAllowedOnArgument", resourceCulture); + return ResourceManager.GetString("ResolverTypeBindingBuilder_FieldNotComplete", resourceCulture); } } - /// - /// Looks up a localized string similar to Names starting with `__` are reserved for the GraphQL specification.. - /// - internal static string ErrorHelper_TwoUnderscoresNotAllowedOnDirectiveName { + internal static string Scalar_Cannot_Deserialize { get { - return ResourceManager.GetString("ErrorHelper_TwoUnderscoresNotAllowedOnDirectiveName", resourceCulture); + return ResourceManager.GetString("Scalar_Cannot_Deserialize", resourceCulture); } } - /// - /// Looks up a localized string similar to The event message parameter can only be used in a subscription context.. - /// - internal static string EventMessageParameterExpressionBuilder_MessageNotFound { + internal static string Scalar_Cannot_ParseLiteral { get { - return ResourceManager.GetString("EventMessageParameterExpressionBuilder_MessageNotFound", resourceCulture); + return ResourceManager.GetString("Scalar_Cannot_ParseLiteral", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified key `{0}` does not exist on `context.ContextData`.. - /// - internal static string ExpressionHelper_GetGlobalStateWithDefault_NoDefaults { + internal static string Scalar_Cannot_ParseValue { get { - return ResourceManager.GetString("ExpressionHelper_GetGlobalStateWithDefault_NoDefaults", resourceCulture); + return ResourceManager.GetString("Scalar_Cannot_ParseValue", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified key `{0}` does not exist on `context.ScopedContextData`.. - /// - internal static string ExpressionHelper_GetScopedStateWithDefault_NoDefaultValue { + internal static string Scalar_Cannot_Serialize { get { - return ResourceManager.GetString("ExpressionHelper_GetScopedStateWithDefault_NoDefaultValue", resourceCulture); + return ResourceManager.GetString("Scalar_Cannot_Serialize", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified context key does not exist.. - /// - internal static string ExpressionHelper_ResolveScopedContextData_KeyDoesNotExist { + internal static string SchemaBuilderExtensions_DirectiveTypeIsBaseType { get { - return ResourceManager.GetString("ExpressionHelper_ResolveScopedContextData_KeyDoesNotExist", resourceCulture); + return ResourceManager.GetString("SchemaBuilderExtensions_DirectiveTypeIsBaseType", resourceCulture); } } - /// - /// Looks up a localized string similar to The non-generic IExecutable interface cannot be used as a type in the schema.. - /// - internal static string ExtendedTypeReferenceHandler_NonGenericExecutableNotAllowed { + internal static string SchemaBuilderExtensions_MustBeDirectiveType { get { - return ResourceManager.GetString("ExtendedTypeReferenceHandler_NonGenericExecutableNotAllowed", resourceCulture); + return ResourceManager.GetString("SchemaBuilderExtensions_MustBeDirectiveType", resourceCulture); } } - /// - /// Looks up a localized string similar to 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.. - /// - internal static string Field_Description { + internal static string SchemaBuilderExtensions_SchemaIsEmpty { get { - return ResourceManager.GetString("Field_Description", resourceCulture); + return ResourceManager.GetString("SchemaBuilderExtensions_SchemaIsEmpty", resourceCulture); } } - /// - /// Looks up a localized string similar to The max expected field count cannot be smaller than 1.. - /// - internal static string FieldInitHelper_CompleteFields_MaxFieldCountToSmall { + internal static string SchemaBuilder_Binding_CannotBeHandled { get { - return ResourceManager.GetString("FieldInitHelper_CompleteFields_MaxFieldCountToSmall", resourceCulture); + return ResourceManager.GetString("SchemaBuilder_Binding_CannotBeHandled", resourceCulture); } } - /// - /// Looks up a localized string similar to Could not parse the native value of input field `{0}`.. - /// - internal static string FieldInitHelper_InvalidDefaultValue { + internal static string SchemaBuilder_Binding_Invalid { get { - return ResourceManager.GetString("FieldInitHelper_InvalidDefaultValue", resourceCulture); + return ResourceManager.GetString("SchemaBuilder_Binding_Invalid", resourceCulture); } } - /// - /// Looks up a localized string similar to {0} `{1}` has no fields declared.. - /// - internal static string FieldInitHelper_NoFields { + internal static string SchemaBuilder_ISchemaNotTso { get { - return ResourceManager.GetString("FieldInitHelper_NoFields", resourceCulture); + return ResourceManager.GetString("SchemaBuilder_ISchemaNotTso", resourceCulture); } } - /// - /// Looks up a localized string similar to The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).. - /// - internal static string FloatType_Description { + internal static string SchemaBuilder_NoQueryType { get { - return ResourceManager.GetString("FloatType_Description", resourceCulture); + return ResourceManager.GetString("SchemaBuilder_NoQueryType", resourceCulture); } } - /// - /// Looks up a localized string similar to Unable to decode the id string.. - /// - internal static string IdSerializer_UnableToDecode { + internal static string SchemaBuilder_RootType_MustBeClass { get { - return ResourceManager.GetString("IdSerializer_UnableToDecode", resourceCulture); + return ResourceManager.GetString("SchemaBuilder_RootType_MustBeClass", resourceCulture); } } - /// - /// Looks up a localized string similar to Unable to encode data.. - /// - internal static string IdSerializer_UnableToEncode { + internal static string SchemaBuilder_RootType_MustBeObjectType { get { - return ResourceManager.GetString("IdSerializer_UnableToEncode", resourceCulture); + return ResourceManager.GetString("SchemaBuilder_RootType_MustBeObjectType", resourceCulture); } } - /// - /// Looks up a localized string similar to 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.. - /// - internal static string IdType_Description { + internal static string SchemaBuilder_RootType_NonGenericType { get { - return ResourceManager.GetString("IdType_Description", resourceCulture); + return ResourceManager.GetString("SchemaBuilder_RootType_NonGenericType", resourceCulture); } } - /// - /// Looks up a localized string similar to Included when true.. - /// - internal static string IncludeDirectiveType_IfDescription { + internal static string SchemaBuilder_SchemaTypeInvalid { get { - return ResourceManager.GetString("IncludeDirectiveType_IfDescription", resourceCulture); + return ResourceManager.GetString("SchemaBuilder_SchemaTypeInvalid", resourceCulture); } } - /// - /// Looks up a localized string similar to Directs the executor to include this field or fragment only when the `if` argument is true.. - /// - internal static string IncludeDirectiveType_TypeDescription { + internal static string SchemaErrorBuilder_MessageIsNull { get { - return ResourceManager.GetString("IncludeDirectiveType_TypeDescription", resourceCulture); + return ResourceManager.GetString("SchemaErrorBuilder_MessageIsNull", resourceCulture); } } - /// - /// Looks up a localized string similar to Unable to set the input field value.. - /// - internal static string InputField_CannotSetValue { + internal static string SchemaField_Description { get { - return ResourceManager.GetString("InputField_CannotSetValue", resourceCulture); + return ResourceManager.GetString("SchemaField_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The input object type can only parse object value literals.. - /// - internal static string InputObjectType_CannotParseLiteral { + internal static string SchemaSyntaxVisitor_UnknownOperationType { get { - return ResourceManager.GetString("InputObjectType_CannotParseLiteral", resourceCulture); + return ResourceManager.GetString("SchemaSyntaxVisitor_UnknownOperationType", resourceCulture); } } - /// - /// Looks up a localized string similar to The input object `{0}` does not have any fields.. - /// - internal static string InputObjectType_NoFields { + internal static string Schema_Description { get { - return ResourceManager.GetString("InputObjectType_NoFields", resourceCulture); + return ResourceManager.GetString("Schema_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to Only properties are allowed for input types.. - /// - internal static string InputObjectTypeDescriptor_OnlyProperties { + internal static string Schema_Directives { get { - return ResourceManager.GetString("InputObjectTypeDescriptor_OnlyProperties", resourceCulture); + return ResourceManager.GetString("Schema_Directives", resourceCulture); } } - /// - /// Looks up a localized string similar to The input object type extension can only be merged with an input object type.. - /// - internal static string InputObjectTypeExtension_CannotMerge { + internal static string Schema_MutationType { get { - return ResourceManager.GetString("InputObjectTypeExtension_CannotMerge", resourceCulture); + return ResourceManager.GetString("Schema_MutationType", resourceCulture); } } - /// - /// Looks up a localized string similar to The input value of type `{0}` must not be null.. - /// - internal static string InputTypeNonNullCheck_ValueIsNull { + internal static string Schema_QueryType { get { - return ResourceManager.GetString("InputTypeNonNullCheck_ValueIsNull", resourceCulture); + return ResourceManager.GetString("Schema_QueryType", resourceCulture); } } - /// - /// Looks up a localized string similar to A GraphQL-formatted string representing the default value for this input value.. - /// - internal static string InputValue_DefaultValue { + internal static string Schema_SubscriptionType { get { - return ResourceManager.GetString("InputValue_DefaultValue", resourceCulture); + return ResourceManager.GetString("Schema_SubscriptionType", resourceCulture); + } + } + + internal static string Schema_Types { + get { + return ResourceManager.GetString("Schema_Types", resourceCulture); + } + } + + internal static string ShortType_Description { + get { + return ResourceManager.GetString("ShortType_Description", resourceCulture); + } + } + + internal static string StringType_Description { + get { + return ResourceManager.GetString("StringType_Description", resourceCulture); + } + } + + internal static string String_Argument_NullOrEmpty { + get { + return ResourceManager.GetString("String_Argument_NullOrEmpty", resourceCulture); + } + } + + internal static string TypeConfiguration_ConfigureIsNull { + get { + return ResourceManager.GetString("TypeConfiguration_ConfigureIsNull", resourceCulture); + } + } + + internal static string TypeConfiguration_DefinitionIsNull { + get { + return ResourceManager.GetString("TypeConfiguration_DefinitionIsNull", resourceCulture); + } + } + + internal static string TypeDependency_MustBeSchemaType { + get { + return ResourceManager.GetString("TypeDependency_MustBeSchemaType", resourceCulture); + } + } + + internal static string TypeExtensions_InvalidStructure { + get { + return ResourceManager.GetString("TypeExtensions_InvalidStructure", resourceCulture); + } + } + + internal static string TypeExtensions_KindIsNotSupported { + get { + return ResourceManager.GetString("TypeExtensions_KindIsNotSupported", resourceCulture); + } + } + + internal static string TypeExtensions_NoListType { + get { + return ResourceManager.GetString("TypeExtensions_NoListType", resourceCulture); + } + } + + internal static string TypeExtensions_TypeIsNotOfT { + get { + return ResourceManager.GetString("TypeExtensions_TypeIsNotOfT", resourceCulture); + } + } + + internal static string TypeField_Description { + get { + return ResourceManager.GetString("TypeField_Description", resourceCulture); + } + } + + internal static string TypeInitializer_CannotResolveDependency { + get { + return ResourceManager.GetString("TypeInitializer_CannotResolveDependency", resourceCulture); + } + } + + internal static string TypeInitializer_CompleteName_Duplicate { + get { + return ResourceManager.GetString("TypeInitializer_CompleteName_Duplicate", resourceCulture); + } + } + + internal static string TypeInitializer_Merge_KindDoesNotMatch { + get { + return ResourceManager.GetString("TypeInitializer_Merge_KindDoesNotMatch", resourceCulture); + } + } + + internal static string TypeKind_Description { + get { + return ResourceManager.GetString("TypeKind_Description", resourceCulture); + } + } + + internal static string TypeKind_Enum { + get { + return ResourceManager.GetString("TypeKind_Enum", resourceCulture); + } + } + + internal static string TypeKind_InputObject { + get { + return ResourceManager.GetString("TypeKind_InputObject", resourceCulture); + } + } + + internal static string TypeKind_Interface { + get { + return ResourceManager.GetString("TypeKind_Interface", resourceCulture); + } + } + + internal static string TypeKind_List { + get { + return ResourceManager.GetString("TypeKind_List", resourceCulture); + } + } + + internal static string TypeKind_NonNull { + get { + return ResourceManager.GetString("TypeKind_NonNull", resourceCulture); + } + } + + internal static string TypeKind_Object { + get { + return ResourceManager.GetString("TypeKind_Object", resourceCulture); + } + } + + internal static string TypeKind_Scalar { + get { + return ResourceManager.GetString("TypeKind_Scalar", resourceCulture); + } + } + + internal static string TypeKind_Union { + get { + return ResourceManager.GetString("TypeKind_Union", resourceCulture); + } + } + + internal static string TypeNameField_Description { + get { + return ResourceManager.GetString("TypeNameField_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to 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.. - /// - internal static string InputValue_Description { + internal static string TypeNameHelper_InvalidTypeStructure { get { - return ResourceManager.GetString("InputValue_Description", resourceCulture); + return ResourceManager.GetString("TypeNameHelper_InvalidTypeStructure", resourceCulture); } } - /// - /// Looks up a localized string similar to The arguments of the interface field {0} from interface {1} and {2} do not match and are implemented by object type {3}.. - /// - internal static string InterfaceImplRule_ArgumentsDoNotMatch { + internal static string TypeNameHelper_OnlyTypeSystemObjectsAreAllowed { get { - return ResourceManager.GetString("InterfaceImplRule_ArgumentsDoNotMatch", resourceCulture); + return ResourceManager.GetString("TypeNameHelper_OnlyTypeSystemObjectsAreAllowed", resourceCulture); } } - /// - /// Looks up a localized string similar to Object type {0} does not implement all arguments of field {1} from interface {2}.. - /// - internal static string InterfaceImplRule_ArgumentsNotImpl { + internal static string TypeResourceHelper_TypeNameEmptyOrNull { get { - return ResourceManager.GetString("InterfaceImplRule_ArgumentsNotImpl", resourceCulture); + return ResourceManager.GetString("TypeResourceHelper_TypeNameEmptyOrNull", resourceCulture); } } - /// - /// Looks up a localized string similar to Object type {0} does not implement the field {1} from interface {2}.. - /// - internal static string InterfaceImplRule_FieldNotImpl { + internal static string Type_Description { get { - return ResourceManager.GetString("InterfaceImplRule_FieldNotImpl", resourceCulture); + return ResourceManager.GetString("Type_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The return type of the interface field {0} from interface {1} and {2} do not match and are implemented by object type {3}.. - /// - internal static string InterfaceImplRule_FieldTypeInvalid { + internal static string UnionTypeExtension_CannotMerge { get { - return ResourceManager.GetString("InterfaceImplRule_FieldTypeInvalid", resourceCulture); + return ResourceManager.GetString("UnionTypeExtension_CannotMerge", resourceCulture); } } - /// - /// Looks up a localized string similar to The return type of the interface field {0} does not match the field declared by object type {1}.. - /// - internal static string InterfaceImplRule_ReturnTypeInvalid { + internal static string VariableValueBuilder_InputType { get { - return ResourceManager.GetString("InterfaceImplRule_ReturnTypeInvalid", resourceCulture); + return ResourceManager.GetString("VariableValueBuilder_InputType", resourceCulture); } } - /// - /// Looks up a localized string similar to The interface base class cannot be used as interface implementation declaration.. - /// - internal static string InterfaceTypeDescriptor_InterfaceBaseClass { + internal static string VariableValueBuilder_InvalidValue { get { - return ResourceManager.GetString("InterfaceTypeDescriptor_InterfaceBaseClass", resourceCulture); + return ResourceManager.GetString("VariableValueBuilder_InvalidValue", resourceCulture); } } - /// - /// Looks up a localized string similar to A field of an interface can only be inferred from a property or a method.. - /// - internal static string InterfaceTypeDescriptor_MustBePropertyOrMethod { + internal static string VariableValueBuilder_NodeKind { get { - return ResourceManager.GetString("InterfaceTypeDescriptor_MustBePropertyOrMethod", resourceCulture); + return ResourceManager.GetString("VariableValueBuilder_NodeKind", resourceCulture); } } - /// - /// Looks up a localized string similar to The interface type extension can only be merged with an interface type.. - /// - internal static string InterfaceTypeExtension_CannotMerge { + internal static string VariableValueBuilder_NonNull { get { - return ResourceManager.GetString("InterfaceTypeExtension_CannotMerge", resourceCulture); + return ResourceManager.GetString("VariableValueBuilder_NonNull", resourceCulture); } } - /// - /// Looks up a localized string similar to The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.. - /// - internal static string IntType_Description { + internal static string VariableValueBuilder_NonNull_In_Graph { get { - return ResourceManager.GetString("IntType_Description", resourceCulture); + return ResourceManager.GetString("VariableValueBuilder_NonNull_In_Graph", resourceCulture); } } - /// - /// Looks up a localized string similar to The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1.. - /// - internal static string LongType_Description { + internal static string VariableValueBuilder_VarNameEmpty { get { - return ResourceManager.GetString("LongType_Description", resourceCulture); + return ResourceManager.GetString("VariableValueBuilder_VarNameEmpty", resourceCulture); } } - /// - /// Looks up a localized string similar to The multiplier path scalar represents a valid GraphQL multiplier path string.. - /// - internal static string Name_Cannot_BeEmpty { + internal static string Argument_TypeIsNull { get { - return ResourceManager.GetString("Name_Cannot_BeEmpty", resourceCulture); + return ResourceManager.GetString("Argument_TypeIsNull", resourceCulture); } } - /// - /// Looks up a localized string similar to The name scalar represents a valid GraphQL name as specified in the spec and can be used to refer to fields or types.. - /// - internal static string NameType_Description { + internal static string NonNullType_NotAnInputType { get { - return ResourceManager.GetString("NameType_Description", resourceCulture); + return ResourceManager.GetString("NonNullType_NotAnInputType", resourceCulture); } } - /// - /// Looks up a localized string similar to The ID field must be a property or a method.. - /// - internal static string NodeDescriptor_IdField_MustBePropertyOrMethod { + internal static string NonNullType_TypeIsNunNullType { get { - return ResourceManager.GetString("NodeDescriptor_IdField_MustBePropertyOrMethod", resourceCulture); + return ResourceManager.GetString("NonNullType_TypeIsNunNullType", resourceCulture); } } - /// - /// Looks up a localized string similar to An ID-member must be a property-expression or a method-call-expression.. - /// - internal static string NodeDescriptor_IdMember { + internal static string NonNullType_ValueIsNull { get { - return ResourceManager.GetString("NodeDescriptor_IdMember", resourceCulture); + return ResourceManager.GetString("NonNullType_ValueIsNull", resourceCulture); } } - /// - /// Looks up a localized string similar to A node-resolver-expression must be a method-call-expression.. - /// - internal static string NodeDescriptor_MustBeMethod { + internal static string ObjectTypeExtension_CannotMerge { get { - return ResourceManager.GetString("NodeDescriptor_MustBeMethod", resourceCulture); + return ResourceManager.GetString("ObjectTypeExtension_CannotMerge", resourceCulture); } } - /// - /// Looks up a localized string similar to The node interface is implemented by entities that have a global unique identifier.. - /// - internal static string NodeType_TypeDescription { + internal static string TypeSystemObjectBase_DefinitionIsNull { get { - return ResourceManager.GetString("NodeType_TypeDescription", resourceCulture); + return ResourceManager.GetString("TypeSystemObjectBase_DefinitionIsNull", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified type is not an input type.. - /// - internal static string NonNamedType_IsInstanceOfType_NotAnInputType { + internal static string TypeSystemObjectBase_NameIsNull { get { - return ResourceManager.GetString("NonNamedType_IsInstanceOfType_NotAnInputType", resourceCulture); + return ResourceManager.GetString("TypeSystemObjectBase_NameIsNull", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified type is not an input type.. - /// - internal static string NonNullType_NotAnInputType { + internal static string TypeSystemObject_DescriptionImmutable { get { - return ResourceManager.GetString("NonNullType_NotAnInputType", resourceCulture); + return ResourceManager.GetString("TypeSystemObject_DescriptionImmutable", resourceCulture); } } - /// - /// Looks up a localized string similar to The inner type of non-null type must be a nullable type.. - /// - internal static string NonNullType_TypeIsNunNullType { + internal static string TypeSystemObject_NameImmutable { get { - return ResourceManager.GetString("NonNullType_TypeIsNunNullType", resourceCulture); + return ResourceManager.GetString("TypeSystemObject_NameImmutable", resourceCulture); } } - /// - /// Looks up a localized string similar to A non null type cannot parse null value literals.. - /// - internal static string NonNullType_ValueIsNull { + internal static string UnionType_MustHaveTypes { get { - return ResourceManager.GetString("NonNullType_ValueIsNull", resourceCulture); + return ResourceManager.GetString("UnionType_MustHaveTypes", resourceCulture); } } - /// - /// Looks up a localized string similar to The field-type must be an output-type.. - /// - internal static string ObjectFieldDescriptorBase_FieldType { + internal static string UnionType_UnableToResolveType { get { - return ResourceManager.GetString("ObjectFieldDescriptorBase_FieldType", resourceCulture); + return ResourceManager.GetString("UnionType_UnableToResolveType", resourceCulture); } } - /// - /// Looks up a localized string similar to Cycle in object graph detected.. - /// - internal static string ObjectToDictionaryConverter_CycleInObjectGraph { + internal static string SchemaBuilder_MustBeSchemaType { get { - return ResourceManager.GetString("ObjectToDictionaryConverter_CycleInObjectGraph", resourceCulture); + return ResourceManager.GetString("SchemaBuilder_MustBeSchemaType", resourceCulture); } } - /// - /// Looks up a localized string similar to The interface base class cannot be used as interface implementation declaration.. - /// - internal static string ObjectTypeDescriptor_InterfaceBaseClass { + internal static string TypeRegistrar_TypesInconsistent { get { - return ResourceManager.GetString("ObjectTypeDescriptor_InterfaceBaseClass", resourceCulture); + return ResourceManager.GetString("TypeRegistrar_TypesInconsistent", resourceCulture); } } - /// - /// Looks up a localized string similar to A field-expression must be a property-expression or a method-call-expression.. - /// - internal static string ObjectTypeDescriptor_MustBePropertyOrMethod { + internal static string TypeConversion_ConvertNotSupported { get { - return ResourceManager.GetString("ObjectTypeDescriptor_MustBePropertyOrMethod", resourceCulture); + return ResourceManager.GetString("TypeConversion_ConvertNotSupported", resourceCulture); } } - /// - /// Looks up a localized string similar to Schema types cannot be used as resolver types.. - /// - internal static string ObjectTypeDescriptor_Resolver_SchemaType { + internal static string SchemaBuilder_Interceptor_NotSupported { get { - return ResourceManager.GetString("ObjectTypeDescriptor_Resolver_SchemaType", resourceCulture); + return ResourceManager.GetString("SchemaBuilder_Interceptor_NotSupported", resourceCulture); } } - /// - /// Looks up a localized string similar to The resolver type {0} cannot be used, a non-abstract type is required.. - /// - internal static string ObjectTypeDescriptor_ResolveWith_NonAbstract { + internal static string IdSerializer_UnableToEncode { get { - return ResourceManager.GetString("ObjectTypeDescriptor_ResolveWith_NonAbstract", resourceCulture); + return ResourceManager.GetString("IdSerializer_UnableToEncode", resourceCulture); } } - /// - /// Looks up a localized string similar to The object type extension can only be merged with an object type.. - /// - internal static string ObjectTypeExtension_CannotMerge { + internal static string IdSerializer_UnableToDecode { get { - return ResourceManager.GetString("ObjectTypeExtension_CannotMerge", resourceCulture); + return ResourceManager.GetString("IdSerializer_UnableToDecode", resourceCulture); } } - /// - /// Looks up a localized string similar to The `@oneOf` directive is used within the type system definition language - /// to indicate: - /// - /// - an Input Object is a Oneof Input Object, or - /// - an Object Type's Field is a Oneof Field.. - /// - internal static string OneOfDirectiveType_Description { + internal static string SchemaBuilder_Convention_NotSupported { get { - return ResourceManager.GetString("OneOfDirectiveType_Description", resourceCulture); + return ResourceManager.GetString("SchemaBuilder_Convention_NotSupported", resourceCulture); } } - /// - /// Looks up a localized string similar to The member expression must specify a property or method that is public and that belongs to the type {0}. - /// - internal static string Reflection_MemberMust_BeMethodOrProperty { + internal static string TimeSpanType_Description { get { - return ResourceManager.GetString("Reflection_MemberMust_BeMethodOrProperty", resourceCulture); + return ResourceManager.GetString("TimeSpanType_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to Member is not a method!. - /// - internal static string ReflectionUtils_ExtractMethod_MethodExpected { + internal static string DefaultDataLoaderRegistry_GetOrRegister { get { - return ResourceManager.GetString("ReflectionUtils_ExtractMethod_MethodExpected", resourceCulture); + return ResourceManager.GetString("DefaultDataLoaderRegistry_GetOrRegister", resourceCulture); } } - /// - /// Looks up a localized string similar to The object is not yet ready for this action.. - /// - internal static string RegisteredType_Completion_NotYetReady { + internal static string DataLoaderResolverContextExtensions_CreateDataLoader_AbstractType { get { - return ResourceManager.GetString("RegisteredType_Completion_NotYetReady", resourceCulture); + return ResourceManager.GetString("DataLoaderResolverContextExtensions_CreateDataLoader_AbstractType", resourceCulture); } } - /// - /// Looks up a localized string similar to The completion context can only be set once.. - /// - internal static string RegisteredType_CompletionContext_Already_Set { + internal static string DataLoaderResolverContextExtensions_CreateDataLoader_UnableToCreate { get { - return ResourceManager.GetString("RegisteredType_CompletionContext_Already_Set", resourceCulture); + return ResourceManager.GetString("DataLoaderResolverContextExtensions_CreateDataLoader_UnableToCreate", resourceCulture); } } - /// - /// Looks up a localized string similar to The completion context has not been initialized.. - /// - internal static string RegisteredType_CompletionContext_Not_Initialized { + internal static string NonNamedType_IsInstanceOfType_NotAnInputType { get { - return ResourceManager.GetString("RegisteredType_CompletionContext_Not_Initialized", resourceCulture); + return ResourceManager.GetString("NonNamedType_IsInstanceOfType_NotAnInputType", resourceCulture); } } - /// - /// Looks up a localized string similar to Fetches an object given its ID.. - /// - internal static string Relay_NodeField_Description { + internal static string RegisteredType_CompletionContext_Not_Initialized { get { - return ResourceManager.GetString("Relay_NodeField_Description", resourceCulture); + return ResourceManager.GetString("RegisteredType_CompletionContext_Not_Initialized", resourceCulture); } } - /// - /// Looks up a localized string similar to ID of the object.. - /// - internal static string Relay_NodeField_Id_Description { + internal static string RegisteredType_CompletionContext_Already_Set { get { - return ResourceManager.GetString("Relay_NodeField_Id_Description", resourceCulture); + return ResourceManager.GetString("RegisteredType_CompletionContext_Already_Set", resourceCulture); } } - /// - /// Looks up a localized string similar to Lookup nodes by a list of IDs.. - /// - internal static string Relay_NodesField_Description { + internal static string DeferDirectiveType_Description { get { - return ResourceManager.GetString("Relay_NodesField_Description", resourceCulture); + return ResourceManager.GetString("DeferDirectiveType_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The list of node IDs.. - /// - internal static string Relay_NodesField_Ids_Description { + internal static string DeferDirectiveType_Label_Description { get { - return ResourceManager.GetString("Relay_NodesField_Ids_Description", resourceCulture); + return ResourceManager.GetString("DeferDirectiveType_Label_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to A directive type mustn't be one of the base classes `DirectiveType` or `DirectiveType<T>` but must be a type inheriting from `DirectiveType` or `DirectiveType<T>`.. - /// - internal static string ResolverCompiler_UnknownParameterType { + internal static string DeferDirectiveType_If_Description { get { - return ResourceManager.GetString("ResolverCompiler_UnknownParameterType", resourceCulture); + return ResourceManager.GetString("DeferDirectiveType_If_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified key `{0}` does not exist on `context.ContextData`. - /// - internal static string ResolverContextExtensions_ContextData_KeyNotFound { + internal static string StreamDirectiveType_Description { get { - return ResourceManager.GetString("ResolverContextExtensions_ContextData_KeyNotFound", resourceCulture); + return ResourceManager.GetString("StreamDirectiveType_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The field name mustn't be null, empty or consist only of white spaces.. - /// - internal static string ResolverContextExtensions_IsSelected_FieldNameEmpty { + internal static string StreamDirectiveType_Label_Description { get { - return ResourceManager.GetString("ResolverContextExtensions_IsSelected_FieldNameEmpty", resourceCulture); + return ResourceManager.GetString("StreamDirectiveType_Label_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified key `{0}` does not exist on `context.LocalContextData`. - /// - internal static string ResolverContextExtensions_LocalContextData_KeyNotFound { + internal static string StreamDirectiveType_InitialCount_Description { get { - return ResourceManager.GetString("ResolverContextExtensions_LocalContextData_KeyNotFound", resourceCulture); + return ResourceManager.GetString("StreamDirectiveType_InitialCount_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified key `{0}` does not exist on `context.ScopedContextData`. - /// - internal static string ResolverContextExtensions_ScopedContextData_KeyNotFound { + internal static string StreamDirectiveType_If_Description { get { - return ResourceManager.GetString("ResolverContextExtensions_ScopedContextData_KeyNotFound", resourceCulture); + return ResourceManager.GetString("StreamDirectiveType_If_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified IResolverFieldBindingBuilder-implementation is not supported.. - /// - internal static string ResolverTypeBindingBuilder_FieldBuilderNotSupported { + internal static string SchemaBuilder_AddRootType_TypeAlreadyRegistered { get { - return ResourceManager.GetString("ResolverTypeBindingBuilder_FieldBuilderNotSupported", resourceCulture); + return ResourceManager.GetString("SchemaBuilder_AddRootType_TypeAlreadyRegistered", resourceCulture); } } - /// - /// Looks up a localized string similar to The field binding builder is not completed and cannot be added.. - /// - internal static string ResolverTypeBindingBuilder_FieldNotComplete { + internal static string NodeDescriptor_IdField_MustBePropertyOrMethod { get { - return ResourceManager.GetString("ResolverTypeBindingBuilder_FieldNotComplete", resourceCulture); + return ResourceManager.GetString("NodeDescriptor_IdField_MustBePropertyOrMethod", resourceCulture); } } - /// - /// Looks up a localized string similar to {0} cannot deserialize the given value.. - /// - internal static string Scalar_Cannot_Deserialize { + internal static string DeprecatedDirectiveType_TypeDescription { get { - return ResourceManager.GetString("Scalar_Cannot_Deserialize", resourceCulture); + return ResourceManager.GetString("DeprecatedDirectiveType_TypeDescription", resourceCulture); } } - /// - /// Looks up a localized string similar to {0} cannot parse the given literal of type `{1}`.. - /// - internal static string Scalar_Cannot_ParseLiteral { + internal static string DeprecatedDirectiveType_ReasonDescription { get { - return ResourceManager.GetString("Scalar_Cannot_ParseLiteral", resourceCulture); + return ResourceManager.GetString("DeprecatedDirectiveType_ReasonDescription", resourceCulture); } } - /// - /// Looks up a localized string similar to {0} cannot parse the given value of type `{1}`.. - /// - internal static string Scalar_Cannot_ParseValue { + internal static string IncludeDirectiveType_TypeDescription { get { - return ResourceManager.GetString("Scalar_Cannot_ParseValue", resourceCulture); + return ResourceManager.GetString("IncludeDirectiveType_TypeDescription", resourceCulture); } } - /// - /// Looks up a localized string similar to {0} cannot serialize the given value.. - /// - internal static string Scalar_Cannot_Serialize { + internal static string IncludeDirectiveType_IfDescription { get { - return ResourceManager.GetString("Scalar_Cannot_Serialize", resourceCulture); + return ResourceManager.GetString("IncludeDirectiveType_IfDescription", resourceCulture); } } - /// - /// Looks up a localized string similar to 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.. - /// - internal static string Schema_Description { + internal static string SkipDirectiveType_TypeDescription { get { - return ResourceManager.GetString("Schema_Description", resourceCulture); + return ResourceManager.GetString("SkipDirectiveType_TypeDescription", resourceCulture); } } - /// - /// Looks up a localized string similar to A list of all directives supported by this server.. - /// - internal static string Schema_Directives { + internal static string SkipDirectiveType_IfDescription { get { - return ResourceManager.GetString("Schema_Directives", resourceCulture); + return ResourceManager.GetString("SkipDirectiveType_IfDescription", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified type `{0}` does not exist.. - /// - internal static string Schema_GetDirectiveType_DoesNotExist { + internal static string SpecifiedByDirectiveType_TypeDescription { get { - return ResourceManager.GetString("Schema_GetDirectiveType_DoesNotExist", resourceCulture); + return ResourceManager.GetString("SpecifiedByDirectiveType_TypeDescription", resourceCulture); } } - /// - /// Looks up a localized string similar to If this server supports mutation, the type that mutation operations will be rooted at.. - /// - internal static string Schema_MutationType { + internal static string SpecifiedByDirectiveType_UrlDescription { get { - return ResourceManager.GetString("Schema_MutationType", resourceCulture); + return ResourceManager.GetString("SpecifiedByDirectiveType_UrlDescription", resourceCulture); } } - /// - /// Looks up a localized string similar to The type that query operations will be rooted at.. - /// - internal static string Schema_QueryType { + internal static string NodeType_TypeDescription { get { - return ResourceManager.GetString("Schema_QueryType", resourceCulture); + return ResourceManager.GetString("NodeType_TypeDescription", resourceCulture); } } - /// - /// Looks up a localized string similar to If this server support subscription, the type that subscription operations will be rooted at.. - /// - internal static string Schema_SubscriptionType { + internal static string AnyType_CycleInObjectGraph { get { - return ResourceManager.GetString("Schema_SubscriptionType", resourceCulture); + return ResourceManager.GetString("AnyType_CycleInObjectGraph", resourceCulture); } } - /// - /// Looks up a localized string similar to A list of all types supported by this server.. - /// - internal static string Schema_Types { + internal static string UuidType_FormatUnknown { get { - return ResourceManager.GetString("Schema_Types", resourceCulture); + return ResourceManager.GetString("UuidType_FormatUnknown", resourceCulture); } } - /// - /// Looks up a localized string similar to The root type `{0}` has already been registered.. - /// - internal static string SchemaBuilder_AddRootType_TypeAlreadyRegistered { + internal static string Directive_GetArgument_ArgumentNameIsInvalid { get { - return ResourceManager.GetString("SchemaBuilder_AddRootType_TypeAlreadyRegistered", resourceCulture); + return ResourceManager.GetString("Directive_GetArgument_ArgumentNameIsInvalid", resourceCulture); } } - /// - /// Looks up a localized string similar to There is no handler registered that can handle the specified schema binding.. - /// - internal static string SchemaBuilder_Binding_CannotBeHandled { + internal static string AppliedDirective_Description { get { - return ResourceManager.GetString("SchemaBuilder_Binding_CannotBeHandled", resourceCulture); + return ResourceManager.GetString("AppliedDirective_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The schema binding is not valid.. - /// - internal static string SchemaBuilder_Binding_Invalid { + internal static string DirectiveArgument_Description { get { - return ResourceManager.GetString("SchemaBuilder_Binding_Invalid", resourceCulture); + return ResourceManager.GetString("DirectiveArgument_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified convention type is not supported.. - /// - internal static string SchemaBuilder_Convention_NotSupported { + internal static string ThrowHelper_UsePagingAttribute_NodeTypeUnknown { get { - return ResourceManager.GetString("SchemaBuilder_Convention_NotSupported", resourceCulture); + return ResourceManager.GetString("ThrowHelper_UsePagingAttribute_NodeTypeUnknown", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified interceptor type is not supported.. - /// - internal static string SchemaBuilder_Interceptor_NotSupported { + internal static string Schema_GetDirectiveType_DoesNotExist { get { - return ResourceManager.GetString("SchemaBuilder_Interceptor_NotSupported", resourceCulture); + return ResourceManager.GetString("Schema_GetDirectiveType_DoesNotExist", resourceCulture); } } - /// - /// Looks up a localized string similar to The given schema has to inherit from TypeSystemObjectBase in order to be initializable.. - /// - internal static string SchemaBuilder_ISchemaNotTso { + internal static string ErrorHelper_ObjectField_HasNoResolver { get { - return ResourceManager.GetString("SchemaBuilder_ISchemaNotTso", resourceCulture); + return ResourceManager.GetString("ErrorHelper_ObjectField_HasNoResolver", resourceCulture); } } - /// - /// Looks up a localized string similar to schemaType must be a schema type.. - /// - internal static string SchemaBuilder_MustBeSchemaType { + internal static string ExtendedTypeReferenceHandler_NonGenericExecutableNotAllowed { get { - return ResourceManager.GetString("SchemaBuilder_MustBeSchemaType", resourceCulture); + return ResourceManager.GetString("ExtendedTypeReferenceHandler_NonGenericExecutableNotAllowed", resourceCulture); } } - /// - /// Looks up a localized string similar to The schema builder was unable to identify the query type of the schema. Either specify which type is the query type or set the schema builder to non-strict validation mode.. - /// - internal static string SchemaBuilder_NoQueryType { + internal static string BindingCompiler_AddBinding_BindingCannotBeHandled { get { - return ResourceManager.GetString("SchemaBuilder_NoQueryType", resourceCulture); + return ResourceManager.GetString("BindingCompiler_AddBinding_BindingCannotBeHandled", resourceCulture); } } - /// - /// Looks up a localized string similar to A root type must be a class.. - /// - internal static string SchemaBuilder_RootType_MustBeClass { + internal static string Type_SpecifiedByUrl_Description { get { - return ResourceManager.GetString("SchemaBuilder_RootType_MustBeClass", resourceCulture); + return ResourceManager.GetString("Type_SpecifiedByUrl_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to A root type must be an object type.. - /// - internal static string SchemaBuilder_RootType_MustBeObjectType { + internal static string SchemaBuilderExtensions_AddObjectType_TIsSchemaType { get { - return ResourceManager.GetString("SchemaBuilder_RootType_MustBeObjectType", resourceCulture); + return ResourceManager.GetString("SchemaBuilderExtensions_AddObjectType_TIsSchemaType", resourceCulture); } } - /// - /// Looks up a localized string similar to Non-generic schema types are not allowed.. - /// - internal static string SchemaBuilder_RootType_NonGenericType { + internal static string SchemaBuilderExtensions_AddUnionType_TIsSchemaType { get { - return ResourceManager.GetString("SchemaBuilder_RootType_NonGenericType", resourceCulture); + return ResourceManager.GetString("SchemaBuilderExtensions_AddUnionType_TIsSchemaType", resourceCulture); } } - /// - /// Looks up a localized string similar to The given schema has to inherit from `Schema` in order to be initializable.. - /// - internal static string SchemaBuilder_SchemaTypeInvalid { + internal static string SchemaBuilderExtensions_AddEnumType_TIsSchemaType { get { - return ResourceManager.GetString("SchemaBuilder_SchemaTypeInvalid", resourceCulture); + return ResourceManager.GetString("SchemaBuilderExtensions_AddEnumType_TIsSchemaType", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified type `{0}` is a GraphQL schema type. AddEnumType<T> is a helper method to register a runtime type as GraphQL enum type. Use AddType<T> to register GraphQL schema types.. - /// - internal static string SchemaBuilderExtensions_AddEnumType_TIsSchemaType { + internal static string SchemaBuilderExtensions_AddInterfaceType_TIsSchemaType { get { - return ResourceManager.GetString("SchemaBuilderExtensions_AddEnumType_TIsSchemaType", resourceCulture); + return ResourceManager.GetString("SchemaBuilderExtensions_AddInterfaceType_TIsSchemaType", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified type `{0}` is a GraphQL schema type. AddInputObjectType<T> is a helper method to register a runtime type as GraphQL input object type. Use AddType<T> to register GraphQL schema types.. - /// internal static string SchemaBuilderExtensions_AddInputObjectType_TIsSchemaType { get { return ResourceManager.GetString("SchemaBuilderExtensions_AddInputObjectType_TIsSchemaType", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified type `{0}` is a GraphQL schema type. AddInterfaceType<T> is a helper method to register a runtime type as GraphQL interface type. Use AddType<T> to register GraphQL schema types.. - /// - internal static string SchemaBuilderExtensions_AddInterfaceType_TIsSchemaType { + internal static string EventMessageParameterExpressionBuilder_MessageNotFound { get { - return ResourceManager.GetString("SchemaBuilderExtensions_AddInterfaceType_TIsSchemaType", resourceCulture); + return ResourceManager.GetString("EventMessageParameterExpressionBuilder_MessageNotFound", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified type `{0}` is a GraphQL schema type. AddObjectType<T> is a helper method to register a runtime type as GraphQL object type. Use AddType<T> to register GraphQL schema types.. - /// - internal static string SchemaBuilderExtensions_AddObjectType_TIsSchemaType { + internal static string DefaultResolverCompilerService_CreateResolver_ArgumentValidationError { get { - return ResourceManager.GetString("SchemaBuilderExtensions_AddObjectType_TIsSchemaType", resourceCulture); + return ResourceManager.GetString("DefaultResolverCompilerService_CreateResolver_ArgumentValidationError", resourceCulture); } } - /// - /// Looks up a localized string similar to The resolver type needs to be a public non-abstract non-static class.. - /// - internal static string SchemaBuilderExtensions_AddResolver_TypeConditionNotMet { + internal static string DefaultResolverCompilerService_CompileSubscribe_OnlyMethodsAllowed { get { - return ResourceManager.GetString("SchemaBuilderExtensions_AddResolver_TypeConditionNotMet", resourceCulture); + return ResourceManager.GetString("DefaultResolverCompilerService_CompileSubscribe_OnlyMethodsAllowed", resourceCulture); } } - /// - /// Looks up a localized string similar to The schema builder context is invalid.. - /// internal static string SchemaBuilderExtensions_AddResolverConfig_ContextInvalid { get { return ResourceManager.GetString("SchemaBuilderExtensions_AddResolverConfig_ContextInvalid", resourceCulture); } } - /// - /// Looks up a localized string similar to The resolver type needs to be a class or interface. - /// - internal static string SchemaBuilderExtensions_AddRootResolver_NeedsToBeClassOrInterface { + internal static string ExpressionHelper_GetGlobalStateWithDefault_NoDefaults { get { - return ResourceManager.GetString("SchemaBuilderExtensions_AddRootResolver_NeedsToBeClassOrInterface", resourceCulture); + return ResourceManager.GetString("ExpressionHelper_GetGlobalStateWithDefault_NoDefaults", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified type `{0}` is a GraphQL schema type. AddUnionType<T> is a helper method to register a runtime type as GraphQL union type. Use AddType<T> to register GraphQL schema types.. - /// - internal static string SchemaBuilderExtensions_AddUnionType_TIsSchemaType { + internal static string ExpressionHelper_ResolveScopedContextData_KeyDoesNotExist { get { - return ResourceManager.GetString("SchemaBuilderExtensions_AddUnionType_TIsSchemaType", resourceCulture); + return ResourceManager.GetString("ExpressionHelper_ResolveScopedContextData_KeyDoesNotExist", resourceCulture); } } - /// - /// Looks up a localized string similar to A directive type mustn't be one of the base classes `DirectiveType` or `DirectiveType<T>` but must be a type inheriting from `DirectiveType` or `DirectiveType<T>`.. - /// - internal static string SchemaBuilderExtensions_DirectiveTypeIsBaseType { + internal static string ExpressionHelper_GetScopedStateWithDefault_NoDefaultValue { get { - return ResourceManager.GetString("SchemaBuilderExtensions_DirectiveTypeIsBaseType", resourceCulture); + return ResourceManager.GetString("ExpressionHelper_GetScopedStateWithDefault_NoDefaultValue", resourceCulture); } } - /// - /// Looks up a localized string similar to A directive type must inherit from `DirectiveType` or `DirectiveType<T>`.. - /// - internal static string SchemaBuilderExtensions_MustBeDirectiveType { + internal static string ClaimsPrincipalParameterExpressionBuilder_NoClaimsFound { get { - return ResourceManager.GetString("SchemaBuilderExtensions_MustBeDirectiveType", resourceCulture); + return ResourceManager.GetString("ClaimsPrincipalParameterExpressionBuilder_NoClaimsFound", resourceCulture); } } - /// - /// Looks up a localized string similar to The schema string cannot be null or empty.. - /// - internal static string SchemaBuilderExtensions_SchemaIsEmpty { + internal static string DirectiveLocation_VariableDefinition { get { - return ResourceManager.GetString("SchemaBuilderExtensions_SchemaIsEmpty", resourceCulture); + return ResourceManager.GetString("DirectiveLocation_VariableDefinition", resourceCulture); } } - /// - /// Looks up a localized string similar to The error message mustn't be null or empty.. - /// - internal static string SchemaErrorBuilder_MessageIsNull { + internal static string SchemaBuilderExtensions_AddResolver_TypeConditionNotMet { get { - return ResourceManager.GetString("SchemaErrorBuilder_MessageIsNull", resourceCulture); + return ResourceManager.GetString("SchemaBuilderExtensions_AddResolver_TypeConditionNotMet", resourceCulture); } } - /// - /// Looks up a localized string similar to For more details look at the `Errors` property.. - /// - internal static string SchemaException_ErrorSummaryText { + internal static string SchemaBuilderExtensions_AddRootResolver_NeedsToBeClassOrInterface { get { - return ResourceManager.GetString("SchemaException_ErrorSummaryText", resourceCulture); + return ResourceManager.GetString("SchemaBuilderExtensions_AddRootResolver_NeedsToBeClassOrInterface", resourceCulture); } } - /// - /// Looks up a localized string similar to Unexpected schema exception occurred.. - /// - internal static string SchemaException_UnexpectedError { + internal static string Relay_NodeField_Description { get { - return ResourceManager.GetString("SchemaException_UnexpectedError", resourceCulture); + return ResourceManager.GetString("Relay_NodeField_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to Access the current type schema of this server.. - /// - internal static string SchemaField_Description { + internal static string Relay_NodeField_Id_Description { get { - return ResourceManager.GetString("SchemaField_Description", resourceCulture); + return ResourceManager.GetString("Relay_NodeField_Id_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to Unknown operation type.. - /// - internal static string SchemaSyntaxVisitor_UnknownOperationType { + internal static string Relay_NodesField_Description { get { - return ResourceManager.GetString("SchemaSyntaxVisitor_UnknownOperationType", resourceCulture); + return ResourceManager.GetString("Relay_NodesField_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The schema types definition is in an invalid state.. - /// - internal static string SchemaTypes_DefinitionInvalid { + internal static string Relay_NodesField_Ids_Description { get { - return ResourceManager.GetString("SchemaTypes_DefinitionInvalid", resourceCulture); + return ResourceManager.GetString("Relay_NodesField_Ids_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified type `{0}` does not exist or is not of the specified kind `{1}`.. - /// - internal static string SchemaTypes_GetType_DoesNotExist { + internal static string ErrorHelper_MiddlewareOrderInvalid { get { - return ResourceManager.GetString("SchemaTypes_GetType_DoesNotExist", resourceCulture); + return ResourceManager.GetString("ErrorHelper_MiddlewareOrderInvalid", resourceCulture); } } - /// - /// Looks up a localized string similar to The middleware order is invalid since the service scope is missing.. - /// - internal static string ServiceHelper_UseResolverServiceInternal_Order { + internal static string ErrorHelper_NoSchemaTypesAllowedAsRuntimeType { get { - return ResourceManager.GetString("ServiceHelper_UseResolverServiceInternal_Order", resourceCulture); + return ResourceManager.GetString("ErrorHelper_NoSchemaTypesAllowedAsRuntimeType", resourceCulture); } } - /// - /// Looks up a localized string similar to The `Short` scalar type represents non-fractional signed whole 16-bit numeric values. Short can represent values between -(2^15) and 2^15 - 1.. - /// - internal static string ShortType_Description { + internal static string FieldInitHelper_CompleteFields_MaxFieldCountToSmall { get { - return ResourceManager.GetString("ShortType_Description", resourceCulture); + return ResourceManager.GetString("FieldInitHelper_CompleteFields_MaxFieldCountToSmall", resourceCulture); } } - /// - /// Looks up a localized string similar to Skipped when true.. - /// - internal static string SkipDirectiveType_IfDescription { + internal static string RegisteredType_Completion_NotYetReady { get { - return ResourceManager.GetString("SkipDirectiveType_IfDescription", resourceCulture); + return ResourceManager.GetString("RegisteredType_Completion_NotYetReady", resourceCulture); } } - /// - /// Looks up a localized string similar to Directs the executor to skip this field or fragment when the `if` argument is true.. - /// - internal static string SkipDirectiveType_TypeDescription { + internal static string EdgeType_IsInstanceOfType_NonObject { get { - return ResourceManager.GetString("SkipDirectiveType_TypeDescription", resourceCulture); + return ResourceManager.GetString("EdgeType_IsInstanceOfType_NonObject", resourceCulture); } } - /// - /// Looks up a localized string similar to The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions.. - /// - internal static string SpecifiedByDirectiveType_TypeDescription { + internal static string EdgeType_Description { get { - return ResourceManager.GetString("SpecifiedByDirectiveType_TypeDescription", resourceCulture); + return ResourceManager.GetString("EdgeType_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types.. - /// - internal static string SpecifiedByDirectiveType_UrlDescription { + internal static string EdgeType_Cursor_Description { get { - return ResourceManager.GetString("SpecifiedByDirectiveType_UrlDescription", resourceCulture); + return ResourceManager.GetString("EdgeType_Cursor_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to 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`.. - /// - internal static string StreamDirectiveType_Description { + internal static string EdgeType_Node_Description { get { - return ResourceManager.GetString("StreamDirectiveType_Description", resourceCulture); + return ResourceManager.GetString("EdgeType_Node_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to Streamed when true.. - /// - internal static string StreamDirectiveType_If_Description { + internal static string ConnectionType_Description { get { - return ResourceManager.GetString("StreamDirectiveType_If_Description", resourceCulture); + return ResourceManager.GetString("ConnectionType_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The initial elements that shall be send down to the consumer.. - /// - internal static string StreamDirectiveType_InitialCount_Description { + internal static string ConnectionType_PageInfo_Description { get { - return ResourceManager.GetString("StreamDirectiveType_InitialCount_Description", resourceCulture); + return ResourceManager.GetString("ConnectionType_PageInfo_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to 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.. - /// - internal static string StreamDirectiveType_Label_Description { + internal static string ConnectionType_Edges_Description { get { - return ResourceManager.GetString("StreamDirectiveType_Label_Description", resourceCulture); + return ResourceManager.GetString("ConnectionType_Edges_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The `{0}` cannot be null or empty.. - /// - internal static string String_Argument_NullOrEmpty { + internal static string ConnectionType_TotalCount_Description { get { - return ResourceManager.GetString("String_Argument_NullOrEmpty", resourceCulture); + return ResourceManager.GetString("ConnectionType_TotalCount_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to 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.. - /// - internal static string StringType_Description { + internal static string CollectionSegmentType_PageInfo_Description { get { - return ResourceManager.GetString("StringType_Description", resourceCulture); + return ResourceManager.GetString("CollectionSegmentType_PageInfo_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to Tag is not supported on the specified descriptor.. - /// - internal static string TagDirective_Descriptor_NotSupported { + internal static string CollectionSegmentType_Description { get { - return ResourceManager.GetString("TagDirective_Descriptor_NotSupported", resourceCulture); + return ResourceManager.GetString("CollectionSegmentType_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The tag name must follow the GraphQL type name rules.. - /// - internal static string TagDirective_Name_NotValid { + internal static string CollectionSegmentType_Items_Description { get { - return ResourceManager.GetString("TagDirective_Name_NotValid", resourceCulture); + return ResourceManager.GetString("CollectionSegmentType_Items_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to Convention of type {0} in scope {1} could not be created. - /// - internal static string ThrowHelper_Convention_ConventionCouldNotBeCreated { + internal static string ConnectionType_Nodes_Description { get { - return ResourceManager.GetString("ThrowHelper_Convention_ConventionCouldNotBeCreated", resourceCulture); + return ResourceManager.GetString("ConnectionType_Nodes_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to There are two conventions registered for {0} in scope {1}. Only one convention is allowed. Use convention extensions if additional configuration is needed. Colliding conventions are {2} and {3}. - /// - internal static string ThrowHelper_Convention_TwoConventionsRegisteredForScope { + internal static string ServiceHelper_UseResolverServiceInternal_Order { get { - return ResourceManager.GetString("ThrowHelper_Convention_TwoConventionsRegisteredForScope", resourceCulture); + return ResourceManager.GetString("ServiceHelper_UseResolverServiceInternal_Order", resourceCulture); } } - /// - /// Looks up a localized string similar to Unable to create a convention instance from {0}.. - /// - internal static string ThrowHelper_Convention_UnableToCreateConvention { + internal static string DefaultNamingConventions_FormatFieldName_EmptyOrNull { get { - return ResourceManager.GetString("ThrowHelper_Convention_UnableToCreateConvention", resourceCulture); + return ResourceManager.GetString("DefaultNamingConventions_FormatFieldName_EmptyOrNull", resourceCulture); } } - /// - /// Looks up a localized string similar to The provided type {0} is not a dataloader. - /// - internal static string ThrowHelper_DataLoader_InvalidType { + internal static string OneOfDirectiveType_Description { get { - return ResourceManager.GetString("ThrowHelper_DataLoader_InvalidType", resourceCulture); + return ResourceManager.GetString("OneOfDirectiveType_Description", resourceCulture); } } - /// - /// Looks up a localized string similar to The event message is of the type `{0}` and cannot be casted to `{1}.`. - /// - internal static string ThrowHelper_EventMessage_InvalidCast { + internal static string ThrowHelper_OneOfNoFieldSet { get { - return ResourceManager.GetString("ThrowHelper_EventMessage_InvalidCast", resourceCulture); + return ResourceManager.GetString("ThrowHelper_OneOfNoFieldSet", resourceCulture); } } - /// - /// Looks up a localized string similar to There is no event message on the context.. - /// - internal static string ThrowHelper_EventMessage_NotFound { + internal static string ThrowHelper_OneOfMoreThanOneFieldSet { get { - return ResourceManager.GetString("ThrowHelper_EventMessage_NotFound", resourceCulture); + return ResourceManager.GetString("ThrowHelper_OneOfMoreThanOneFieldSet", resourceCulture); } } - /// - /// Looks up a localized string similar to The field is already sealed and cannot be mutated.. - /// - internal static string ThrowHelper_FieldBase_Sealed { + internal static string ThrowHelper_OneOfFieldIsNull { get { - return ResourceManager.GetString("ThrowHelper_FieldBase_Sealed", resourceCulture); + return ResourceManager.GetString("ThrowHelper_OneOfFieldIsNull", resourceCulture); } } - /// - /// Looks up a localized string similar to The shape of the enum {0} is not known. - /// - internal static string ThrowHelper_Flags_Enum_Shape_Unknown { + internal static string ReflectionUtils_ExtractMethod_MethodExpected { get { - return ResourceManager.GetString("ThrowHelper_Flags_Enum_Shape_Unknown", resourceCulture); + return ResourceManager.GetString("ReflectionUtils_ExtractMethod_MethodExpected", resourceCulture); } } - /// - /// Looks up a localized string similar to One of the values of {0} does not have a valid name: {1}. - /// - internal static string ThrowHelper_Flags_IllegalFlagEnumName { + internal static string ResolverContextExtensions_ScopedContextData_KeyNotFound { get { - return ResourceManager.GetString("ThrowHelper_Flags_IllegalFlagEnumName", resourceCulture); + return ResourceManager.GetString("ResolverContextExtensions_ScopedContextData_KeyNotFound", resourceCulture); } } - /// - /// Looks up a localized string similar to Flags need to have at least one selection. Type: {0}. - /// - internal static string ThrowHelper_Flags_Parser_NoSelection { + internal static string ResolverContextExtensions_LocalContextData_KeyNotFound { get { - return ResourceManager.GetString("ThrowHelper_Flags_Parser_NoSelection", resourceCulture); + return ResourceManager.GetString("ResolverContextExtensions_LocalContextData_KeyNotFound", resourceCulture); } } - /// - /// Looks up a localized string similar to The value {0} is not known for type {1}. - /// - internal static string ThrowHelper_Flags_Parser_UnknownSelection { + internal static string ResolverContextExtensions_ContextData_KeyNotFound { get { - return ResourceManager.GetString("ThrowHelper_Flags_Parser_UnknownSelection", resourceCulture); + return ResourceManager.GetString("ResolverContextExtensions_ContextData_KeyNotFound", resourceCulture); } } - /// - /// Looks up a localized string similar to The type `{0}` does mot expect `{1}`.. - /// - internal static string ThrowHelper_FormatResultLeaf_InvalidSyntaxKind { + internal static string SchemaTypes_GetType_DoesNotExist { get { - return ResourceManager.GetString("ThrowHelper_FormatResultLeaf_InvalidSyntaxKind", resourceCulture); + return ResourceManager.GetString("SchemaTypes_GetType_DoesNotExist", resourceCulture); } } - /// - /// Looks up a localized string similar to The list result value of {0} must implement IList but is of the type {1}.. - /// - internal static string ThrowHelper_FormatResultList_InvalidObjectKind { + internal static string SchemaTypes_DefinitionInvalid { get { - return ResourceManager.GetString("ThrowHelper_FormatResultList_InvalidObjectKind", resourceCulture); + return ResourceManager.GetString("SchemaTypes_DefinitionInvalid", resourceCulture); } } - /// - /// Looks up a localized string similar to The input object `{1}` must to be of type `{2}` or serialized as `IReadOnlyDictionary<string. object?>` but not as `{0}`.. - /// - internal static string ThrowHelper_FormatResultObject_InvalidObjectKind { + internal static string InputObjectTypeDescriptor_OnlyProperties { get { - return ResourceManager.GetString("ThrowHelper_FormatResultObject_InvalidObjectKind", resourceCulture); + return ResourceManager.GetString("InputObjectTypeDescriptor_OnlyProperties", resourceCulture); } } - /// - /// Looks up a localized string similar to The list runtime value of {0} must implement IEnumerable or IList but is of the type {1}.. - /// - internal static string ThrowHelper_FormatValueList_InvalidObjectKind { + internal static string InterfaceTypeDescriptor_MustBePropertyOrMethod { get { - return ResourceManager.GetString("ThrowHelper_FormatValueList_InvalidObjectKind", resourceCulture); + return ResourceManager.GetString("InterfaceTypeDescriptor_MustBePropertyOrMethod", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified type `{0}` is expected to be an input type.. - /// - internal static string ThrowHelper_InputTypeExpected_Message { + internal static string ThrowHelper_FieldBase_Sealed { get { - return ResourceManager.GetString("ThrowHelper_InputTypeExpected_Message", resourceCulture); + return ResourceManager.GetString("ThrowHelper_FieldBase_Sealed", resourceCulture); } } - /// - /// Looks up a localized string similar to The fields `{0}` do not exist on the type `{1}`.. - /// - internal static string ThrowHelper_InvalidInputFieldNames { + internal static string TypeInitializer_CannotFindType { get { - return ResourceManager.GetString("ThrowHelper_InvalidInputFieldNames", resourceCulture); + return ResourceManager.GetString("TypeInitializer_CannotFindType", resourceCulture); } } - /// - /// Looks up a localized string similar to The field `{0}` does not exist on the type `{1}`.. - /// - internal static string ThrowHelper_InvalidInputFieldNames_Single { + internal static string ThrowHelper_RelayIdFieldHelpers_NoFieldType { get { - return ResourceManager.GetString("ThrowHelper_InvalidInputFieldNames_Single", resourceCulture); + return ResourceManager.GetString("ThrowHelper_RelayIdFieldHelpers_NoFieldType", resourceCulture); } } - /// - /// Looks up a localized string similar to The {0}-directive is missing the if-argument.. - /// - internal static string ThrowHelper_MissingDirectiveIfArgument { + internal static string ThrowHelper_NodeResolver_ObjNoDefinition { get { - return ResourceManager.GetString("ThrowHelper_MissingDirectiveIfArgument", resourceCulture); + return ResourceManager.GetString("ThrowHelper_NodeResolver_ObjNoDefinition", resourceCulture); } } - /// - /// Looks up a localized string similar to Mutation conventions infer the error name from the mutation. In this case the error union was inferred from the mutation `{0}` as `{1}`, but the type initialization encountered another object with the name `{1}`. Either rename the error object or specify a naming exception for this particular mutation. You can do that by using the `UseMutationConventionAttribute` for instance.. - /// - internal static string ThrowHelper_MutationDuplicateErrorName { + internal static string ThrowHelper_NodeResolver_ArgumentTypeMissing { get { - return ResourceManager.GetString("ThrowHelper_MutationDuplicateErrorName", resourceCulture); + return ResourceManager.GetString("ThrowHelper_NodeResolver_ArgumentTypeMissing", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified id field `{0}` does not exist on `{1}`.. - /// - internal static string ThrowHelper_NodeAttribute_IdFieldNotFound { + internal static string ThrowHelper_Schema_GetMember_TypeNotFound { get { - return ResourceManager.GetString("ThrowHelper_NodeAttribute_IdFieldNotFound", resourceCulture); + return ResourceManager.GetString("ThrowHelper_Schema_GetMember_TypeNotFound", resourceCulture); } } - /// - /// Looks up a localized string similar to A field argument at this initialization state is guaranteed to have an argument type, but we found none.. - /// - internal static string ThrowHelper_NodeResolver_ArgumentTypeMissing { + internal static string ThrowHelper_Schema_GetMember_FieldNotFound { get { - return ResourceManager.GetString("ThrowHelper_NodeResolver_ArgumentTypeMissing", resourceCulture); + return ResourceManager.GetString("ThrowHelper_Schema_GetMember_FieldNotFound", resourceCulture); } } - /// - /// Looks up a localized string similar to An object type at this point is guaranteed to have a type definition, but we found none.. - /// - internal static string ThrowHelper_NodeResolver_ObjNoDefinition { + internal static string ThrowHelper_Schema_GetMember_FieldArgNotFound { get { - return ResourceManager.GetString("ThrowHelper_NodeResolver_ObjNoDefinition", resourceCulture); + return ResourceManager.GetString("ThrowHelper_Schema_GetMember_FieldArgNotFound", resourceCulture); } } - /// - /// Looks up a localized string similar to Cannot accept null for non-nullable input.. - /// - internal static string ThrowHelper_NonNullInputViolation { + internal static string ThrowHelper_Schema_GetMember_InvalidCoordinate { get { - return ResourceManager.GetString("ThrowHelper_NonNullInputViolation", resourceCulture); + return ResourceManager.GetString("ThrowHelper_Schema_GetMember_InvalidCoordinate", resourceCulture); } } - /// - /// Looks up a localized string similar to `null` was set to the field `{0}`of the Oneof Input Object `{1}`. Oneof Input Objects are a special variant of Input Objects where the type system asserts that exactly one of the fields must be set and non-null.. - /// - internal static string ThrowHelper_OneOfFieldIsNull { + internal static string ThrowHelper_Schema_GetMember_InputFieldNotFound { get { - return ResourceManager.GetString("ThrowHelper_OneOfFieldIsNull", resourceCulture); + return ResourceManager.GetString("ThrowHelper_Schema_GetMember_InputFieldNotFound", resourceCulture); } } - /// - /// Looks up a localized string similar to More than one field of the Oneof Input Object `{0}` is set. Oneof Input Objects are a special variant of Input Objects where the type system asserts that exactly one of the fields must be set and non-null.. - /// - internal static string ThrowHelper_OneOfMoreThanOneFieldSet { + internal static string ThrowHelper_Schema_GetMember_EnumValueNotFound { get { - return ResourceManager.GetString("ThrowHelper_OneOfMoreThanOneFieldSet", resourceCulture); + return ResourceManager.GetString("ThrowHelper_Schema_GetMember_EnumValueNotFound", resourceCulture); } } - /// - /// Looks up a localized string similar to The Oneof Input Objects `{0}` require that exactly one field must be supplied and that field must not be `null`. Oneof Input Objects are a special variant of Input Objects where the type system asserts that exactly one of the fields must be set and non-null.. - /// - internal static string ThrowHelper_OneOfNoFieldSet { + internal static string ThrowHelper_Schema_GetMember_DirectiveNotFound { get { - return ResourceManager.GetString("ThrowHelper_OneOfNoFieldSet", resourceCulture); + return ResourceManager.GetString("ThrowHelper_Schema_GetMember_DirectiveNotFound", resourceCulture); + } + } + + internal static string ThrowHelper_Schema_GetMember_DirectiveArgumentNotFound { + get { + return ResourceManager.GetString("ThrowHelper_Schema_GetMember_DirectiveArgumentNotFound", resourceCulture); + } + } + + internal static string ThrowHelper_FormatResultLeaf_InvalidSyntaxKind { + get { + return ResourceManager.GetString("ThrowHelper_FormatResultLeaf_InvalidSyntaxKind", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified type `{0}` is expected to be an output type.. - /// - internal static string ThrowHelper_OutputTypeExpected_Message { + internal static string ThrowHelper_FormatResultList_InvalidObjectKind { get { - return ResourceManager.GetString("ThrowHelper_OutputTypeExpected_Message", resourceCulture); + return ResourceManager.GetString("ThrowHelper_FormatResultList_InvalidObjectKind", resourceCulture); } } - /// - /// Looks up a localized string similar to The input object `{1}` must to be serialized as `{2}` or as `IReadOnlyDictionary<string. object?>` but not as `{0}`.. - /// - internal static string ThrowHelper_ParseInputObject_InvalidObjectKind { + internal static string ThrowHelper_FormatResultObject_InvalidObjectKind { get { - return ResourceManager.GetString("ThrowHelper_ParseInputObject_InvalidObjectKind", resourceCulture); + return ResourceManager.GetString("ThrowHelper_FormatResultObject_InvalidObjectKind", resourceCulture); } } - /// - /// Looks up a localized string similar to The syntax node `{0}` is incompatible with the type `{1}`.. - /// - internal static string ThrowHelper_ParseInputObject_InvalidSyntaxKind { + internal static string ThrowHelper_FormatValueList_InvalidObjectKind { get { - return ResourceManager.GetString("ThrowHelper_ParseInputObject_InvalidSyntaxKind", resourceCulture); + return ResourceManager.GetString("ThrowHelper_FormatValueList_InvalidObjectKind", resourceCulture); } } - /// - /// Looks up a localized string similar to The list `{1}` must to be serialized as `{2}` or as `IList` but not as `{0}`.. - /// internal static string ThrowHelper_ParseList_InvalidObjectKind { get { return ResourceManager.GetString("ThrowHelper_ParseList_InvalidObjectKind", resourceCulture); } } - /// - /// Looks up a localized string similar to The item syntax node for a nested list must be `ListValue` but the parser found `{0}`.. - /// internal static string ThrowHelper_ParseNestedList_InvalidSyntaxKind { get { return ResourceManager.GetString("ThrowHelper_ParseNestedList_InvalidSyntaxKind", resourceCulture); } } - /// - /// Looks up a localized string similar to Unable to resolve type from field `{0}`.. - /// - internal static string ThrowHelper_RelayIdFieldHelpers_NoFieldType { + internal static string ThrowHelper_ParseInputObject_InvalidObjectKind { get { - return ResourceManager.GetString("ThrowHelper_RelayIdFieldHelpers_NoFieldType", resourceCulture); + return ResourceManager.GetString("ThrowHelper_ParseInputObject_InvalidObjectKind", resourceCulture); } } - /// - /// Looks up a localized string similar to The required input field `{0}` is missing.. - /// - internal static string ThrowHelper_RequiredInputFieldIsMissing { + internal static string ThrowHelper_ParseInputObject_InvalidSyntaxKind { get { - return ResourceManager.GetString("ThrowHelper_RequiredInputFieldIsMissing", resourceCulture); + return ResourceManager.GetString("ThrowHelper_ParseInputObject_InvalidSyntaxKind", resourceCulture); } } - /// - /// Looks up a localized string similar to Argument `{0}` was not found on directive `@{1}`.. - /// - internal static string ThrowHelper_Schema_GetMember_DirectiveArgumentNotFound { + internal static string ThrowHelper_NonNullInputViolation { get { - return ResourceManager.GetString("ThrowHelper_Schema_GetMember_DirectiveArgumentNotFound", resourceCulture); + return ResourceManager.GetString("ThrowHelper_NonNullInputViolation", resourceCulture); } } - /// - /// Looks up a localized string similar to Directive `@{0}` not found.. - /// - internal static string ThrowHelper_Schema_GetMember_DirectiveNotFound { + internal static string ThrowHelper_InvalidInputFieldNames { get { - return ResourceManager.GetString("ThrowHelper_Schema_GetMember_DirectiveNotFound", resourceCulture); + return ResourceManager.GetString("ThrowHelper_InvalidInputFieldNames", resourceCulture); } } - /// - /// Looks up a localized string similar to Enum value `{0}` was not found on type `{1}`.. - /// - internal static string ThrowHelper_Schema_GetMember_EnumValueNotFound { + internal static string ThrowHelper_RequiredInputFieldIsMissing { get { - return ResourceManager.GetString("ThrowHelper_Schema_GetMember_EnumValueNotFound", resourceCulture); + return ResourceManager.GetString("ThrowHelper_RequiredInputFieldIsMissing", resourceCulture); } } - /// - /// Looks up a localized string similar to Argument `{0}` was not found on field `{1}.{2}`.. - /// - internal static string ThrowHelper_Schema_GetMember_FieldArgNotFound { + internal static string ThrowHelper_DataLoader_InvalidType { get { - return ResourceManager.GetString("ThrowHelper_Schema_GetMember_FieldArgNotFound", resourceCulture); + return ResourceManager.GetString("ThrowHelper_DataLoader_InvalidType", resourceCulture); } } - /// - /// Looks up a localized string similar to Field `{0}` was not found on type `{1}`.. - /// - internal static string ThrowHelper_Schema_GetMember_FieldNotFound { + internal static string ThrowHelper_Convention_ConventionCouldNotBeCreated { get { - return ResourceManager.GetString("ThrowHelper_Schema_GetMember_FieldNotFound", resourceCulture); + return ResourceManager.GetString("ThrowHelper_Convention_ConventionCouldNotBeCreated", resourceCulture); } } - /// - /// Looks up a localized string similar to Input field `{0}` was not found on type `{1}`.. - /// - internal static string ThrowHelper_Schema_GetMember_InputFieldNotFound { + internal static string ThrowHelper_Convention_TwoConventionsRegisteredForScope { get { - return ResourceManager.GetString("ThrowHelper_Schema_GetMember_InputFieldNotFound", resourceCulture); + return ResourceManager.GetString("ThrowHelper_Convention_TwoConventionsRegisteredForScope", resourceCulture); } } - /// - /// Looks up a localized string similar to The coordinate `{0}` is invalid for the type `{1}`.. - /// - internal static string ThrowHelper_Schema_GetMember_InvalidCoordinate { + internal static string ThrowHelper_NodeAttribute_IdFieldNotFound { get { - return ResourceManager.GetString("ThrowHelper_Schema_GetMember_InvalidCoordinate", resourceCulture); + return ResourceManager.GetString("ThrowHelper_NodeAttribute_IdFieldNotFound", resourceCulture); } } - /// - /// Looks up a localized string similar to A type with the name `{0}` was not found.. - /// - internal static string ThrowHelper_Schema_GetMember_TypeNotFound { + internal static string ThrowHelper_TypeCompletionContext_UnableToResolveType { get { - return ResourceManager.GetString("ThrowHelper_Schema_GetMember_TypeNotFound", resourceCulture); + return ResourceManager.GetString("ThrowHelper_TypeCompletionContext_UnableToResolveType", resourceCulture); } } - /// - /// Looks up a localized string similar to You need to specify the message type on {0}.{1}. (SubscribeAttribute). - /// - internal static string ThrowHelper_SubscribeAttribute_MessageTypeUnspecified { + internal static string ThrowHelper_TypeRegistrar_CreateInstanceFailed { get { - return ResourceManager.GetString("ThrowHelper_SubscribeAttribute_MessageTypeUnspecified", resourceCulture); + return ResourceManager.GetString("ThrowHelper_TypeRegistrar_CreateInstanceFailed", resourceCulture); } } - /// - /// Looks up a localized string similar to Unable to find the subscribe resolver `{2}` defined on {0}.{1}. The subscribe resolver bust be a method that is public, non-static and on the same type as the resolver. (SubscribeAttribute). - /// - internal static string ThrowHelper_SubscribeAttribute_SubscribeResolverNotFound { + internal static string ThrowHelper_Convention_UnableToCreateConvention { get { - return ResourceManager.GetString("ThrowHelper_SubscribeAttribute_SubscribeResolverNotFound", resourceCulture); + return ResourceManager.GetString("ThrowHelper_Convention_UnableToCreateConvention", resourceCulture); } } - /// - /// Looks up a localized string similar to You need to specify the topic type on {0}.{1}. (SubscribeAttribute). - /// - internal static string ThrowHelper_SubscribeAttribute_TopicTypeUnspecified { + internal static string ThrowHelper_SubscribeAttribute_SubscribeResolverNotFound { get { - return ResourceManager.GetString("ThrowHelper_SubscribeAttribute_TopicTypeUnspecified", resourceCulture); + return ResourceManager.GetString("ThrowHelper_SubscribeAttribute_SubscribeResolverNotFound", resourceCulture); } } - /// - /// Looks up a localized string similar to Unable to resolve type reference `{0}`.. - /// - internal static string ThrowHelper_TypeCompletionContext_UnableToResolveType { + internal static string ThrowHelper_SubscribeAttribute_TopicTypeUnspecified { get { - return ResourceManager.GetString("ThrowHelper_TypeCompletionContext_UnableToResolveType", resourceCulture); + return ResourceManager.GetString("ThrowHelper_SubscribeAttribute_TopicTypeUnspecified", resourceCulture); } } - /// - /// Looks up a localized string similar to Unable to create instance of type `{0}`.. - /// - internal static string ThrowHelper_TypeRegistrar_CreateInstanceFailed { + internal static string ThrowHelper_SubscribeAttribute_MessageTypeUnspecified { get { - return ResourceManager.GetString("ThrowHelper_TypeRegistrar_CreateInstanceFailed", resourceCulture); + return ResourceManager.GetString("ThrowHelper_SubscribeAttribute_MessageTypeUnspecified", resourceCulture); } } - /// - /// Looks up a localized string similar to Unable to infer the element type from the current resolver. This often happens if the resolver is not an iterable type like IEnumerable, IQueryable, IList etc. Ensure that you either explicitly specify the element type or that the return type of your resolver is an iterable type.. - /// - internal static string ThrowHelper_UsePagingAttribute_NodeTypeUnknown { + internal static string ThrowHelper_EventMessage_NotFound { get { - return ResourceManager.GetString("ThrowHelper_UsePagingAttribute_NodeTypeUnknown", resourceCulture); + return ResourceManager.GetString("ThrowHelper_EventMessage_NotFound", resourceCulture); } } - /// - /// Looks up a localized string similar to The `TimeSpan` scalar represents an ISO-8601 compliant duration type.. - /// - internal static string TimeSpanType_Description { + internal static string ThrowHelper_EventMessage_InvalidCast { get { - return ResourceManager.GetString("TimeSpanType_Description", resourceCulture); + return ResourceManager.GetString("ThrowHelper_EventMessage_InvalidCast", resourceCulture); } } - /// - /// Looks up a localized string similar to The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum. - /// - ///Depending 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 [rest of string was truncated]";. - /// - internal static string Type_Description { + internal static string ErrorHelper_NeedsOneAtLeastField { get { - return ResourceManager.GetString("Type_Description", resourceCulture); + return ResourceManager.GetString("ErrorHelper_NeedsOneAtLeastField", resourceCulture); } } - /// - /// Looks up a localized string similar to `specifiedByURL` may return a String (in the form of a URL) for custom scalars, otherwise it will return `null`.. - /// - internal static string Type_SpecifiedByUrl_Description { + internal static string ErrorHelper_TwoUnderscoresNotAllowedField { get { - return ResourceManager.GetString("Type_SpecifiedByUrl_Description", resourceCulture); + return ResourceManager.GetString("ErrorHelper_TwoUnderscoresNotAllowedField", resourceCulture); } } - /// - /// Looks up a localized string similar to The configuration delegate mustn't be null.. - /// - internal static string TypeConfiguration_ConfigureIsNull { + internal static string ErrorHelper_TwoUnderscoresNotAllowedOnArgument { get { - return ResourceManager.GetString("TypeConfiguration_ConfigureIsNull", resourceCulture); + return ResourceManager.GetString("ErrorHelper_TwoUnderscoresNotAllowedOnArgument", resourceCulture); } } - /// - /// Looks up a localized string similar to Definition mustn't be null.. - /// - internal static string TypeConfiguration_DefinitionIsNull { + internal static string ErrorHelper_TwoUnderscoresNotAllowedOnDirectiveName { get { - return ResourceManager.GetString("TypeConfiguration_DefinitionIsNull", resourceCulture); + return ResourceManager.GetString("ErrorHelper_TwoUnderscoresNotAllowedOnDirectiveName", resourceCulture); } } - /// - /// Looks up a localized string similar to Unable to convert type from `{0}` to `{1}`. - /// - internal static string TypeConversion_ConvertNotSupported { + internal static string ErrorHelper_NotTransitivelyImplemented { get { - return ResourceManager.GetString("TypeConversion_ConvertNotSupported", resourceCulture); + return ResourceManager.GetString("ErrorHelper_NotTransitivelyImplemented", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified type is not a schema type.. - /// - internal static string TypeDependency_MustBeSchemaType { + internal static string ErrorHelper_InvalidFieldType { get { - return ResourceManager.GetString("TypeDependency_MustBeSchemaType", resourceCulture); + return ResourceManager.GetString("ErrorHelper_InvalidFieldType", resourceCulture); } } - /// - /// Looks up a localized string similar to TypeReference kind not supported.. - /// - internal static string TypeDiscoveryInfo_TypeRefKindNotSupported { + internal static string ErrorHelper_FieldNotImplemented { get { - return ResourceManager.GetString("TypeDiscoveryInfo_TypeRefKindNotSupported", resourceCulture); + return ResourceManager.GetString("ErrorHelper_FieldNotImplemented", resourceCulture); } } - /// - /// Looks up a localized string similar to The type structure is invalid.. - /// - internal static string TypeExtensions_InvalidStructure { + internal static string ErrorHelper_InvalidArgumentType { get { - return ResourceManager.GetString("TypeExtensions_InvalidStructure", resourceCulture); + return ResourceManager.GetString("ErrorHelper_InvalidArgumentType", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified type kind is not supported.. - /// - internal static string TypeExtensions_KindIsNotSupported { + internal static string ErrorHelper_AdditionalArgumentNotNullable { get { - return ResourceManager.GetString("TypeExtensions_KindIsNotSupported", resourceCulture); + return ResourceManager.GetString("ErrorHelper_AdditionalArgumentNotNullable", resourceCulture); } } - /// - /// Looks up a localized string similar to The specified type is not a valid list type.. - /// - internal static string TypeExtensions_NoListType { + internal static string ErrorHelper_ArgumentNotImplemented { get { - return ResourceManager.GetString("TypeExtensions_NoListType", resourceCulture); + return ResourceManager.GetString("ErrorHelper_ArgumentNotImplemented", resourceCulture); } } - /// - /// Looks up a localized string similar to The given type is not a {0}.. - /// - internal static string TypeExtensions_TypeIsNotOfT { + internal static string ErrorHelper_OneofInputObjectMustHaveNullableFieldsWithoutDefaults { get { - return ResourceManager.GetString("TypeExtensions_TypeIsNotOfT", resourceCulture); + return ResourceManager.GetString("ErrorHelper_OneofInputObjectMustHaveNullableFieldsWithoutDefaults", resourceCulture); } } - /// - /// Looks up a localized string similar to Request the type information of a single type.. - /// - internal static string TypeField_Description { + internal static string ErrorHelper_InputObjectMustNotHaveRecursiveNonNullableReferencesToSelf { get { - return ResourceManager.GetString("TypeField_Description", resourceCulture); + return ResourceManager.GetString("ErrorHelper_InputObjectMustNotHaveRecursiveNonNullableReferencesToSelf", resourceCulture); } } - /// - /// Looks up a localized string similar to Unable to find type(s) {0}. - /// - internal static string TypeInitializer_CannotFindType { + internal static string ErrorHelper_RequiredArgumentCannotBeDeprecated { get { - return ResourceManager.GetString("TypeInitializer_CannotFindType", resourceCulture); + return ResourceManager.GetString("ErrorHelper_RequiredArgumentCannotBeDeprecated", resourceCulture); } } - /// - /// Looks up a localized string similar to Unable to resolve dependencies {1} for type `{0}`.. - /// - internal static string TypeInitializer_CannotResolveDependency { + internal static string ErrorHelper_RequiredFieldCannotBeDeprecated { get { - return ResourceManager.GetString("TypeInitializer_CannotResolveDependency", resourceCulture); + return ResourceManager.GetString("ErrorHelper_RequiredFieldCannotBeDeprecated", resourceCulture); } } - /// - /// Looks up a localized string similar to The name `{0}` was already registered by another type.. - /// - internal static string TypeInitializer_CompleteName_Duplicate { + internal static string ErrorHelper_InterfaceHasNoImplementation { get { - return ResourceManager.GetString("TypeInitializer_CompleteName_Duplicate", resourceCulture); + return ResourceManager.GetString("ErrorHelper_InterfaceHasNoImplementation", resourceCulture); } } - /// - /// Looks up a localized string similar to The kind of the extension does not match the kind of the type `{0}`.. - /// - internal static string TypeInitializer_Merge_KindDoesNotMatch { + internal static string ErrorHelper_CompleteInterfacesHelper_UnableToResolveInterface { get { - return ResourceManager.GetString("TypeInitializer_Merge_KindDoesNotMatch", resourceCulture); + return ResourceManager.GetString("ErrorHelper_CompleteInterfacesHelper_UnableToResolveInterface", resourceCulture); } } - /// - /// Looks up a localized string similar to An enum describing what kind of type a given `__Type` is.. - /// - internal static string TypeKind_Description { + internal static string ErrorHelper_DirectiveCollection_ArgumentDoesNotExist { get { - return ResourceManager.GetString("TypeKind_Description", resourceCulture); + return ResourceManager.GetString("ErrorHelper_DirectiveCollection_ArgumentDoesNotExist", resourceCulture); } } - /// - /// Looks up a localized string similar to Indicates this type is an enum. `enumValues` is a valid field.. - /// - internal static string TypeKind_Enum { + internal static string ErrorHelper_DirectiveCollection_ArgumentNonNullViolation { get { - return ResourceManager.GetString("TypeKind_Enum", resourceCulture); + return ResourceManager.GetString("ErrorHelper_DirectiveCollection_ArgumentNonNullViolation", resourceCulture); } } - /// - /// Looks up a localized string similar to Indicates this type is an input object. `inputFields` is a valid field.. - /// - internal static string TypeKind_InputObject { + internal static string ErrorHelper_ObjectType_UnableToInferOrResolveType { get { - return ResourceManager.GetString("TypeKind_InputObject", resourceCulture); + return ResourceManager.GetString("ErrorHelper_ObjectType_UnableToInferOrResolveType", resourceCulture); } } - /// - /// Looks up a localized string similar to Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.. - /// - internal static string TypeKind_Interface { + internal static string ErrorHelper_Relay_NoNodeResolver { get { - return ResourceManager.GetString("TypeKind_Interface", resourceCulture); + return ResourceManager.GetString("ErrorHelper_Relay_NoNodeResolver", resourceCulture); } } - /// - /// Looks up a localized string similar to Indicates this type is a list. `ofType` is a valid field.. - /// - internal static string TypeKind_List { + internal static string ErrorHelper_NodeResolver_MustHaveExactlyOneIdArg { get { - return ResourceManager.GetString("TypeKind_List", resourceCulture); + return ResourceManager.GetString("ErrorHelper_NodeResolver_MustHaveExactlyOneIdArg", resourceCulture); } } - /// - /// Looks up a localized string similar to Indicates this type is a non-null. `ofType` is a valid field.. - /// - internal static string TypeKind_NonNull { + internal static string ErrorHelper_NodeResolver_MustReturnObject { get { - return ResourceManager.GetString("TypeKind_NonNull", resourceCulture); + return ResourceManager.GetString("ErrorHelper_NodeResolver_MustReturnObject", resourceCulture); } } - /// - /// Looks up a localized string similar to Indicates this type is an object. `fields` and `interfaces` are valid fields.. - /// - internal static string TypeKind_Object { + internal static string ErrorHelper_NodeResolver_NodeTypeHasNoId { get { - return ResourceManager.GetString("TypeKind_Object", resourceCulture); + return ResourceManager.GetString("ErrorHelper_NodeResolver_NodeTypeHasNoId", resourceCulture); } } - /// - /// Looks up a localized string similar to Indicates this type is a scalar.. - /// - internal static string TypeKind_Scalar { + internal static string ThrowHelper_InvalidInputFieldNames_Single { get { - return ResourceManager.GetString("TypeKind_Scalar", resourceCulture); + return ResourceManager.GetString("ThrowHelper_InvalidInputFieldNames_Single", resourceCulture); } } - /// - /// Looks up a localized string similar to Indicates this type is a union. `possibleTypes` is a valid field.. - /// - internal static string TypeKind_Union { + internal static string ThrowHelper_MutationDuplicateErrorName { get { - return ResourceManager.GetString("TypeKind_Union", resourceCulture); + return ResourceManager.GetString("ThrowHelper_MutationDuplicateErrorName", resourceCulture); } } - /// - /// Looks up a localized string similar to The name of the current Object type at runtime.. - /// - internal static string TypeNameField_Description { + internal static string ErrorHelper_NodeResolverMissing { get { - return ResourceManager.GetString("TypeNameField_Description", resourceCulture); + return ResourceManager.GetString("ErrorHelper_NodeResolverMissing", resourceCulture); } } - /// - /// Looks up a localized string similar to Invalid type structure.. - /// - internal static string TypeNameHelper_InvalidTypeStructure { + internal static string ThrowHelper_Flags_Enum_Shape_Unknown { get { - return ResourceManager.GetString("TypeNameHelper_InvalidTypeStructure", resourceCulture); + return ResourceManager.GetString("ThrowHelper_Flags_Enum_Shape_Unknown", resourceCulture); } } - /// - /// Looks up a localized string similar to Only type system objects are allowed as dependency.. - /// - internal static string TypeNameHelper_OnlyTypeSystemObjectsAreAllowed { + internal static string ThrowHelper_Flags_Parser_NoSelection { get { - return ResourceManager.GetString("TypeNameHelper_OnlyTypeSystemObjectsAreAllowed", resourceCulture); + return ResourceManager.GetString("ThrowHelper_Flags_Parser_NoSelection", resourceCulture); } } - /// - /// Looks up a localized string similar to Unable to infer or resolve a schema type from the type reference `{0}`.. - /// - internal static string TypeRegistrar_TypesInconsistent { + internal static string ThrowHelper_Flags_Parser_UnknownSelection { get { - return ResourceManager.GetString("TypeRegistrar_TypesInconsistent", resourceCulture); + return ResourceManager.GetString("ThrowHelper_Flags_Parser_UnknownSelection", resourceCulture); } } - /// - /// Looks up a localized string similar to The typeName mustn't be null or empty.. - /// - internal static string TypeResourceHelper_TypeNameEmptyOrNull { + internal static string ThrowHelper_Flags_IllegalFlagEnumName { get { - return ResourceManager.GetString("TypeResourceHelper_TypeNameEmptyOrNull", resourceCulture); + return ResourceManager.GetString("ThrowHelper_Flags_IllegalFlagEnumName", resourceCulture); } } - /// - /// Looks up a localized string similar to The description becomes immutable once it was assigned.. - /// - internal static string TypeSystemObject_DescriptionImmutable { + internal static string Directive_GetArgumentValue_UnknownArgument { get { - return ResourceManager.GetString("TypeSystemObject_DescriptionImmutable", resourceCulture); + return ResourceManager.GetString("Directive_GetArgumentValue_UnknownArgument", resourceCulture); } } - /// - /// Looks up a localized string similar to The name becomes immutable once it was assigned.. - /// - internal static string TypeSystemObject_NameImmutable { + internal static string ErrorHelper_DirectiveCollection_ArgumentValueTypeIsWrong { get { - return ResourceManager.GetString("TypeSystemObject_NameImmutable", resourceCulture); + return ResourceManager.GetString("ErrorHelper_DirectiveCollection_ArgumentValueTypeIsWrong", resourceCulture); } } - /// - /// Looks up a localized string similar to The type definition is null which means that the type was initialized incorrectly.. - /// - internal static string TypeSystemObjectBase_DefinitionIsNull { + internal static string TypeDiscoveryInfo_TypeRefKindNotSupported { get { - return ResourceManager.GetString("TypeSystemObjectBase_DefinitionIsNull", resourceCulture); + return ResourceManager.GetString("TypeDiscoveryInfo_TypeRefKindNotSupported", resourceCulture); } } - /// - /// Looks up a localized string similar to The type name was not completed correctly and is still empty. Type names are not allowed to remain empty after name completion was executed. - ///Type: `{0}`. - /// - internal static string TypeSystemObjectBase_NameIsNull { + internal static string ErrorHelper_FetchedToManyNodesAtOnce { get { - return ResourceManager.GetString("TypeSystemObjectBase_NameIsNull", resourceCulture); + return ResourceManager.GetString("ErrorHelper_FetchedToManyNodesAtOnce", resourceCulture); } } - /// - /// Looks up a localized string similar to A Union type must define one or more unique member types.. - /// - internal static string UnionType_MustHaveTypes { + internal static string ThrowHelper_InputTypeExpected_Message { get { - return ResourceManager.GetString("UnionType_MustHaveTypes", resourceCulture); + return ResourceManager.GetString("ThrowHelper_InputTypeExpected_Message", resourceCulture); } } - /// - /// Looks up a localized string similar to Unable to resolve the specified type reference.. - /// - internal static string UnionType_UnableToResolveType { + internal static string ThrowHelper_OutputTypeExpected_Message { get { - return ResourceManager.GetString("UnionType_UnableToResolveType", resourceCulture); + return ResourceManager.GetString("ThrowHelper_OutputTypeExpected_Message", resourceCulture); } } - /// - /// Looks up a localized string similar to The union type extension can only be merged with an union type.. - /// - internal static string UnionTypeExtension_CannotMerge { + internal static string TagDirective_Name_NotValid { get { - return ResourceManager.GetString("UnionTypeExtension_CannotMerge", resourceCulture); + return ResourceManager.GetString("TagDirective_Name_NotValid", resourceCulture); } } - /// - /// Looks up a localized string similar to Unknown format. Guid supports the following format chars: {{ `N`, `D`, `B`, `P` }}. - /// https://docs.microsoft.com/en-us/dotnet/api/system.buffers.text.utf8parser.tryparse?view=netcore-3.1#System_Buffers_Text_Utf8Parser_TryParse_System_ReadOnlySpan_System_Byte__System_Guid__System_Int32__System_Char. - /// - internal static string UuidType_FormatUnknown { + internal static string TagDirective_Descriptor_NotSupported { get { - return ResourceManager.GetString("UuidType_FormatUnknown", resourceCulture); + return ResourceManager.GetString("TagDirective_Descriptor_NotSupported", resourceCulture); } } - /// - /// Looks up a localized string similar to Variable `{0}` of type `{1}` must be an input type.. - /// - internal static string VariableValueBuilder_InputType { + internal static string ErrorHelper_DuplicateFieldName_Message { get { - return ResourceManager.GetString("VariableValueBuilder_InputType", resourceCulture); + return ResourceManager.GetString("ErrorHelper_DuplicateFieldName_Message", resourceCulture); } } - /// - /// Looks up a localized string similar to Variable `{0}` got invalid value.. - /// - internal static string VariableValueBuilder_InvalidValue { + internal static string ErrorHelper_DuplicateDataMiddlewareDetected_Message { get { - return ResourceManager.GetString("VariableValueBuilder_InvalidValue", resourceCulture); + return ResourceManager.GetString("ErrorHelper_DuplicateDataMiddlewareDetected_Message", resourceCulture); } } - /// - /// Looks up a localized string similar to The type node kind is not supported.. - /// - internal static string VariableValueBuilder_NodeKind { + internal static string SchemaException_UnexpectedError { get { - return ResourceManager.GetString("VariableValueBuilder_NodeKind", resourceCulture); + return ResourceManager.GetString("SchemaException_UnexpectedError", resourceCulture); } } - /// - /// Looks up a localized string similar to Variable `{0}` of type `{1}` must not be null.. - /// - internal static string VariableValueBuilder_NonNull { + internal static string SchemaException_ErrorSummaryText { get { - return ResourceManager.GetString("VariableValueBuilder_NonNull", resourceCulture); + return ResourceManager.GetString("SchemaException_ErrorSummaryText", resourceCulture); } } - /// - /// Looks up a localized string similar to Detected non-null violation in variable `{0}`.. - /// - internal static string VariableValueBuilder_NonNull_In_Graph { + internal static string ResolverContextExtensions_IsSelected_FieldNameEmpty { get { - return ResourceManager.GetString("VariableValueBuilder_NonNull_In_Graph", resourceCulture); + return ResourceManager.GetString("ResolverContextExtensions_IsSelected_FieldNameEmpty", resourceCulture); } } - /// - /// Looks up a localized string similar to Variable name mustn't be null or empty.. - /// - internal static string VariableValueBuilder_VarNameEmpty { + internal static string ObjectToDictionaryConverter_CycleInObjectGraph { get { - return ResourceManager.GetString("VariableValueBuilder_VarNameEmpty", resourceCulture); + return ResourceManager.GetString("ObjectToDictionaryConverter_CycleInObjectGraph", resourceCulture); } } } diff --git a/src/HotChocolate/Core/src/Types/Properties/TypeResources.resx b/src/HotChocolate/Core/src/Types/Properties/TypeResources.resx index 00b1dc464ba..d7b1d84066d 100644 --- a/src/HotChocolate/Core/src/Types/Properties/TypeResources.resx +++ b/src/HotChocolate/Core/src/Types/Properties/TypeResources.resx @@ -129,9 +129,6 @@ Only property expressions are allowed to describe a directive type argument. - - The specified location `{0}` is not supported. - The `{0}` directive does not declare any location on which it is valid. diff --git a/src/HotChocolate/Core/src/Types/SchemaPrinter.cs b/src/HotChocolate/Core/src/Types/SchemaPrinter.cs index 897984d9427..5090ad9dae0 100644 --- a/src/HotChocolate/Core/src/Types/SchemaPrinter.cs +++ b/src/HotChocolate/Core/src/Types/SchemaPrinter.cs @@ -164,7 +164,7 @@ private static DirectiveDefinitionNode PrintDirectiveTypeDefinition( var locations = directiveType.Locations .AsEnumerable() - .Select(l => new NameNode(l.MapDirectiveLocation().ToString())) + .Select(l => new NameNode(l.Format().ToString())) .ToList(); return new DirectiveDefinitionNode diff --git a/src/HotChocolate/Core/src/Types/Types/Extensions/DirectiveLocationExtensions.cs b/src/HotChocolate/Core/src/Types/Types/Extensions/DirectiveLocationExtensions.cs deleted file mode 100644 index b8ff9401385..00000000000 --- a/src/HotChocolate/Core/src/Types/Types/Extensions/DirectiveLocationExtensions.cs +++ /dev/null @@ -1,205 +0,0 @@ -using System.Globalization; -using HotChocolate.Properties; - -namespace HotChocolate.Types; - -public static class DirectiveLocationExtensions -{ - private static readonly Dictionary _locs = - new() - { - { - DirectiveLocation.Query, - Language.DirectiveLocation.Query - }, - { - DirectiveLocation.Mutation, - Language.DirectiveLocation.Mutation - }, - { - DirectiveLocation.Subscription, - Language.DirectiveLocation.Subscription - }, - { - DirectiveLocation.Field, - Language.DirectiveLocation.Field - }, - { - DirectiveLocation.FragmentDefinition, - Language.DirectiveLocation.FragmentDefinition - }, - { - DirectiveLocation.FragmentSpread, - Language.DirectiveLocation.FragmentSpread - }, - { - DirectiveLocation.InlineFragment, - Language.DirectiveLocation.InlineFragment - }, - { - DirectiveLocation.VariableDefinition, - Language.DirectiveLocation.VariableDefinition - }, - { - DirectiveLocation.Schema, - Language.DirectiveLocation.Schema - }, - { - DirectiveLocation.Scalar, - Language.DirectiveLocation.Scalar - }, - { - DirectiveLocation.Object, - Language.DirectiveLocation.Object - }, - { - DirectiveLocation.FieldDefinition, - Language.DirectiveLocation.FieldDefinition - }, - { - DirectiveLocation.ArgumentDefinition, - Language.DirectiveLocation.ArgumentDefinition - }, - { - DirectiveLocation.Interface, - Language.DirectiveLocation.Interface - }, - { - DirectiveLocation.Union, - Language.DirectiveLocation.Union - }, - { - DirectiveLocation.Enum, - Language.DirectiveLocation.Enum - }, - { - DirectiveLocation.EnumValue, - Language.DirectiveLocation.EnumValue - }, - { - DirectiveLocation.InputObject, - Language.DirectiveLocation.InputObject - }, - { - DirectiveLocation.InputFieldDefinition, - Language.DirectiveLocation.InputFieldDefinition - }, - }; - - public static Language.DirectiveLocation MapDirectiveLocation( - this DirectiveLocation location) - { - if (!_locs.TryGetValue(location, out var l)) - { - throw new NotSupportedException(string.Format( - CultureInfo.InvariantCulture, - TypeResources.DirectiveTypeFactory_LocationNotSupported, - location)); - } - return l; - } - - internal static IEnumerable AsEnumerable( - this DirectiveLocation locations) - { - if ((locations & DirectiveLocation.Query) == DirectiveLocation.Query) - { - yield return DirectiveLocation.Query; - } - - if ((locations & DirectiveLocation.Mutation) == DirectiveLocation.Mutation) - { - yield return DirectiveLocation.Mutation; - } - - if ((locations & DirectiveLocation.Subscription) == DirectiveLocation.Subscription) - { - yield return DirectiveLocation.Subscription; - } - - if ((locations & DirectiveLocation.Field) == DirectiveLocation.Field) - { - yield return DirectiveLocation.Field; - } - - if ((locations & DirectiveLocation.FragmentDefinition) == - DirectiveLocation.FragmentDefinition) - { - yield return DirectiveLocation.FragmentDefinition; - } - - if ((locations & DirectiveLocation.FragmentSpread) == DirectiveLocation.FragmentSpread) - { - yield return DirectiveLocation.FragmentSpread; - } - - if ((locations & DirectiveLocation.InlineFragment) == DirectiveLocation.InlineFragment) - { - yield return DirectiveLocation.InlineFragment; - } - - if ((locations & DirectiveLocation.VariableDefinition) == - DirectiveLocation.VariableDefinition) - { - yield return DirectiveLocation.VariableDefinition; - } - - if ((locations & DirectiveLocation.Schema) == DirectiveLocation.Schema) - { - yield return DirectiveLocation.Schema; - } - - if ((locations & DirectiveLocation.Scalar) == DirectiveLocation.Scalar) - { - yield return DirectiveLocation.Scalar; - } - - if ((locations & DirectiveLocation.Object) == DirectiveLocation.Object) - { - yield return DirectiveLocation.Object; - } - - if ((locations & DirectiveLocation.FieldDefinition) == - DirectiveLocation.FieldDefinition) - { - yield return DirectiveLocation.FieldDefinition; - } - - if ((locations & DirectiveLocation.ArgumentDefinition) == - DirectiveLocation.ArgumentDefinition) - { - yield return DirectiveLocation.ArgumentDefinition; - } - - if ((locations & DirectiveLocation.Interface) == DirectiveLocation.Interface) - { - yield return DirectiveLocation.Interface; - } - - if ((locations & DirectiveLocation.Union) == DirectiveLocation.Union) - { - yield return DirectiveLocation.Union; - } - - if ((locations & DirectiveLocation.Enum) == DirectiveLocation.Enum) - { - yield return DirectiveLocation.Enum; - } - - if ((locations & DirectiveLocation.EnumValue) == DirectiveLocation.EnumValue) - { - yield return DirectiveLocation.EnumValue; - } - - if ((locations & DirectiveLocation.InputObject) == DirectiveLocation.InputObject) - { - yield return DirectiveLocation.InputObject; - } - - if ((locations & DirectiveLocation.InputFieldDefinition) == - DirectiveLocation.InputFieldDefinition) - { - yield return DirectiveLocation.InputFieldDefinition; - } - } -} diff --git a/src/HotChocolate/Core/src/Types/Types/Factories/DirectiveTypeFactory.cs b/src/HotChocolate/Core/src/Types/Types/Factories/DirectiveTypeFactory.cs index 2d2fceea9a5..ffd55f6cd33 100644 --- a/src/HotChocolate/Core/src/Types/Types/Factories/DirectiveTypeFactory.cs +++ b/src/HotChocolate/Core/src/Types/Types/Factories/DirectiveTypeFactory.cs @@ -1,95 +1,13 @@ -using System.Globalization; using HotChocolate.Configuration; using HotChocolate.Language; -using HotChocolate.Properties; using HotChocolate.Types.Descriptors; using HotChocolate.Types.Descriptors.Definitions; +using static HotChocolate.DirectiveLocationUtils; namespace HotChocolate.Types.Factories; internal sealed class DirectiveTypeFactory : ITypeFactory { - private static readonly Dictionary _locs = - new() - { - { - Language.DirectiveLocation.Query, - DirectiveLocation.Query - }, - { - Language.DirectiveLocation.Mutation, - DirectiveLocation.Mutation - }, - { - Language.DirectiveLocation.Subscription, - DirectiveLocation.Subscription - }, - { - Language.DirectiveLocation.Field, - DirectiveLocation.Field - }, - { - Language.DirectiveLocation.FragmentDefinition, - DirectiveLocation.FragmentDefinition - }, - { - Language.DirectiveLocation.FragmentSpread, - DirectiveLocation.FragmentSpread - }, - { - Language.DirectiveLocation.InlineFragment, - DirectiveLocation.InlineFragment - }, - { - Language.DirectiveLocation.Schema, - DirectiveLocation.Schema - }, - { - Language.DirectiveLocation.Scalar, - DirectiveLocation.Scalar - }, - { - Language.DirectiveLocation.Object, - DirectiveLocation.Object - }, - { - Language.DirectiveLocation.FieldDefinition, - DirectiveLocation.FieldDefinition - }, - { - Language.DirectiveLocation.ArgumentDefinition, - DirectiveLocation.ArgumentDefinition - }, - { - Language.DirectiveLocation.Interface, - DirectiveLocation.Interface - }, - { - Language.DirectiveLocation.Union, - DirectiveLocation.Union - }, - { - Language.DirectiveLocation.Enum, - DirectiveLocation.Enum - }, - { - Language.DirectiveLocation.EnumValue, - DirectiveLocation.EnumValue - }, - { - Language.DirectiveLocation.InputObject, - DirectiveLocation.InputObject - }, - { - Language.DirectiveLocation.InputFieldDefinition, - DirectiveLocation.InputFieldDefinition - }, - { - Language.DirectiveLocation.VariableDefinition, - DirectiveLocation.VariableDefinition - } - }; - public DirectiveType Create(IDescriptorContext context, DirectiveDefinitionNode node) { var typeDefinition = new DirectiveTypeDefinition( @@ -133,28 +51,6 @@ private static void DeclareLocations( DirectiveTypeDefinition parent, DirectiveDefinitionNode node) { - foreach (var location in node.Locations) - { - if (Language.DirectiveLocation.TryParse( - location.Value, - out var parsedLocation)) - { - parent.Locations |= MapDirectiveLocation(parsedLocation); - } - } - } - - private static DirectiveLocation MapDirectiveLocation( - Language.DirectiveLocation location) - { - if (!_locs.TryGetValue(location, out var loc)) - { - throw new NotSupportedException(string.Format( - CultureInfo.InvariantCulture, - TypeResources.DirectiveTypeFactory_LocationNotSupported, - location)); - } - - return loc; + parent.Locations = Parse(node.Locations); } } diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/ConditionPlanNode.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/ConditionPlanNode.cs deleted file mode 100644 index 305bc91a6c9..00000000000 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/ConditionPlanNode.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Text.Json; - -namespace HotChocolate.Fusion.Planning.Nodes; - -public sealed class ConditionPlanNode : PlanNode, ISerializablePlanNode, IPlanNodeProvider -{ - private readonly List _nodes = []; - - public ConditionPlanNode( - string variableName, - bool passingValue, - PlanNode? parent = null) - { - VariableName = variableName; - PassingValue = passingValue; - Parent = parent; - } - - /// - /// The name of the variable that controls if this node is executed. - /// - public string VariableName { get; } - - /// - /// The value the has to be, in order - /// for this node to be executed. - /// - public bool PassingValue { get; } - - public IReadOnlyList Nodes => _nodes; - - public void AddChildNode(PlanNode node) - { - ArgumentNullException.ThrowIfNull(node); - _nodes.Add(node); - node.Parent = this; - } - - public PlanNodeKind Kind => PlanNodeKind.Condition; - - public void Serialize(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - SerializationHelper.WriteKind(writer, this); - writer.WriteString("variableName", VariableName); - writer.WriteBoolean("passingValue", PassingValue); - SerializationHelper.WriteChildNodes(writer, this); - writer.WriteEndObject(); - } -} - -public record Condition(string VariableName, bool PassingValue); diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/FieldPlanNode.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/FieldPlanNode.cs index 63e02dff79b..88ea208486a 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/FieldPlanNode.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/FieldPlanNode.cs @@ -1,6 +1,4 @@ -using System.Diagnostics; using HotChocolate.Fusion.Types; -using HotChocolate.Fusion.Types.Collections; using HotChocolate.Language; namespace HotChocolate.Fusion.Planning.Nodes; @@ -12,7 +10,7 @@ public sealed class FieldPlanNode : SelectionPlanNode public FieldPlanNode( FieldNode fieldNode, OutputFieldInfo field) - : base(field.Type.NamedType(), fieldNode.SelectionSet?.Selections, fieldNode.Directives) + : base(field.Type.NamedType(), fieldNode.Directives, fieldNode.SelectionSet?.Selections) { FieldNode = fieldNode; Field = field; @@ -49,19 +47,10 @@ public void AddArgument(ArgumentAssignment argument) public FieldNode ToSyntaxNode() { - var directives = new List(Directives.ToSyntaxNode()); - - foreach (var condition in Conditions) - { - var directiveName = condition.PassingValue ? "include" : "skip"; - directives.Add(new DirectiveNode(directiveName, - new ArgumentNode("if", new VariableNode(condition.VariableName)))); - } - return new FieldNode( new NameNode(Field.Name), Field.Name.Equals(ResponseName) ? null : new NameNode(ResponseName), - directives, + Directives.ToSyntaxNode(), Arguments.ToSyntaxNode(), Selections.Count == 0 ? null : Selections.ToSyntaxNode()); } diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/FieldRequirementPlanNode.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/FieldRequirementPlanNode.cs new file mode 100644 index 00000000000..142283f66a9 --- /dev/null +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/FieldRequirementPlanNode.cs @@ -0,0 +1,31 @@ +using HotChocolate.Fusion.Types; +using HotChocolate.Language; + +namespace HotChocolate.Fusion.Planning.Nodes; + +public sealed class FieldRequirementPlanNode : PlanNode +{ + public FieldRequirementPlanNode( + string name, + OperationPlanNode from, + FieldPath selectionSet, + FieldPath requiredField, + ITypeNode type) + { + Name = name; + From = from; + SelectionSet = selectionSet; + RequiredField = requiredField; + Type = type; + } + + public string Name { get; } + + public OperationPlanNode From { get; } + + public FieldPath SelectionSet { get; } + + public FieldPath RequiredField { get; } + + public ITypeNode Type { get; } +} diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/IPlanNodeProvider.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/IPlanNodeProvider.cs deleted file mode 100644 index 1f227e1041e..00000000000 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/IPlanNodeProvider.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace HotChocolate.Fusion.Planning.Nodes; - -public interface IPlanNodeProvider -{ - public IReadOnlyList Nodes { get; } - - public void AddChildNode(PlanNode node); -} diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/ISerializablePlanNode.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/ISerializablePlanNode.cs deleted file mode 100644 index 3ccd83e54d9..00000000000 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/ISerializablePlanNode.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Text.Json; - -namespace HotChocolate.Fusion.Planning; - -public interface ISerializablePlanNode -{ - PlanNodeKind Kind { get; } - - void Serialize(Utf8JsonWriter writer); -} diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/InlineFragmentPlanNode.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/InlineFragmentPlanNode.cs index 919e9b00f59..72c89cc6217 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/InlineFragmentPlanNode.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/InlineFragmentPlanNode.cs @@ -5,10 +5,17 @@ namespace HotChocolate.Fusion.Planning.Nodes; public sealed class InlineFragmentPlanNode : SelectionPlanNode { + public InlineFragmentPlanNode( + ICompositeNamedType declaringType, + InlineFragmentNode inlineFragment) + : this(declaringType, inlineFragment.SelectionSet.Selections) + { + } + public InlineFragmentPlanNode( ICompositeNamedType declaringType, IReadOnlyList selectionNodes) - : base(declaringType, selectionNodes, []) + : base(declaringType, [], selectionNodes) { } diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/OperationPlanNode.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/OperationPlanNode.cs index aa7bbad8b6a..d6341b1a58f 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/OperationPlanNode.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/OperationPlanNode.cs @@ -1,4 +1,3 @@ -using System.Text.Json; using HotChocolate.Fusion.Types; using HotChocolate.Language; @@ -7,11 +6,13 @@ namespace HotChocolate.Fusion.Planning.Nodes; /// /// Represents an operation to resolve data from a specific source schema. /// -public sealed class OperationPlanNode : SelectionPlanNode, IPlanNodeProvider, ISerializablePlanNode +public sealed class OperationPlanNode : SelectionPlanNode { private static readonly IReadOnlyDictionary _emptyVariableMap = new Dictionary(); - private readonly List _nodes = []; + private readonly List _dependants = []; + // private List? _operations; + private Dictionary? _requirements; private Dictionary? _variables; public OperationPlanNode( @@ -19,7 +20,7 @@ public OperationPlanNode( ICompositeNamedType declaringType, SelectionSetNode selectionSet, PlanNode? parent = null) - : base(declaringType, selectionSet.Selections, []) + : base(declaringType, [], selectionSet.Selections) { SchemaName = schemaName; Parent = parent; @@ -30,7 +31,7 @@ public OperationPlanNode( ICompositeNamedType declaringType, IReadOnlyList selections, PlanNode? parent = null) - : base(declaringType, selections, []) + : base(declaringType, [], selections) { SchemaName = schemaName; Parent = parent; @@ -41,10 +42,20 @@ public OperationPlanNode( // todo: variable representations are missing. // todo: how to we represent state? + public IReadOnlyDictionary Requirements + => _requirements ??= new Dictionary(); + public IReadOnlyDictionary VariableDefinitions => _variables ?? _emptyVariableMap; - public IReadOnlyList Nodes => _nodes; + public IReadOnlyList Dependants => _dependants; + + public void AddRequirement(FieldRequirementPlanNode requirement) + { + ArgumentNullException.ThrowIfNull(requirement); + (_requirements ??= new Dictionary()).Add(requirement.Name, requirement); + requirement.Parent = this; + } public void AddVariableDefinition(VariableDefinitionNode variable) { @@ -52,11 +63,10 @@ public void AddVariableDefinition(VariableDefinitionNode variable) (_variables ??= new Dictionary()).Add(variable.Variable.Name.Value, variable); } - public void AddChildNode(PlanNode node) + public void AddDependantOperation(OperationPlanNode operation) { - ArgumentNullException.ThrowIfNull(node); - _nodes.Add(node); - node.Parent = this; + ArgumentNullException.ThrowIfNull(operation); + _dependants.Add(operation); } public OperationDefinitionNode ToSyntaxNode() @@ -65,20 +75,8 @@ public OperationDefinitionNode ToSyntaxNode() null, null, OperationType.Query, - _variables?.Values.OrderBy(t => t.Variable.Name.Value).ToArray() ?? [], + VariableDefinitions.Values.OrderBy(t => t.Variable.Name.Value).ToArray(), Directives.ToSyntaxNode(), Selections.ToSyntaxNode()); } - - public PlanNodeKind Kind => PlanNodeKind.Operation; - - public void Serialize(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - SerializationHelper.WriteKind(writer, this); - writer.WriteString("schema", SchemaName); - writer.WriteString("document", ToSyntaxNode().ToString(indented: false)); - SerializationHelper.WriteChildNodes(writer, this); - writer.WriteEndObject(); - } } diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/PlanNode.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/PlanNode.cs index 679c53ac277..c8b1d93889d 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/PlanNode.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/PlanNode.cs @@ -2,5 +2,5 @@ namespace HotChocolate.Fusion.Planning.Nodes; public abstract class PlanNode { - public PlanNode? Parent { get; internal set; } + public virtual PlanNode? Parent { get; internal set; } } diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/PlanNodeKind.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/PlanNodeKind.cs deleted file mode 100644 index 8fccdfe3539..00000000000 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/PlanNodeKind.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace HotChocolate.Fusion.Planning; - -public enum PlanNodeKind -{ - Root, - Operation, - Condition -} diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/RootPlanNode.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/RootPlanNode.cs index 913847ebefc..9990c2a1185 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/RootPlanNode.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/RootPlanNode.cs @@ -1,44 +1,15 @@ -using System.Text; -using System.Text.Json; - namespace HotChocolate.Fusion.Planning.Nodes; -public sealed class RootPlanNode : PlanNode, IPlanNodeProvider, ISerializablePlanNode +public sealed class RootPlanNode : PlanNode { - private static readonly JsonWriterOptions SerializerOptions = new() - { - Indented = true, - }; - private readonly List _nodes = []; + private readonly List _operations = []; - public IReadOnlyList Nodes => _nodes; + public IReadOnlyList Operations => _operations; - public void AddChildNode(PlanNode node) + public void AddOperation(OperationPlanNode node) { ArgumentNullException.ThrowIfNull(node); - _nodes.Add(node); + _operations.Add(node); node.Parent = this; } - - public PlanNodeKind Kind => PlanNodeKind.Root; - - public string Serialize() - { - using var memoryStream = new MemoryStream(); - var jsonWriter = new Utf8JsonWriter(memoryStream, SerializerOptions); - - Serialize(jsonWriter); - - return Encoding.UTF8.GetString(memoryStream.ToArray()); - } - - public void Serialize(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - SerializationHelper.WriteKind(writer, this); - SerializationHelper.WriteChildNodes(writer, this); - writer.WriteEndObject(); - - writer.Flush(); - } } diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/SelectionPlanNode.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/SelectionPlanNode.cs index 90ca75e7c71..ce8cfc9fe12 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/SelectionPlanNode.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/SelectionPlanNode.cs @@ -10,7 +10,9 @@ public abstract class SelectionPlanNode : PlanNode { private List? _directives; private List? _selections; - private List? _conditions; + private bool? _isConditional; + private string? _skipVariable; + private string? _includeVariable; /// /// Initializes a new instance of . @@ -18,39 +20,21 @@ public abstract class SelectionPlanNode : PlanNode /// /// The type on which this selection is declared on. /// - /// - /// The child selection syntax nodes of this selection. - /// /// /// The directives applied to this selection. /// + /// + /// The child selection syntax nodes of this selection. + /// protected SelectionPlanNode( ICompositeNamedType declaringType, - IReadOnlyList? selectionNodes, - IReadOnlyList directiveNodes) + IReadOnlyList directiveNodes, + IReadOnlyList? selectionNodes) { DeclaringType = declaringType; IsEntity = declaringType.IsEntity(); + DirectiveNodes = directiveNodes; SelectionNodes = selectionNodes; - - foreach (var directive in directiveNodes) - { - var isSkipDirective = directive.Name.Value.Equals("skip"); - var isIncludeDirective = directive.Name.Value.Equals("include"); - - // TODO: Ideally this would be just a lookup to the directive - if (isSkipDirective || isIncludeDirective) - { - var ifArgument = directive.Arguments.FirstOrDefault( - t => t.Name.Value.Equals("if")); - - if (ifArgument?.Value is VariableNode variableNode) - { - var condition = new Condition(variableNode.Name.Value, isIncludeDirective); - (_conditions ??= []).Add(condition); - } - } - } } /// @@ -63,6 +47,11 @@ protected SelectionPlanNode( /// public bool IsEntity { get; } + /// + /// Gets the directives nodes that are annotated to the selection. + /// + public IReadOnlyList DirectiveNodes { get; } + /// /// Gets the directives that are annotated to this selection. /// @@ -80,7 +69,51 @@ public IReadOnlyList Directives public IReadOnlyList Selections => _selections ?? (IReadOnlyList)Array.Empty(); - public IReadOnlyList Conditions => _conditions ?? []; + /// + /// Defines if the selection is conditional. + /// + public bool IsConditional + { + get + { + InitializeConditions(); + return _isConditional ?? false; + } + } + + /// + /// Gets the skip variable name if the selection is conditional. + /// + public string? SkipVariable + { + get + { + InitializeConditions(); + return _skipVariable; + } + set + { + _skipVariable = value; + _isConditional = _skipVariable is not null || _includeVariable is not null; + } + } + + /// + /// Gets the include variable name if the selection is conditional. + /// + public string? IncludeVariable + { + get + { + InitializeConditions(); + return _includeVariable; + } + set + { + _includeVariable = value; + _isConditional = _skipVariable is not null || _includeVariable is not null; + } + } /// /// Adds a child selection to this selection. @@ -114,16 +147,48 @@ public void AddDirective(CompositeDirective directive) (_directives ??= []).Add(directive); } - // TODO: Maybe remove - public void RemoveCondition(Condition condition) - { - ArgumentNullException.ThrowIfNull(condition); + public bool RemoveDirective(CompositeDirective directive) + => _directives?.Remove(directive) == true; - if (_conditions is null) + private void InitializeConditions() + { + if(_isConditional.HasValue) { return; } - _conditions.Remove(condition); + foreach (var directive in DirectiveNodes) + { + if (_skipVariable is not null && _includeVariable is not null) + { + break; + } + + if (directive.Name.Value.Equals("skip")) + { + _skipVariable = GetVariableName(directive); + continue; + } + + if (directive.Name.Value.Equals("skip")) + { + _includeVariable = GetVariableName(directive); + } + } + + _isConditional = _skipVariable is not null || _includeVariable is not null; + return; + + string? GetVariableName(DirectiveNode directive) + { + var ifArgument = directive.Arguments.FirstOrDefault(t => t.Name.Value.Equals("if")); + + if (ifArgument?.Value is VariableNode variableNode) + { + return variableNode.Name.Value; + } + + return null; + } } } diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/SerializationHelper.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/SerializationHelper.cs deleted file mode 100644 index 7bfbddaa3e1..00000000000 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/Nodes/SerializationHelper.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Text.Json; - -namespace HotChocolate.Fusion.Planning.Nodes; - -public static class SerializationHelper -{ - public static void WriteChildNodes(Utf8JsonWriter writer, IPlanNodeProvider planNodeProvider) - { - if (planNodeProvider.Nodes.Count == 0) - { - return; - } - - writer.WritePropertyName("nodes"); - writer.WriteStartArray(); - - foreach (var node in planNodeProvider.Nodes.OfType()) - { - node.Serialize(writer); - } - - writer.WriteEndArray(); - } - - public static void WriteKind(Utf8JsonWriter writer, ISerializablePlanNode serializablePlanNode) - { - writer.WriteString("kind", serializablePlanNode.Kind.ToString()); - } -} diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/OperationPlanner.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/OperationPlanner.cs index 593226206b3..ebcd5dda618 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/OperationPlanner.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/OperationPlanner.cs @@ -10,6 +10,8 @@ namespace HotChocolate.Fusion.Planning; public sealed class OperationPlanner(CompositeSchema schema) { + private int _lastRequirementId; + public RootPlanNode CreatePlan(DocumentNode document, string? operationName) { ArgumentNullException.ThrowIfNull(document); @@ -26,10 +28,11 @@ public RootPlanNode CreatePlan(DocumentNode document, string? operationName) schema.QueryType, operationDefinition.SelectionSet); - if (TryPlanSelectionSet(operation, operation, new Stack())) + var context = new PlaningContext(operation, operation, ImmutableStack.Empty); + if (TryPlanSelectionSet(context)) { - var planNodeToAdd = PlanConditionNode(operation.Selections, operation); - operationPlan.AddChildNode(planNodeToAdd); + PlanConditionNode(operation, operation.Selections); + operationPlan.AddOperation(operation); } } @@ -39,22 +42,21 @@ public RootPlanNode CreatePlan(DocumentNode document, string? operationName) } private bool TryPlanSelectionSet( - OperationPlanNode operation, - SelectionPlanNode parent, - Stack path, + PlaningContext context, bool skipUnresolved = false) { - if (parent.SelectionNodes is null) + if (context.Parent.SelectionNodes is null) { throw new InvalidOperationException( "A leaf field cannot be a parent node."); } - List? unresolved = null; - var type = (CompositeComplexType)parent.DeclaringType; + List? unresolvedFields = null; + // List? unresolvedTypes = null; + var type = (CompositeComplexType)context.Parent.DeclaringType; var haveConditionalSelectionsBeenRemoved = false; - foreach (var selection in parent.SelectionNodes) + foreach (var selection in context.Parent.SelectionNodes) { if (IsSelectionAlwaysSkipped(selection)) { @@ -62,78 +64,22 @@ private bool TryPlanSelectionSet( continue; } - if (selection is FieldNode fieldNode) - { - if (!type.Fields.TryGetField(fieldNode.Name.Value, out var field)) - { - throw new InvalidOperationException( - "There is an unknown field in the selection set."); - } - - // if we have an operation plan node we have a pre-validated set of - // root fields, so we now the field will be resolvable on the - // source schema. - if (parent is OperationPlanNode || IsResolvable(fieldNode, field, operation.SchemaName)) - { - var fieldNamedType = field.Type.NamedType(); - - // if the field has no selection set it must be a leaf type. - // This also means that if this field is resolvable that we can - // just include it and no further processing is required. - if (fieldNode.SelectionSet is null) - { - if (fieldNamedType.Kind is not TypeKind.Enum and not TypeKind.Scalar) - { - throw new InvalidOperationException( - "Only complex types can have a selection set."); - } - - parent.AddSelection(new FieldPlanNode(fieldNode, field)); - continue; - } - - // if this field as a selection set it must be a object, interface or union type, - // otherwise the validation should have caught this. So, we just throw here if this - // is not the case. - if (fieldNamedType.Kind != TypeKind.Object && - fieldNamedType.Kind != TypeKind.Interface && - fieldNamedType.Kind != TypeKind.Union) - { - throw new InvalidOperationException( - "Only object, interface, or union types can have a selection set."); - } - - var fieldPlanNode = new FieldPlanNode(fieldNode, field); - var pathSegment = new SelectionPathSegment(fieldPlanNode); - - path.Push(pathSegment); - - if (TryPlanSelectionSet(operation, fieldPlanNode, path)) - { - parent.AddSelection(fieldPlanNode); - } - else - { - unresolved ??= []; - unresolved.Add(new UnresolvedField(fieldNode, field, parent)); - } - - path.Pop(); - } - else + TryPlanSelection( + context, + type, + selection, + unresolvedField => { - // unresolvable fields will be collected to backtrack later. - unresolved ??= []; - unresolved.Add(new UnresolvedField(fieldNode, field, parent)); - } - } + unresolvedFields ??= new List(); + unresolvedFields.Add(unresolvedField); + }); } if (haveConditionalSelectionsBeenRemoved) { // If we have removed conditional selections from a composite field, we need to add a __typename field // to have a valid selection set. - if (parent is FieldPlanNode fieldPlanNode && fieldPlanNode.Selections.Count == 0) + if (context.Parent is FieldPlanNode { Selections.Count: 0 } fieldPlanNode) { // TODO: How to properly create a __typename field? var dummyType = new CompositeObjectType("Dummy", description: null, @@ -143,43 +89,149 @@ private bool TryPlanSelectionSet( } // If we have removed conditional selections from an operation, we need to fail the creation // of the operation as it would be invalid without any selections. - else if (parent is OperationPlanNode operationPlanNode && operationPlanNode.Selections.Count == 0) + else if (context.Parent is OperationPlanNode { Selections.Count: 0 }) { return false; } } - return skipUnresolved || - unresolved is null || - unresolved.Count == 0 || - TryHandleUnresolvedSelections(operation, parent, type, unresolved, path); + return skipUnresolved + || unresolvedFields is null + || unresolvedFields.Count == 0 + || TryHandleUnresolvedSelections(context, type, unresolvedFields); + } + + private bool TryPlanSelection( + PlaningContext context, + CompositeComplexType type, + ISelectionNode selectionNode, + Action trackUnresolvedField) + { + if (selectionNode is FieldNode fieldNode) + { + return TryPlanFieldSelection( + context, + type, + fieldNode, + trackUnresolvedField); + } + + return false; + } + + private bool TryPlanFieldSelection( + PlaningContext context, + CompositeComplexType type, + FieldNode fieldNode, + Action trackUnresolvedField) + { + if (!type.Fields.TryGetField(fieldNode.Name.Value, out var field)) + { + throw new InvalidOperationException( + "There is an unknown field in the selection set."); + } + + // if we have an operation plan node we have a pre-validated set of + // root fields, so we now the field will be resolvable on the + // source schema. + if (context.Parent is OperationPlanNode + || IsResolvable(fieldNode, field, context.Operation.SchemaName)) + { + var fieldNamedType = field.Type.NamedType(); + + // if the field has no selection set it must be a leaf type. + // This also means that if this field is resolvable that we can + // just include it and no further processing is required. + if (fieldNode.SelectionSet is null) + { + if (fieldNamedType.Kind is not TypeKind.Enum and not TypeKind.Scalar) + { + throw new InvalidOperationException( + "Only complex types can have a selection set."); + } + + var leafField = new FieldPlanNode(fieldNode, field); + AddSelectionDirectives(leafField, fieldNode.Directives); + context.Parent.AddSelection(leafField); + return true; + } + + // if this field as a selection set it must be a object, interface or union type, + // otherwise the validation should have caught this. So, we just throw here if this + // is not the case. + if (fieldNamedType.Kind != TypeKind.Object + && fieldNamedType.Kind != TypeKind.Interface + && fieldNamedType.Kind != TypeKind.Union) + { + throw new InvalidOperationException( + "Only object, interface, or union types can have a selection set."); + } + + var fieldPlanNode = new FieldPlanNode(fieldNode, field); + AddSelectionDirectives(fieldPlanNode, fieldNode.Directives); + + var pathSegment = new SelectionPathSegment(fieldPlanNode); + + if (TryPlanSelectionSet(context with { Parent = fieldPlanNode, Path = context.Path.Push(pathSegment) })) + { + context.Parent.AddSelection(fieldPlanNode); + return true; + } + + trackUnresolvedField(new UnresolvedField(fieldNode, field)); + return false; + } + + // unresolvable fields will be collected to backtrack later. + trackUnresolvedField(new UnresolvedField(fieldNode, field)); + return false; + } + + private void AddSelectionDirectives( + SelectionPlanNode selection, + IReadOnlyList directiveNodes) + { + foreach (var directiveNode in directiveNodes) + { + var directiveType = schema.GetDirectiveType(directiveNode.Name.Value); + + if ((directiveType == schema.SkipDirective || directiveType == schema.IncludeDirective) + && directiveNode.Arguments[0].Value is BooleanValueNode) + { + continue; + } + + var argumentAssignments = directiveNode.Arguments.Select( + a => new ArgumentAssignment(a.Name.Value, a.Value)).ToList(); + selection.AddDirective(new CompositeDirective(directiveType, argumentAssignments)); + } } private bool TryHandleUnresolvedSelections( - OperationPlanNode operation, - SelectionPlanNode parent, + PlaningContext context, CompositeComplexType type, - List unresolved, - Stack path) + List unresolved) { - if (!TryResolveEntityType(parent, out var entityPath)) + if (!TryResolveEntityType(context.Parent, out var entityPath)) { return false; } // if we have found an entity to branch of from we will check // if any of the unresolved selections can be resolved through one of the entity lookups. - var processedSchemas = new HashSet(); + var schemasInContext = new Dictionary(); var processedFields = new HashSet(); var fields = new List(); + schemasInContext.Add(context.Operation.SchemaName, context.Operation); + // we first try to weight the schemas that the fields can be resolved by. // The schema is weighted by the fields it potentially can resolve. - var schemasWeighted = GetSchemasWeighted(unresolved, processedSchemas); + var schemasWeighted = GetSchemasWeighted(unresolved, schemasInContext.Keys); foreach (var schemaName in schemasWeighted.OrderByDescending(t => t.Value).Select(t => t.Key)) { - if (!processedSchemas.Add(schemaName)) + if (schemasInContext.ContainsKey(schemaName)) { continue; } @@ -191,7 +243,12 @@ private bool TryHandleUnresolvedSelections( } // next we try to find a lookup - if (!TryGetLookup((SelectionPlanNode)entityPath.Peek(), processedSchemas, out var lookup)) + if (!TryGetLookup( + (SelectionPlanNode)entityPath.Peek(), + schemaName, + schemasInContext.Keys, + out var lookup, + out var fieldSchemaDependencies)) { continue; } @@ -203,25 +260,76 @@ private bool TryHandleUnresolvedSelections( foreach (var unresolvedField in unresolved) { - if (unresolvedField.Field.Sources.ContainsSchema(schemaName) && - !processedFields.Contains(unresolvedField.Field.Name)) + if (unresolvedField.Field.Sources.ContainsSchema(schemaName) + && !processedFields.Contains(unresolvedField.Field.Name)) { fields.Add(unresolvedField.FieldNode); } } - var lookupOperation = CreateLookupOperation(schemaName, lookup, type, parent, fields); - var lookupField = lookupOperation.Selections[0]; - - // what do we do of its not successful - if (!TryPlanSelectionSet(lookupOperation, lookupField, path)) + var (lookupOperation, lookupField) = + CreateLookupOperation(schemaName, lookup, type, context.Parent, fields); + if (!TryPlanSelectionSet(context with { Operation = lookupOperation, Parent = lookupField }, true)) { continue; } - var planNodeToAdd = PlanConditionNode(lookupField.Selections, lookupOperation); - operation.AddChildNode(planNodeToAdd); + schemasInContext.Add(schemaName, lookupOperation); + PlanConditionNode(lookupOperation, lookupField.Selections); + + // we add the lookup operation to all the schemas that we have requirements with. + foreach (var requiredSchema in fieldSchemaDependencies.Values.Distinct()) + { + // Add child node is wrong ... this is a graph and the lookup operation has dependencies on + // this operation. We should probably double link here. + // maybe AddDependantNode()? + schemasInContext[requiredSchema].AddDependantOperation(lookupOperation); + } + + // add requirements to the operation + for (var i = 0; i < lookup.Fields.Length; i++) + { + var requirementName = GetNextRequirementName(); + var requiredField = lookup.Fields[i]; + var argument = lookup.Arguments[i]; + + var requiredFromSchema = fieldSchemaDependencies[requiredField]; + var requiredFromOperation = schemasInContext[requiredFromSchema]; + var requiredFromSelectionSet = requiredFromOperation != context.Operation + ? requiredFromOperation.Selections.Single() + : context.Parent; + var requiredFromPathStack = requiredFromOperation != context.Operation + ? ImmutableStack.Empty.Push(new SelectionPathSegment(lookupField)) + : context.Path; + var requiredFromPath = CreateFieldPath(requiredFromPathStack); + var requiredFromContext = new PlaningContext( + requiredFromOperation, + requiredFromSelectionSet, + requiredFromPathStack); + + if (!TryPlanSelection( + requiredFromContext, + (CompositeComplexType)requiredFromSelectionSet.DeclaringType, + CreateFieldNodeFromPath(requiredField), + _ => { })) + { + return false; + } + + var requirement = new FieldRequirementPlanNode( + requirementName, + requiredFromOperation, + requiredFromPath, + requiredField, + argument.Type); + + lookupOperation.AddRequirement(requirement); + lookupField.AddArgument(new ArgumentAssignment(argument.Name, new VariableNode(requirementName))); + } + // we register the fields that we were able to resolve with the lookup + // so that if there are still unresolved fields we can check if we can + // resolve them with another lookup. foreach (var selection in lookupField.Selections) { switch (selection) @@ -289,25 +397,92 @@ private bool IsResolvable( string schemaName) => field.Sources.ContainsSchema(schemaName); - private bool TryGetLookup(SelectionPlanNode selection, HashSet schemas, out Lookup lookup) + // this needs more meat + private bool IsResolvable( + InlineFragmentNode inlineFragment, + CompositeComplexType typeCondition, + string schemaName) + => typeCondition.Sources.ContainsSchema(schemaName); + + private static bool TryGetLookup( + SelectionPlanNode selection, + string schemaName, + IReadOnlyCollection schemasInContext, + [NotNullWhen(true)] out Lookup? lookup, + [NotNullWhen(true)] out ImmutableDictionary? fieldSchemaDependencies) + { + var declaringType = (CompositeComplexType)selection.DeclaringType; + var builder = ImmutableDictionary.CreateBuilder(); + + if (declaringType.Sources.TryGetType(schemaName, out var source) + && source.Lookups.Length > 0) + { + foreach (var possibleLookup in source.Lookups.OrderBy(t => t.Fields.Length)) + { + builder.Clear(); + + foreach (var field in possibleLookup.Fields) + { + if (!IsResolvable(declaringType, field, schemasInContext, out var requiredSchema)) + { + break; + } + + builder.Add(field, requiredSchema); + } + + lookup = possibleLookup; + fieldSchemaDependencies = builder.ToImmutable(); + return true; + } + } + + lookup = default; + fieldSchemaDependencies = default; + return false; + } + + private static bool IsResolvable( + ICompositeType type, + FieldPath fieldPath, + IEnumerable schemasInContext, + [NotNullWhen(true)] out string? requiredSchema) { - // we need a helper here that can take lookups from interfaces - // also this is a simplified selection of a lookup ... we have to take into account what data - // is available for free. - foreach (var schemaName in schemas) + foreach (var schemaName in schemasInContext) { - if (((CompositeComplexType)selection.DeclaringType).Sources.TryGetType(schemaName, out var source) && - source.Lookups.Length > 0) + if (IsResolvable(type, fieldPath, schemaName)) { - lookup = source.Lookups[0]; + requiredSchema = schemaName; return true; } } - throw new NotImplementedException(); + requiredSchema = null; + return false; + } + + private static bool IsResolvable( + ICompositeType type, + FieldPath fieldPath, + string schemaName) + { + foreach (var segment in fieldPath.Reverse()) + { + if (type.NamedType() is not CompositeComplexType complexType + || !complexType.Fields.TryGetField(segment.Name, out var field) + || !field.Sources.TryGetMember(schemaName, out var source) + || source.Requirements is not null) + { + return false; + } + + type = field.Type; + } + + return true; } - private OperationPlanNode CreateLookupOperation( + private LookupOperation CreateLookupOperation( string schemaName, Lookup lookup, CompositeComplexType entityType, @@ -338,7 +513,7 @@ private OperationPlanNode CreateLookupOperation( lookupOperation.AddSelection(lookupFieldPlan); - return lookupOperation; + return new LookupOperation(lookupOperation, lookupFieldPlan); } private static Dictionary GetSchemasWeighted( @@ -399,60 +574,85 @@ private static Dictionary GetSchemasWeighted( return counts; } - private PlanNode PlanConditionNode( - IReadOnlyList selectionPlanNodes, - OperationPlanNode operation) + private static FieldPath CreateFieldPath(ImmutableStack path) + { + var current = FieldPath.Root; + + foreach (var segment in path.Reverse()) + { + if (segment.PlanNode is FieldPlanNode field) + { + current = current.Append(field.Field.Name); + } + } + + return current; + } + + private static FieldNode CreateFieldNodeFromPath(FieldPath path) { - var firstSelection = selectionPlanNodes.FirstOrDefault(); - if (firstSelection is null || firstSelection.Conditions.Count == 0) + var current = new FieldNode(path.Name); + + foreach (var segment in path.Skip(1)) { - return operation; + current = new FieldNode( + null, + new NameNode(segment.Name), + null, + Array.Empty(), + Array.Empty(), + new SelectionSetNode([current])); } - var conditionsOnFirstSelectionNode = new HashSet(firstSelection.Conditions); + return current!; + } - foreach (var selection in selectionPlanNodes.Skip(1)) + private void PlanConditionNode( + OperationPlanNode operation, + IReadOnlyList selections) + { + var firstSelection = selections.FirstOrDefault(); + if (firstSelection?.IsConditional != true) { - if (selection.Conditions.Count == 0) + return; + } + + foreach (var selection in selections.Skip(1)) + { + // if any root selection of an operation node has no condition + // the operation will always be executed. + if (!selection.IsConditional) { - return operation; + return; } - foreach (var condition in selection.Conditions) + if (!string.Equals(firstSelection.SkipVariable, selection.SkipVariable, StringComparison.Ordinal) + || !string.Equals(firstSelection.IncludeVariable, selection.IncludeVariable, StringComparison.Ordinal)) { - if (!conditionsOnFirstSelectionNode.Contains(condition)) - { - return operation; - } + return; } } - ConditionPlanNode? startConditionNode = null; - ConditionPlanNode? lastConditionNode = null; + operation.SkipVariable = firstSelection.SkipVariable; + operation.IncludeVariable = firstSelection.IncludeVariable; + + var remove = new List(); - foreach (var sharedCondition in conditionsOnFirstSelectionNode) + foreach (var selection in selections) { - foreach (var selection in selectionPlanNodes) - { - selection.RemoveCondition(sharedCondition); - } + selection.SkipVariable = null; + selection.IncludeVariable = null; - if (startConditionNode is null) - { - startConditionNode = lastConditionNode = - new ConditionPlanNode(sharedCondition.VariableName, sharedCondition.PassingValue); - } - else if (lastConditionNode is not null) + remove.AddRange( + selection.Directives.Where( + t => t.Type == schema.SkipDirective + || t.Type == schema.IncludeDirective)); + + foreach (var directive in remove) { - var childCondition = new ConditionPlanNode(sharedCondition.VariableName, sharedCondition.PassingValue); - lastConditionNode.AddChildNode(childCondition); - lastConditionNode = childCondition; + selection.RemoveDirective(directive); } } - - lastConditionNode?.AddChildNode(operation); - - return startConditionNode!; } private bool IsSelectionAlwaysSkipped(ISelectionNode selectionNode) @@ -495,59 +695,31 @@ private bool IsSelectionAlwaysSkipped(ISelectionNode selectionNode) return selectionIsSkipped; } - private (bool IsSelectionNodeObsolete, List? conditions) CreateConditions(ISelectionNode selectionNode) - { - List? conditions = null; - var isSelectionNodeObsolete = false; - - foreach (var directive in selectionNode.Directives) - { - var isSkipDirective = directive.Name.Value == "skip"; - var isIncludedDirective = directive.Name.Value == "include"; - - if (isSkipDirective || isIncludedDirective) - { - var ifArgument = directive.Arguments.FirstOrDefault(a => a.Name.Value == "if"); - - if (ifArgument is not null) - { - if (ifArgument.Value is VariableNode variableNode) - { - conditions ??= new List(); - conditions.Add(new Condition(variableNode.Name.Value, isIncludedDirective)); - } - else if (ifArgument.Value is BooleanValueNode booleanValueNode) - { - if (booleanValueNode.Value && isSkipDirective) - { - isSelectionNodeObsolete = true; - } - else if (!booleanValueNode.Value && isIncludedDirective) - { - isSelectionNodeObsolete = true; - } - else - { - isSelectionNodeObsolete = false; - } - } - } - } - } - - return (isSelectionNodeObsolete, conditions); - } + private string GetNextRequirementName() + => $"__fusion_requirement_{++_lastRequirementId}"; public record SelectionPathSegment( SelectionPlanNode PlanNode); public record UnresolvedField( FieldNode FieldNode, - CompositeOutputField Field, - SelectionPlanNode Parent); + CompositeOutputField Field); + + public record UnresolvedType( + InlineFragmentNode InlineFragment, + CompositeComplexType TypeCondition); public class RequestPlanNode { public ICollection Operations { get; } = new List(); } + + private record struct LookupOperation( + OperationPlanNode Operation, + FieldPlanNode Field); + + private record struct PlaningContext( + OperationPlanNode Operation, + SelectionPlanNode Parent, + ImmutableStack Path); } diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/OperationVariableBinder.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/OperationVariableBinder.cs index 26fdbd0588a..488c4fafd59 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/OperationVariableBinder.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/OperationVariableBinder.cs @@ -9,7 +9,7 @@ public static void BindOperationVariables( OperationDefinitionNode operationDefinition, RootPlanNode operationPlan) { - var operationBacklog = new Stack(operationPlan.Nodes.OfType()); + var operationBacklog = new Stack(operationPlan.Operations.OfType()); var selectionBacklog = new Stack(); var variableDefinitions = operationDefinition.VariableDefinitions.ToDictionary(t => t.Variable.Name.Value); var usedVariables = new HashSet(); @@ -18,7 +18,7 @@ public static void BindOperationVariables( { CollectAndBindUsedVariables(operation, variableDefinitions, usedVariables, selectionBacklog); - foreach (var child in operation.Nodes.OfType()) + foreach (var child in operation.Dependants.OfType()) { operationBacklog.Push(child); } @@ -57,11 +57,6 @@ private static void CollectAndBindUsedVariables( } } } - - foreach (var condition in field.Conditions) - { - usedVariables.Add(condition.VariableName); - } } foreach (var selection in node.Selections) @@ -72,7 +67,22 @@ private static void CollectAndBindUsedVariables( foreach (var variable in usedVariables) { - operation.AddVariableDefinition(variableDefinitions[variable]); + if(variableDefinitions.TryGetValue(variable, out var variableDefinition)) + { + operation.AddVariableDefinition(variableDefinition); + } + } + + foreach (var requirement in operation.Requirements.Values) + { + var variable = new VariableDefinitionNode( + null, + new VariableNode(requirement.Name), + requirement.Type, + null, + Array.Empty()); + + operation.AddVariableDefinition(variable); } } } diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/PlanNodeJsonFormatter.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/PlanNodeJsonFormatter.cs new file mode 100644 index 00000000000..33e1c110675 --- /dev/null +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/PlanNodeJsonFormatter.cs @@ -0,0 +1,131 @@ +using System.Buffers; +using System.Text; +using System.Text.Json; +using HotChocolate.Fusion.Planning.Nodes; + +namespace HotChocolate.Fusion.Planning; + +public static class PlanNodeJsonFormatter +{ + public static string ToJson(this RootPlanNode root) + { + var buffer = new ArrayBufferWriter(); + var writer = new Utf8JsonWriter(buffer, new JsonWriterOptions { Indented = true }); + writer.Write(root); + writer.Flush(); + return Encoding.UTF8.GetString(buffer.WrittenSpan); + } + + public static void Write(this Utf8JsonWriter writer, RootPlanNode root) + { + var nodeIdLookup = CollectNodeIds(root); + + writer.WriteStartObject(); + + writer.WritePropertyName("nodes"); + writer.WriteStartArray(); + + foreach (var (node, nodeId) in nodeIdLookup.OrderBy(t => t.Value)) + { + WriteOperationNode(writer, node, nodeId, nodeIdLookup); + } + + writer.WriteEndArray(); + writer.WriteEndObject(); + } + + private static void WriteOperationNode( + Utf8JsonWriter writer, + OperationPlanNode operation, + int operationId, + Dictionary nodeIdLookup) + { + writer.WriteStartObject(); + writer.WriteNumber("id", operationId); + writer.WriteString("schema", operation.SchemaName); + writer.WriteString("operation", operation.ToSyntaxNode().ToString(false)); + + if (operation.SkipVariable is not null) + { + writer.WriteString("skipIf", operation.SkipVariable); + } + + if (operation.IncludeVariable is not null) + { + writer.WriteString("includeIf", operation.SkipVariable); + } + + if (operation.Requirements.Count > 0) + { + writer.WritePropertyName("requirements"); + writer.WriteStartArray(); + + foreach (var requirement in operation.Requirements.Values) + { + writer.WriteStartObject(); + writer.WriteString("name", requirement.Name); + writer.WriteNumber("dependsOn", nodeIdLookup[requirement.From]); + + writer.WritePropertyName("selectionSet"); + writer.WriteStartArray(); + + foreach (var segment in requirement.SelectionSet.Reverse()) + { + writer.WriteStringValue(segment.Name); + } + + writer.WriteEndArray(); + + writer.WritePropertyName("field"); + writer.WriteStartArray(); + + foreach (var segment in requirement.RequiredField.Reverse()) + { + writer.WriteStringValue(segment.Name); + } + + writer.WriteEndArray(); + + writer.WriteString("type", requirement.Type.ToString(false)); + writer.WriteEndObject(); + } + + writer.WriteEndArray(); + } + + writer.WriteEndObject(); + } + + private static Dictionary CollectNodeIds(PlanNode root) + { + var nextId = 1; + var nodeIdLookup = new Dictionary(); + var backlog = new Queue(); + backlog.Enqueue(root); + + while (backlog.TryDequeue(out var node)) + { + if (node is RootPlanNode rootPlanNode) + { + foreach (var child in rootPlanNode.Operations) + { + backlog.Enqueue(child); + } + } + else if (node is OperationPlanNode operationPlanNode) + { + if (!nodeIdLookup.ContainsKey(operationPlanNode)) + { + nodeIdLookup.Add(operationPlanNode, nextId++); + } + + foreach (var child in operationPlanNode.Dependants) + { + backlog.Enqueue(child); + } + } + } + + return nodeIdLookup; + } +} diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/PlanNodeYamlFormatter.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/PlanNodeYamlFormatter.cs new file mode 100644 index 00000000000..282a08e0349 --- /dev/null +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/PlanNodeYamlFormatter.cs @@ -0,0 +1,110 @@ +using System.Buffers; +using System.Text; +using System.Text.Json; +using HotChocolate.Fusion.Planning.Nodes; + +namespace HotChocolate.Fusion.Planning; + +public static class PlanNodeYamlFormatter +{ + public static string ToYaml(this RootPlanNode root) + { + var sb = new StringBuilder(); + var writer = new StringWriter(sb); + Write(writer, root); + writer.Flush(); + return sb.ToString(); + } + + public static void Write(this StringWriter writer, RootPlanNode root) + { + var nodeIdLookup = CollectNodeIds(root); + + writer.WriteLine("nodes:"); + + foreach (var (node, nodeId) in nodeIdLookup.OrderBy(t => t.Value)) + { + WriteOperationNode(writer, node, nodeId, nodeIdLookup); + } + } + + private static void WriteOperationNode( + StringWriter writer, + OperationPlanNode operation, + int operationId, + Dictionary nodeIdLookup) + { + writer.WriteLine(" - id: {0}", operationId); + writer.WriteLine(" schema: \"{0}\"", operation.SchemaName); + writer.WriteLine(" operation: >-"); + + var reader = new StringReader(operation.ToSyntaxNode().ToString()); + while (true) + { + var line = reader.ReadLine(); + if (line is null) + { + break; + } + + writer.WriteLine(" {0}", line); + } + + if (operation.SkipVariable is not null) + { + writer.WriteLine(" skipIf: \"{0}\"", operation.SkipVariable); + } + + if (operation.IncludeVariable is not null) + { + writer.WriteLine(" includeIf: \"{0}\"", operation.SkipVariable); + } + + if (operation.Requirements.Count > 0) + { + writer.WriteLine(" requirements:"); + + foreach (var requirement in operation.Requirements.Values) + { + writer.WriteLine(" - name: \"{0}\"", requirement.Name); + writer.WriteLine(" dependsOn: \"{0}\"", nodeIdLookup[requirement.From]); + writer.WriteLine(" selectionSet: \"{0}\"", requirement.SelectionSet); + writer.WriteLine(" field: \"{0}\"", requirement.RequiredField); + writer.WriteLine(" type: \"{0}\"", requirement.Type.ToString(false)); + } + } + } + + private static Dictionary CollectNodeIds(PlanNode root) + { + var nextId = 1; + var nodeIdLookup = new Dictionary(); + var backlog = new Queue(); + backlog.Enqueue(root); + + while (backlog.TryDequeue(out var node)) + { + if (node is RootPlanNode rootPlanNode) + { + foreach (var child in rootPlanNode.Operations) + { + backlog.Enqueue(child); + } + } + else if (node is OperationPlanNode operationPlanNode) + { + if (!nodeIdLookup.ContainsKey(operationPlanNode)) + { + nodeIdLookup.Add(operationPlanNode, nextId++); + } + + foreach (var child in operationPlanNode.Dependants) + { + backlog.Enqueue(child); + } + } + } + + return nodeIdLookup; + } +} diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/Completion/CompletionTools.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/Completion/CompletionTools.cs index c2438f603b5..4ea32ea00f3 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/Completion/CompletionTools.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/Completion/CompletionTools.cs @@ -23,9 +23,9 @@ public static DirectiveCollection CreateDirectiveCollection( for (var i = 0; i < directives.Count; i++) { var directive = directives[i]; - var definition = context.GetDirectiveDefinition(directive.Name.Value); + var directiveType = context.GetDirectiveType(directive.Name.Value); var arguments = CreateArgumentAssignments(directive.Arguments); - temp[i] = new CompositeDirective(definition, arguments); + temp[i] = new CompositeDirective(directiveType, arguments); } return new DirectiveCollection(temp); @@ -120,7 +120,6 @@ private static ImmutableArray GetLookupBySchema( new Lookup( lookup.SchemaName, lookup.Field.Name.Value, - LookupKind.Default, arguments.ToImmutable(), fields.ToImmutable())); } diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/Completion/CompositeSchemaBuilder.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/Completion/CompositeSchemaBuilder.cs index efd6663c341..cfa4ca27d11 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/Completion/CompositeSchemaBuilder.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/Completion/CompositeSchemaBuilder.cs @@ -22,10 +22,12 @@ private static CompositeSchemaContext CreateTypes(DocumentNode schema) IReadOnlyList directives = Array.Empty(); var types = ImmutableArray.CreateBuilder(); var typeDefinitions = ImmutableDictionary.CreateBuilder(); + var directiveTypes = ImmutableArray.CreateBuilder(); + var directiveDefinitions = ImmutableDictionary.CreateBuilder(); foreach (var definition in schema.Definitions) { - if (definition is INamedSyntaxNode namedSyntaxNode + if (definition is IHasName namedSyntaxNode && (FusionTypes.IsBuiltInType(namedSyntaxNode.Name.Value) || FusionTypes.IsBuiltInDirective(namedSyntaxNode.Name.Value))) { @@ -44,6 +46,11 @@ private static CompositeSchemaContext CreateTypes(DocumentNode schema) typeDefinitions.Add(scalarType.Name.Value, scalarType); break; + case DirectiveDefinitionNode directiveType: + directiveTypes.Add(CreateDirectiveType(directiveType)); + directiveDefinitions.Add(directiveType.Name.Value, directiveType); + break; + case SchemaDefinitionNode schemaDefinition: directives = schemaDefinition.Directives; @@ -75,7 +82,9 @@ private static CompositeSchemaContext CreateTypes(DocumentNode schema) subscriptionType, directives, types.ToImmutable(), - typeDefinitions.ToImmutable()); + typeDefinitions.ToImmutable(), + directiveTypes.ToImmutable(), + directiveDefinitions.ToImmutable()); } private static CompositeObjectType CreateObjectType( @@ -141,6 +150,43 @@ private static CompositeScalarType CreateScalarType(ScalarTypeDefinitionNode def definition.Description?.Value); } + private static CompositeDirectiveType CreateDirectiveType( + DirectiveDefinitionNode definition) + { + return new CompositeDirectiveType( + definition.Name.Value, + definition.Description?.Value, + definition.IsRepeatable, + CreateInputFields(definition.Arguments), + DirectiveLocationUtils.Parse(definition.Locations)); + } + + private static CompositeInputFieldCollection CreateInputFields( + IReadOnlyList fields) + { + if (fields.Count == 0) + { + return CompositeInputFieldCollection.Empty; + } + + var sourceFields = new CompositeInputField[fields.Count]; + + for (var i = 0; i < fields.Count; i++) + { + var field = fields[i]; + var isDeprecated = DeprecatedDirectiveParser.TryParse(field.Directives, out var deprecated); + + sourceFields[i] = new CompositeInputField( + field.Name.Value, + field.Description?.Value, + field.DefaultValue, + isDeprecated, + deprecated?.Reason); + } + + return new CompositeInputFieldCollection(sourceFields); + } + private static CompositeSchema CompleteTypes(CompositeSchemaContext schemaContext) { foreach (var type in schemaContext.Types) @@ -163,6 +209,14 @@ private static CompositeSchema CompleteTypes(CompositeSchemaContext schemaContex } } + foreach (var directiveType in schemaContext.DirectiveTypes) + { + CompleteDirectiveType( + directiveType, + schemaContext.GetDirectiveDefinition(directiveType.Name), + schemaContext); + } + var directives = CompletionTools.CreateDirectiveCollection(schemaContext.Directives, schemaContext); return new CompositeSchema( @@ -176,7 +230,7 @@ schemaContext.SubscriptionType is not null : null, schemaContext.Types.ToFrozenDictionary(t => t.Name), directives, - schemaContext.DirectiveDefinitions.ToFrozenDictionary(t => t.Name)); + schemaContext.DirectiveTypes.ToFrozenDictionary(t => t.Name)); } private static void CompleteObjectType( @@ -186,7 +240,7 @@ private static void CompleteObjectType( { foreach (var fieldDef in typeDef.Fields) { - CompleteObjectField(type, type.Fields[fieldDef.Name.Value], fieldDef, schemaContext); + CompleteOutputField(type, type.Fields[fieldDef.Name.Value], fieldDef, schemaContext); } var directives = CompletionTools.CreateDirectiveCollection(typeDef.Directives, schemaContext); @@ -195,27 +249,27 @@ private static void CompleteObjectType( type.Complete(new CompositeObjectTypeCompletionContext(directives, interfaces, sources)); } - private static void CompleteObjectField( + private static void CompleteOutputField( CompositeObjectType declaringType, CompositeOutputField field, FieldDefinitionNode fieldDef, - CompositeSchemaContext compositeSchemaContext) + CompositeSchemaContext schemaContext) { foreach (var argumentDef in fieldDef.Arguments) { - CompleteOutputFieldArguments(field.Arguments[argumentDef.Name.Value], argumentDef, compositeSchemaContext); + CompleteInputField(field.Arguments[argumentDef.Name.Value], argumentDef, schemaContext); } - var directives = CompletionTools.CreateDirectiveCollection(fieldDef.Directives, compositeSchemaContext); - var type = compositeSchemaContext.GetType(fieldDef.Type); - var sources = BuildSourceObjectFieldCollection(field, fieldDef, compositeSchemaContext); + var directives = CompletionTools.CreateDirectiveCollection(fieldDef.Directives, schemaContext); + var type = schemaContext.GetType(fieldDef.Type); + var sources = BuildSourceObjectFieldCollection(field, fieldDef, schemaContext); field.Complete(new CompositeObjectFieldCompletionContext(declaringType, directives, type, sources)); } private static SourceObjectFieldCollection BuildSourceObjectFieldCollection( CompositeOutputField field, FieldDefinitionNode fieldDef, - CompositeSchemaContext compositeSchemaContext) + CompositeSchemaContext schemaContext) { var fieldDirectives = FieldDirectiveParser.Parse(fieldDef.Directives); var requireDirectives = RequiredDirectiveParser.Parse(fieldDef.Directives); @@ -228,7 +282,7 @@ private static SourceObjectFieldCollection BuildSourceObjectFieldCollection( fieldDirective.SourceName ?? field.Name, fieldDirective.SchemaName, ParseRequirements(requireDirectives, fieldDirective.SchemaName), - CompleteType(fieldDef.Type, fieldDirective.SourceType, compositeSchemaContext))); + CompleteType(fieldDef.Type, fieldDirective.SourceType, schemaContext))); } return new SourceObjectFieldCollection(temp.ToImmutable()); @@ -266,22 +320,19 @@ static ICompositeType CompleteType( ITypeNode? sourceType, CompositeSchemaContext schemaContext) { - if (sourceType is null) - { - return schemaContext.GetType(type); - } - - return schemaContext.GetType(sourceType, type.NamedType().Name.Value); + return sourceType is null + ? schemaContext.GetType(type) + : schemaContext.GetType(sourceType, type.NamedType().Name.Value); } } - private static void CompleteOutputFieldArguments( + private static void CompleteInputField( CompositeInputField argument, InputValueDefinitionNode argumentDef, - CompositeSchemaContext completionContext) + CompositeSchemaContext schemaContext) { - var directives = CompletionTools.CreateDirectiveCollection(argumentDef.Directives, completionContext); - var type = completionContext.GetType(argumentDef.Type); + var directives = CompletionTools.CreateDirectiveCollection(argumentDef.Directives, schemaContext); + var type = schemaContext.GetType(argumentDef.Type); argument.Complete(new CompositeInputFieldCompletionContext(directives, type)); } @@ -293,4 +344,15 @@ private static void CompleteScalarType( var directives = CompletionTools.CreateDirectiveCollection(typeDef.Directives, schemaContext); type.Complete(new CompositeScalarTypeCompletionContext(directives)); } + + private static void CompleteDirectiveType( + CompositeDirectiveType type, + DirectiveDefinitionNode typeDef, + CompositeSchemaContext schemaContext) + { + foreach (var argumentDef in typeDef.Arguments) + { + CompleteInputField(type.Arguments[argumentDef.Name.Value], argumentDef, schemaContext); + } + } } diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/Completion/CompositeSchemaContext.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/Completion/CompositeSchemaContext.cs index cf5e3e4d644..e8956426e35 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/Completion/CompositeSchemaContext.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/Completion/CompositeSchemaContext.cs @@ -1,37 +1,59 @@ using System.Collections.Immutable; using HotChocolate.Fusion.Types.Collections; using HotChocolate.Language; +using DirectiveLocation = HotChocolate.Types.DirectiveLocation; namespace HotChocolate.Fusion.Types.Completion; -public sealed class CompositeSchemaContext( - string queryType, - string? mutationType, - string? subscriptionType, - IReadOnlyList directives, - ImmutableArray types, - ImmutableDictionary typeDefinitions) +public sealed class CompositeSchemaContext { private readonly Dictionary _compositeTypes = new(SyntaxComparer.BySyntax); - private readonly Dictionary _typeNameLookup = types.ToDictionary(t => t.Name); + private readonly Dictionary _typeNameLookup; + private ImmutableDictionary _typeDefinitions; + private readonly Dictionary _directiveTypeNameLookup; + private ImmutableDictionary _directiveDefinitions; + + public CompositeSchemaContext( + string queryType, + string? mutationType, + string? subscriptionType, + IReadOnlyList directives, + ImmutableArray types, + ImmutableDictionary typeDefinitions, + ImmutableArray directiveTypes, + ImmutableDictionary directiveDefinitions) + { + _typeNameLookup = types.ToDictionary(t => t.Name); + _directiveTypeNameLookup = directiveTypes.ToDictionary(t => t.Name); + _typeDefinitions = typeDefinitions; + _directiveDefinitions = directiveDefinitions; + + QueryType = queryType; + MutationType = mutationType; + SubscriptionType = subscriptionType; + Types = types; + Directives = directives; + DirectiveTypes = directiveTypes; + + AddSpecDirectives(); + } - public string QueryType { get; } = queryType; + public string QueryType { get; } - public string? MutationType { get; } = mutationType; + public string? MutationType { get; } - public string? SubscriptionType { get; } = subscriptionType; + public string? SubscriptionType { get; } - public ImmutableArray Types { get; private set; } = types; + public ImmutableArray Types { get; private set; } - public IReadOnlyList Directives { get; } = directives; + public IReadOnlyList Directives { get; } - public ImmutableArray DirectiveDefinitions { get; } = - ImmutableArray.Empty; + public ImmutableArray DirectiveTypes { get; private set; } public T GetTypeDefinition(string typeName) where T : ITypeDefinitionNode { - if (typeDefinitions.TryGetValue(typeName, out var typeDefinition)) + if (_typeDefinitions.TryGetValue(typeName, out var typeDefinition)) { return (T)typeDefinition; } @@ -39,6 +61,16 @@ public T GetTypeDefinition(string typeName) throw new InvalidOperationException(); } + public DirectiveDefinitionNode GetDirectiveDefinition(string typeName) + { + if (_directiveDefinitions.TryGetValue(typeName, out var directiveDefinition)) + { + return directiveDefinition; + } + + throw new InvalidOperationException(); + } + public T GetType(string typeName) where T : ICompositeNamedType { @@ -80,13 +112,13 @@ private ICompositeType CreateType(ITypeNode typeNode, string typeName) return CreateType(typeNode, type); } - private ICompositeNamedType CreateSpecScalar(string name) + private CompositeScalarType CreateSpecScalar(string name) { var type = new CompositeScalarType(name, null); var typeDef = new ScalarTypeDefinitionNode(null, new NameNode(name), null, Array.Empty()); type.Complete(new CompositeScalarTypeCompletionContext(DirectiveCollection.Empty)); - typeDefinitions = typeDefinitions.SetItem(name, typeDef); + _typeDefinitions = _typeDefinitions.SetItem(name, typeDef); Types = Types.Add(type); return type; @@ -107,9 +139,107 @@ private static ICompositeType CreateType(ITypeNode typeNode, ICompositeNamedType return compositeNamedType; } - public CompositeDirectiveDefinition GetDirectiveDefinition(string name) + public CompositeDirectiveType GetDirectiveType(string name) + { + if (_directiveTypeNameLookup.TryGetValue(name, out var type)) + { + return type; + } + + throw new InvalidOperationException(); + } + + private void AddSpecDirectives() + { + var directive = CreateSkipDirective(); + _directiveTypeNameLookup.Add(directive.Name, directive); + DirectiveTypes = DirectiveTypes.Add(directive); + + directive = CreateIncludeDirective(); + _directiveTypeNameLookup.Add(directive.Name, directive); + DirectiveTypes = DirectiveTypes.Add(directive); + } + + private CompositeDirectiveType CreateSkipDirective() + { + var ifField = new CompositeInputField( + "if", + "Skips this field or fragment when the condition is true.", + defaultValue: null, + isDeprecated: false, + deprecationReason: null); + + var skipDirective = new CompositeDirectiveType( + "skip", + "Directs the executor to skip this field or fragment when the `if` argument is true.", + isRepeatable: false, + new CompositeInputFieldCollection([ifField]), + DirectiveLocation.Field | DirectiveLocation.FragmentSpread | DirectiveLocation.InlineFragment); + + var skipDirectiveDef = new DirectiveDefinitionNode( + null, + new NameNode("skip"), + new StringValueNode("Directs the executor to skip this field or fragment when the `if` argument is true."), + isRepeatable: false, + [ + new InputValueDefinitionNode( + null, + new NameNode("if"), + new StringValueNode("Skips this field or fragment when the condition is true."), + new NonNullTypeNode(new NamedTypeNode(new NameNode("Boolean"))), + null, + Array.Empty()) + ], + [ + new NameNode(Language.DirectiveLocation.Field.Value), + new NameNode(Language.DirectiveLocation.FragmentSpread.Value), + new NameNode(Language.DirectiveLocation.InlineFragment.Value) + ]); + + _directiveDefinitions = _directiveDefinitions.SetItem("skip", skipDirectiveDef); + + return skipDirective; + } + + private CompositeDirectiveType CreateIncludeDirective() { - throw new NotImplementedException(); + var ifField = new CompositeInputField( + "if", + "Includes this field or fragment when the condition is true.", + defaultValue: null, + isDeprecated: false, + deprecationReason: null); + + var includeDirective = new CompositeDirectiveType( + "include", + "Directs the executor to include this field or fragment when the `if` argument is true.", + isRepeatable: false, + new CompositeInputFieldCollection([ifField]), + DirectiveLocation.Field | DirectiveLocation.FragmentSpread | DirectiveLocation.InlineFragment); + + var includeDirectiveDef = new DirectiveDefinitionNode( + null, + new NameNode("include"), + new StringValueNode("Directs the executor to include this field or fragment when the `if` argument is true."), + isRepeatable: false, + [ + new InputValueDefinitionNode( + null, + new NameNode("if"), + new StringValueNode("Includes this field or fragment when the condition is true."), + new NonNullTypeNode(new NamedTypeNode(new NameNode("Boolean"))), + null, + Array.Empty()) + ], + [ + new NameNode(Language.DirectiveLocation.Field.Value), + new NameNode(Language.DirectiveLocation.FragmentSpread.Value), + new NameNode(Language.DirectiveLocation.InlineFragment.Value) + ]); + + _directiveDefinitions = _directiveDefinitions.Add("include", includeDirectiveDef); + + return includeDirective; } private static bool IsSpecScalarType(string name) diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/CompositeDirective.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/CompositeDirective.cs index 3b6f4130994..e8d2a4176ee 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/CompositeDirective.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/CompositeDirective.cs @@ -4,12 +4,12 @@ namespace HotChocolate.Fusion.Types; public sealed class CompositeDirective( - CompositeDirectiveDefinition type, + CompositeDirectiveType type, IReadOnlyList arguments) { public string Name => Type.Name; - public CompositeDirectiveDefinition Type { get; } = type; + public CompositeDirectiveType Type { get; } = type; public ArgumentAssignmentCollection Arguments { get; } = new(arguments); diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/CompositeDirectiveDefinition.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/CompositeDirectiveType.cs similarity index 84% rename from src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/CompositeDirectiveDefinition.cs rename to src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/CompositeDirectiveType.cs index 454016c6670..0fda9a675e5 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/CompositeDirectiveDefinition.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/CompositeDirectiveType.cs @@ -6,7 +6,7 @@ namespace HotChocolate.Fusion.Types; /// /// Represents a GraphQL directive definition. /// -public sealed class CompositeDirectiveDefinition( +public sealed class CompositeDirectiveType( string name, string? description, bool isRepeatable, @@ -46,4 +46,12 @@ public sealed class CompositeDirectiveDefinition( /// The locations where this directive can be applied. /// public DirectiveLocation Locations { get; } = locations; + + /// + /// Returns the name of the directive. + /// + /// + /// The name of the directive. + /// + public override string ToString() => Name; } diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/CompositeSchema.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/CompositeSchema.cs index 2b6558cfac4..1db83ad0686 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/CompositeSchema.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/CompositeSchema.cs @@ -10,7 +10,7 @@ namespace HotChocolate.Fusion.Types; public sealed class CompositeSchema { private readonly FrozenDictionary _types; - private readonly FrozenDictionary _directiveDefinitions; + private readonly FrozenDictionary _directiveTypes; public CompositeSchema( string? description, @@ -19,7 +19,7 @@ public CompositeSchema( CompositeObjectType? subscriptionType, FrozenDictionary types, DirectiveCollection directives, - FrozenDictionary directiveDefinitions) + FrozenDictionary directiveTypes) { Description = description; QueryType = queryType; @@ -27,7 +27,10 @@ public CompositeSchema( SubscriptionType = subscriptionType; _types = types; Directives = directives; - _directiveDefinitions = directiveDefinitions; + _directiveTypes = directiveTypes; + + SkipDirective = _directiveTypes["skip"]; + IncludeDirective = _directiveTypes["include"]; } public string? Description { get; } @@ -49,18 +52,31 @@ public CompositeSchema( /// public CompositeObjectType? SubscriptionType { get; } + /// + /// Gets the skip directive. + /// + public CompositeDirectiveType SkipDirective { get; } + + /// + /// Gets the include directive. + /// + public CompositeDirectiveType IncludeDirective { get; } + /// /// Gets all the schema types. /// public ImmutableArray Types => _types.Values; + /// + /// Gets all the directive types that are annotated to the schema. + /// public DirectiveCollection Directives { get; } /// /// Gets all the directive types that are supported by this schema. /// - public ImmutableArray DirectiveDefinitions - => _directiveDefinitions.Values; + public ImmutableArray DirectiveTypes + => _directiveTypes.Values; /// /// Gets a type by its name and kind. @@ -204,9 +220,9 @@ public ImmutableArray GetPossibleTypes(ICompositeNamedType /// /// The specified directive type does not exist. /// - public CompositeDirectiveDefinition GetDirectiveType(string directiveName) + public CompositeDirectiveType GetDirectiveType(string directiveName) { - if (_directiveDefinitions.TryGetValue(directiveName, out var directiveType)) + if (_directiveTypes.TryGetValue(directiveName, out var directiveType)) { return directiveType; } @@ -232,6 +248,6 @@ public CompositeDirectiveDefinition GetDirectiveType(string directiveName) /// public bool TryGetDirectiveType( string directiveName, - [NotNullWhen(true)] out CompositeDirectiveDefinition? directiveType) - => _directiveDefinitions.TryGetValue(directiveName, out directiveType); + [NotNullWhen(true)] out CompositeDirectiveType? directiveType) + => _directiveTypes.TryGetValue(directiveName, out directiveType); } diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/FieldPath.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/FieldPath.cs index 226b1bb795a..819d808a17a 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/FieldPath.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/FieldPath.cs @@ -1,3 +1,4 @@ +using System.Collections; using System.Text; namespace HotChocolate.Fusion.Types; @@ -5,7 +6,7 @@ namespace HotChocolate.Fusion.Types; /// /// Represents GraphQL selection path which is used in the operation compiler. /// -public sealed class FieldPath : IEquatable +public sealed class FieldPath : IEnumerable, IEquatable { private FieldPath(string name, FieldPath? parent = null) { @@ -90,6 +91,31 @@ public bool Equals(FieldPath? other) public override bool Equals(object? obj) => Equals(obj as FieldPath); + /// + /// Returns an enumerator that iterates through the path segments. + /// + /// + /// An enumerator that can be used to iterate through the path segments. + /// + public IEnumerator GetEnumerator() + { + var current = this; + + do + { + if (ReferenceEquals(current, Root)) + { + yield break; + } + + yield return current; + current = current.Parent; + } while (current != null); + } + + IEnumerator IEnumerable.GetEnumerator() + => GetEnumerator(); + /// /// Returns the hash code for this path. /// @@ -111,12 +137,21 @@ public override string ToString() do { + if(ReferenceEquals(current, Root)) + { + break; + } + if (first) { - path.Insert(0, current.Name); - path.Insert(0, '.'); first = false; } + else + { + path.Insert(0, "."); + } + + path.Insert(0, current.Name); current = current.Parent; } while (current != null); diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/Lookup.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/Lookup.cs index c9a6559cc58..7dc72284ecc 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/Lookup.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/Lookup.cs @@ -7,12 +7,10 @@ public sealed class Lookup public Lookup( string schemaName, string name, - LookupKind kind, ImmutableArray arguments, ImmutableArray fields) { SchemaName = schemaName; - Kind = kind; Arguments = arguments; Fields = fields; Name = name; @@ -28,8 +26,6 @@ public Lookup( /// public string Name { get; } - public LookupKind Kind { get; } - /// /// Gets the arguments that represent field requirements. /// diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/LookupKind.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/LookupKind.cs deleted file mode 100644 index bce4b78bafd..00000000000 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Types/LookupKind.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace HotChocolate.Fusion.Types; - -public enum LookupKind -{ - Default = 0, - Batch = 1 -} diff --git a/src/HotChocolate/Fusion-vnext/test/Directory.Build.props b/src/HotChocolate/Fusion-vnext/test/Directory.Build.props index 7b6055e69a9..e57c4741f27 100644 --- a/src/HotChocolate/Fusion-vnext/test/Directory.Build.props +++ b/src/HotChocolate/Fusion-vnext/test/Directory.Build.props @@ -5,6 +5,9 @@ false false true + true + cobertura + $(OutputPath)coverage.cobertura.xml @@ -18,6 +21,7 @@ + diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/ConditionTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/ConditionTests.cs index 73af309604c..70579d76eb0 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/ConditionTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/ConditionTests.cs @@ -1,9 +1,11 @@ +using HotChocolate.Fusion.Planning; + namespace HotChocolate.Fusion; public class ConditionTests : FusionTestBase { [Test] - public async Task Skip_On_SubField() + public void Skip_On_SubField() { // arrange var compositeSchema = CreateCompositeSchema(); @@ -21,25 +23,24 @@ name @skip(if: $skip) """); // assert - await Assert - .That(plan.Serialize()) - .IsEqualTo( - """ - { - "kind": "Root", - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "query($id: ID!, $skip: Boolean!) { productById(id: $id) { name @skip(if: $skip) description } }" - } - ] - } - """); + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + query($id: ID!, $skip: Boolean!) { + productById(id: $id) { + name @skip(if: $skip) + description + } + } + + """); } [Test] - public async Task Skip_On_SubField_If_False() + public void Skip_On_SubField_If_False() { // arrange var compositeSchema = CreateCompositeSchema(); @@ -57,25 +58,24 @@ name @skip(if: false) """); // assert - await Assert - .That(plan.Serialize()) - .IsEqualTo( - """ - { - "kind": "Root", - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "query($id: ID!) { productById(id: $id) { name description } }" - } - ] - } - """); + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + query($id: ID!) { + productById(id: $id) { + name + description + } + } + + """); } [Test] - public async Task Skip_On_SubField_If_True() + public void Skip_On_SubField_If_True() { // arrange var compositeSchema = CreateCompositeSchema(); @@ -93,25 +93,23 @@ name @skip(if: true) """); // assert - await Assert - .That(plan.Serialize()) - .IsEqualTo( - """ - { - "kind": "Root", - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "query($id: ID!) { productById(id: $id) { description } }" - } - ] - } - """); + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + query($id: ID!) { + productById(id: $id) { + description + } + } + + """); } [Test] - public async Task Skip_On_SubField_Only_Skipped_Field_Selected() + public void Skip_On_SubField_Only_Skipped_Field_Selected() { // arrange var compositeSchema = CreateCompositeSchema(); @@ -128,25 +126,23 @@ name @skip(if: $skip) """); // assert - await Assert - .That(plan.Serialize()) - .IsEqualTo( - """ - { - "kind": "Root", - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "query($id: ID!, $skip: Boolean!) { productById(id: $id) { name @skip(if: $skip) } }" - } - ] - } - """); + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + query($id: ID!, $skip: Boolean!) { + productById(id: $id) { + name @skip(if: $skip) + } + } + + """); } [Test] - public async Task Skip_On_SubField_Only_Skipped_Field_Selected_If_False() + public void Skip_On_SubField_Only_Skipped_Field_Selected_If_False() { // arrange var compositeSchema = CreateCompositeSchema(); @@ -163,25 +159,23 @@ name @skip(if: false) """); // assert - await Assert - .That(plan.Serialize()) - .IsEqualTo( - """ - { - "kind": "Root", - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "query($id: ID!) { productById(id: $id) { name } }" - } - ] - } - """); + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + query($id: ID!) { + productById(id: $id) { + name + } + } + + """); } [Test] - public async Task Skip_On_SubField_Only_Skipped_Field_Selected_If_True() + public void Skip_On_SubField_Only_Skipped_Field_Selected_If_True() { // arrange var compositeSchema = CreateCompositeSchema(); @@ -198,25 +192,23 @@ name @skip(if: true) """); // assert - await Assert - .That(plan.Serialize()) - .IsEqualTo( - """ - { - "kind": "Root", - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "query($id: ID!) { productById(id: $id) { __typename } }" - } - ] - } - """); + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + query($id: ID!) { + productById(id: $id) { + __typename + } + } + + """); } [Test] - public async Task Skip_On_SubField_Resolved_From_Other_Source() + public void Skip_On_SubField_Resolved_From_Other_Source() { // arrange var compositeSchema = CreateCompositeSchema(); @@ -239,32 +231,43 @@ query GetProduct($id: ID!, $skip: Boolean!) { """); // assert - await Assert - .That(plan.Serialize()) - .IsEqualTo( - """ - { - "kind": "Root", - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "query($id: ID!) { productById(id: $id) { name } }", - "nodes": [ - { - "kind": "Operation", - "schema": "REVIEWS", - "document": "query($skip: Boolean!) { productById { averageRating reviews(first: 10) @skip(if: $skip) { nodes { body } } } }" + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + query($id: ID!) { + productById(id: $id) { + name + id + } + } + - id: 2 + schema: "REVIEWS" + operation: >- + query($__fusion_requirement_1: ID!, $skip: Boolean!) { + productById(id: $__fusion_requirement_1) { + averageRating + reviews(first: 10) @skip(if: $skip) { + nodes { + body } - ] + } } - ] - } - """); + } + requirements: + - name: "__fusion_requirement_1" + dependsOn: "1" + selectionSet: "productById" + field: "id" + type: "ID!" + + """); } [Test] - public async Task Skip_On_SubField_Resolved_From_Other_Source_If_False() + public void Skip_On_SubField_Resolved_From_Other_Source_If_False() { // arrange var compositeSchema = CreateCompositeSchema(); @@ -287,32 +290,43 @@ query GetProduct($id: ID!) { """); // assert - await Assert - .That(plan.Serialize()) - .IsEqualTo( - """ - { - "kind": "Root", - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "query($id: ID!) { productById(id: $id) { name } }", - "nodes": [ - { - "kind": "Operation", - "schema": "REVIEWS", - "document": "{ productById { averageRating reviews(first: 10) { nodes { body } } } }" + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + query($id: ID!) { + productById(id: $id) { + name + id + } + } + - id: 2 + schema: "REVIEWS" + operation: >- + query($__fusion_requirement_1: ID!) { + productById(id: $__fusion_requirement_1) { + averageRating + reviews(first: 10) { + nodes { + body } - ] + } } - ] - } - """); + } + requirements: + - name: "__fusion_requirement_1" + dependsOn: "1" + selectionSet: "productById" + field: "id" + type: "ID!" + + """); } [Test] - public async Task Skip_On_SubField_Resolved_From_Other_Source_If_True() + public void Skip_On_SubField_Resolved_From_Other_Source_If_True() { // arrange var compositeSchema = CreateCompositeSchema(); @@ -335,32 +349,38 @@ query GetProduct($id: ID!) { """); // assert - await Assert - .That(plan.Serialize()) - .IsEqualTo( - """ - { - "kind": "Root", - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "query($id: ID!) { productById(id: $id) { name } }", - "nodes": [ - { - "kind": "Operation", - "schema": "REVIEWS", - "document": "{ productById { averageRating } }" - } - ] + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + query($id: ID!) { + productById(id: $id) { + name + id } - ] - } - """); + } + - id: 2 + schema: "REVIEWS" + operation: >- + query($__fusion_requirement_1: ID!) { + productById(id: $__fusion_requirement_1) { + averageRating + } + } + requirements: + - name: "__fusion_requirement_1" + dependsOn: "1" + selectionSet: "productById" + field: "id" + type: "ID!" + + """); } [Test] - public async Task Skip_On_SubField_Resolved_From_Other_Source_Only_Skipped_Field_Selected() + public void Skip_On_SubField_Resolved_From_Other_Source_Only_Skipped_Field_Selected() { // arrange var compositeSchema = CreateCompositeSchema(); @@ -382,39 +402,43 @@ query GetProduct($id: ID!, $skip: Boolean!) { """); // assert - await Assert - .That(plan.Serialize()) - .IsEqualTo( - """ - { - "kind": "Root", - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "query($id: ID!) { productById(id: $id) { name } }", - "nodes": [ - { - "kind": "Condition", - "variableName": "skip", - "passingValue": false, - "nodes": [ - { - "kind": "Operation", - "schema": "REVIEWS", - "document": "{ productById { reviews(first: 10) { nodes { body } } } }" - } - ] + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + query($id: ID!) { + productById(id: $id) { + name + id + } + } + - id: 2 + schema: "REVIEWS" + operation: >- + query($__fusion_requirement_1: ID!) { + productById(id: $__fusion_requirement_1) { + reviews(first: 10) { + nodes { + body } - ] + } } - ] - } - """); + } + skipIf: "skip" + requirements: + - name: "__fusion_requirement_1" + dependsOn: "1" + selectionSet: "productById" + field: "id" + type: "ID!" + + """); } [Test] - public async Task Skip_On_SubField_Resolved_From_Other_Source_Only_Skipped_Field_Selected_If_False() + public void Skip_On_SubField_Resolved_From_Other_Source_Only_Skipped_Field_Selected_If_False() { // arrange var compositeSchema = CreateCompositeSchema(); @@ -436,32 +460,42 @@ query GetProduct($id: ID!) { """); // assert - await Assert - .That(plan.Serialize()) - .IsEqualTo( - """ - { - "kind": "Root", - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "query($id: ID!) { productById(id: $id) { name } }", - "nodes": [ - { - "kind": "Operation", - "schema": "REVIEWS", - "document": "{ productById { reviews(first: 10) { nodes { body } } } }" - } - ] + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + query($id: ID!) { + productById(id: $id) { + name + id + } + } + - id: 2 + schema: "REVIEWS" + operation: >- + query($__fusion_requirement_1: ID!) { + productById(id: $__fusion_requirement_1) { + reviews(first: 10) { + nodes { + body + } } - ] + } } - """); + requirements: + - name: "__fusion_requirement_1" + dependsOn: "1" + selectionSet: "productById" + field: "id" + type: "ID!" + + """); } [Test] - public async Task Skip_On_SubField_Resolved_From_Other_Source_Only_Skipped_Field_Selected_If_True() + public void Skip_On_SubField_Resolved_From_Other_Source_Only_Skipped_Field_Selected_If_True() { // arrange var compositeSchema = CreateCompositeSchema(); @@ -483,25 +517,23 @@ query GetProduct($id: ID!) { """); // assert - await Assert - .That(plan.Serialize()) - .IsEqualTo( - """ - { - "kind": "Root", - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "query($id: ID!) { productById(id: $id) { name } }" - } - ] - } - """); + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + query($id: ID!) { + productById(id: $id) { + name + } + } + + """); } [Test] - public async Task Skip_On_RootField() + public void Skip_On_RootField() { // arrange var compositeSchema = CreateCompositeSchema(); @@ -523,25 +555,28 @@ query GetProduct($id: ID!, $skip: Boolean!) { """); // assert - await Assert - .That(plan.Serialize()) - .IsEqualTo( - """ - { - "kind": "Root", - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "query($id: ID!, $skip: Boolean!) { productById(id: $id) @skip(if: $skip) { name } products { nodes { name } } }" - } - ] - } - """); + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + query($id: ID!, $skip: Boolean!) { + productById(id: $id) @skip(if: $skip) { + name + } + products { + nodes { + name + } + } + } + + """); } [Test] - public async Task Skip_On_RootField_If_False() + public void Skip_On_RootField_If_False() { // arrange var compositeSchema = CreateCompositeSchema(); @@ -563,25 +598,28 @@ query GetProduct($id: ID!) { """); // assert - await Assert - .That(plan.Serialize()) - .IsEqualTo( - """ - { - "kind": "Root", - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "query($id: ID!) { productById(id: $id) { name } products { nodes { name } } }" - } - ] - } - """); + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + query($id: ID!) { + productById(id: $id) { + name + } + products { + nodes { + name + } + } + } + + """); } [Test] - public async Task Skip_On_RootField_If_True() + public void Skip_On_RootField_If_True() { // arrange var compositeSchema = CreateCompositeSchema(); @@ -603,25 +641,25 @@ query GetProduct($id: ID!) { """); // assert - await Assert - .That(plan.Serialize()) - .IsEqualTo( - """ - { - "kind": "Root", - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "{ products { nodes { name } } }" - } - ] - } - """); + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + { + products { + nodes { + name + } + } + } + + """); } [Test] - public async Task Skip_On_RootField_Only_Skipped_Field_Selected() + public void Skip_On_RootField_Only_Skipped_Field_Selected() { // arrange var compositeSchema = CreateCompositeSchema(); @@ -638,32 +676,24 @@ query GetProduct($id: ID!, $skip: Boolean!) { """); // assert - await Assert - .That(plan.Serialize()) - .IsEqualTo( - """ - { - "kind": "Root", - "nodes": [ - { - "kind": "Condition", - "variableName": "skip", - "passingValue": false, - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "{ productById(id: $id) { name } }" - } - ] + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + query($id: ID!) { + productById(id: $id) { + name } - ] - } - """); + } + skipIf: "skip" + + """); } [Test] - public async Task Skip_On_RootField_Only_Skipped_Field_Selected_If_False() + public void Skip_On_RootField_Only_Skipped_Field_Selected_If_False() { // arrange var compositeSchema = CreateCompositeSchema(); @@ -680,25 +710,23 @@ query GetProduct($id: ID!) { """); // assert - await Assert - .That(plan.Serialize()) - .IsEqualTo( - """ - { - "kind": "Root", - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "query($id: ID!) { productById(id: $id) { name } }" - } - ] - } - """); + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + query($id: ID!) { + productById(id: $id) { + name + } + } + + """); } [Test] - public async Task Skip_On_RootField_Only_Skipped_Field_Selected_If_True() + public void Skip_On_RootField_Only_Skipped_Field_Selected_If_True() { // arrange var compositeSchema = CreateCompositeSchema(); @@ -715,18 +743,15 @@ query GetProduct($id: ID!) { """); // assert - await Assert - .That(plan.Serialize()) - .IsEqualTo( - """ - { - "kind": "Root" - } - """); + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + + """); } [Test] - public async Task Skip_And_Include_On_RootField_Only_Skipped_Field_Selected() + public void Skip_And_Include_On_RootField_Only_Skipped_Field_Selected() { // arrange var compositeSchema = CreateCompositeSchema(); @@ -743,39 +768,24 @@ query GetProduct($id: ID!, $skip: Boolean!, $include: Boolean!) { """); // assert - await Assert - .That(plan.Serialize()) - .IsEqualTo( - """ - { - "kind": "Root", - "nodes": [ - { - "kind": "Condition", - "variableName": "skip", - "passingValue": false, - "nodes": [ - { - "kind": "Condition", - "variableName": "include", - "passingValue": true, - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "{ productById(id: $id) { name } }" - } - ] - } - ] + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + query($id: ID!) { + productById(id: $id) { + name } - ] - } - """); + } + skipIf: "skip" + + """); } [Test] - public async Task Skip_And_Include_On_RootField() + public void Skip_And_Include_On_RootField() { // arrange var compositeSchema = CreateCompositeSchema(); @@ -797,20 +807,23 @@ query GetProduct($id: ID!, $skip: Boolean!, $include: Boolean!) { """); // assert - await Assert - .That(plan.Serialize()) - .IsEqualTo( - """ - { - "kind": "Root", - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "query($id: ID!, $include: Boolean!, $skip: Boolean!) { productById(id: $id) @skip(if: $skip) @include(if: $include) { name } products { nodes { name } } }" - } - ] - } - """); + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + query($id: ID!, $include: Boolean!, $skip: Boolean!) { + productById(id: $id) @skip(if: $skip) @include(if: $include) { + name + } + products { + nodes { + name + } + } + } + + """); } } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/OperationPlannerTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/OperationPlannerTests.cs index aa0cd4e05ba..b4c1e9fc0aa 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/OperationPlannerTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/OperationPlannerTests.cs @@ -1,3 +1,7 @@ +using HotChocolate.Fusion.Planning; +using HotChocolate.Fusion.Types.Completion; +using HotChocolate.Language; + namespace HotChocolate.Fusion; public class OperationPlannerTests : FusionTestBase @@ -25,7 +29,20 @@ fragment Product on Product { """); // assert - plan.Serialize().MatchSnapshot(); + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + { + productById(id: 1) { + id + name + } + } + + """); } [Test] @@ -52,7 +69,35 @@ fragment Product on Product { """); // assert - plan.Serialize().MatchSnapshot(); + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + { + productById(id: 1) { + id + name + id + } + } + - id: 2 + schema: "SHIPPING" + operation: >- + query($__fusion_requirement_1: ID!) { + productById(id: $__fusion_requirement_1) { + estimatedDelivery(postCode: "12345") + } + } + requirements: + - name: "__fusion_requirement_1" + dependsOn: "1" + selectionSet: "productById" + field: "id" + type: "ID!" + + """); } [Test] @@ -94,7 +139,56 @@ fragment AuthorCard on UserProfile { """); // assert - plan.Serialize().MatchSnapshot(); + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + { + productById(id: 1) { + name + id + } + } + - id: 2 + schema: "REVIEWS" + operation: >- + query($__fusion_requirement_2: ID!) { + productById(id: $__fusion_requirement_2) { + reviews(first: 10) { + nodes { + body + stars + author { + id + } + } + } + } + } + requirements: + - name: "__fusion_requirement_2" + dependsOn: "1" + selectionSet: "productById" + field: "id" + type: "ID!" + - id: 3 + schema: "ACCOUNTS" + operation: >- + query($__fusion_requirement_1: ID!) { + userById(id: $__fusion_requirement_1) { + displayName + } + } + requirements: + - name: "__fusion_requirement_1" + dependsOn: "2" + selectionSet: "productById.reviews.nodes.author" + field: "id" + type: "ID!" + + """); } [Test] @@ -136,6 +230,102 @@ fragment AuthorCard on UserProfile { """); // assert - plan.Serialize().MatchSnapshot(); + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + query($id: ID!) { + productById(id: $id) { + name + id + } + } + - id: 2 + schema: "REVIEWS" + operation: >- + query($__fusion_requirement_2: ID!, $first: Int! = 10) { + productById(id: $__fusion_requirement_2) { + reviews(first: $first) { + nodes { + body + stars + author { + id + } + } + } + } + } + requirements: + - name: "__fusion_requirement_2" + dependsOn: "1" + selectionSet: "productById" + field: "id" + type: "ID!" + - id: 3 + schema: "ACCOUNTS" + operation: >- + query($__fusion_requirement_1: ID!) { + userById(id: $__fusion_requirement_1) { + displayName + } + } + requirements: + - name: "__fusion_requirement_1" + dependsOn: "2" + selectionSet: "productById.reviews.nodes.author" + field: "id" + type: "ID!" + + """); + } + + [Test] + public void Plan_With_Conditional_InlineFragment() + { + var compositeSchemaDoc = Utf8GraphQLParser.Parse(FileResource.Open("fusion1.graphql")); + var compositeSchema = CompositeSchemaBuilder.Create(compositeSchemaDoc); + + var doc = Utf8GraphQLParser.Parse( + """ + { + productById(id: 1) { + ... Product + } + } + + fragment Product on Product { + id + name + ... @include(if: true) { + estimatedDelivery(postCode: "12345") + } + } + """); + + var rewriter = new InlineFragmentOperationRewriter(compositeSchema); + var rewritten = rewriter.RewriteDocument(doc, null); + + // act + var planner = new OperationPlanner(compositeSchema); + var plan = planner.CreatePlan(rewritten, null); + + // assert + plan.ToYaml().MatchInlineSnapshot( + """ + nodes: + - id: 1 + schema: "PRODUCTS" + operation: >- + { + productById(id: 1) { + id + name + } + } + + """); } } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/__snapshots__/OperationPlannerTests.Plan_Simple_Operation_1_Source_Schema.snap b/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/__snapshots__/OperationPlannerTests.Plan_Simple_Operation_1_Source_Schema.snap deleted file mode 100644 index 806bc9d0564..00000000000 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/__snapshots__/OperationPlannerTests.Plan_Simple_Operation_1_Source_Schema.snap +++ /dev/null @@ -1,10 +0,0 @@ -{ - "kind": "Root", - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "{ productById(id: 1) { id name } }" - } - ] -} diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/__snapshots__/OperationPlannerTests.Plan_Simple_Operation_2_Source_Schema.snap b/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/__snapshots__/OperationPlannerTests.Plan_Simple_Operation_2_Source_Schema.snap deleted file mode 100644 index 471b78c09e2..00000000000 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/__snapshots__/OperationPlannerTests.Plan_Simple_Operation_2_Source_Schema.snap +++ /dev/null @@ -1,17 +0,0 @@ -{ - "kind": "Root", - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "{ productById(id: 1) { id name } }", - "nodes": [ - { - "kind": "Operation", - "schema": "SHIPPING", - "document": "{ productById { estimatedDelivery(postCode: \u002212345\u0022) } }" - } - ] - } - ] -} diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/__snapshots__/OperationPlannerTests.Plan_Simple_Operation_3_Source_Schema.snap b/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/__snapshots__/OperationPlannerTests.Plan_Simple_Operation_3_Source_Schema.snap deleted file mode 100644 index 4b3d47f7679..00000000000 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/__snapshots__/OperationPlannerTests.Plan_Simple_Operation_3_Source_Schema.snap +++ /dev/null @@ -1,24 +0,0 @@ -{ - "kind": "Root", - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "{ productById(id: 1) { name } }", - "nodes": [ - { - "kind": "Operation", - "schema": "REVIEWS", - "document": "{ productById { reviews(first: 10) { nodes { body stars author } } } }", - "nodes": [ - { - "kind": "Operation", - "schema": "ACCOUNTS", - "document": "{ userById { displayName } }" - } - ] - } - ] - } - ] -} diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/__snapshots__/OperationPlannerTests.Plan_Simple_Operation_3_Source_Schema_And_Single_Variable.snap b/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/__snapshots__/OperationPlannerTests.Plan_Simple_Operation_3_Source_Schema_And_Single_Variable.snap deleted file mode 100644 index 3beaa618e9a..00000000000 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/__snapshots__/OperationPlannerTests.Plan_Simple_Operation_3_Source_Schema_And_Single_Variable.snap +++ /dev/null @@ -1,24 +0,0 @@ -{ - "kind": "Root", - "nodes": [ - { - "kind": "Operation", - "schema": "PRODUCTS", - "document": "query($id: ID!) { productById(id: $id) { name } }", - "nodes": [ - { - "kind": "Operation", - "schema": "REVIEWS", - "document": "query($first: Int! = 10) { productById { reviews(first: $first) { nodes { body stars author } } } }", - "nodes": [ - { - "kind": "Operation", - "schema": "ACCOUNTS", - "document": "{ userById { displayName } }" - } - ] - } - ] - } - ] -} diff --git a/src/HotChocolate/Primitives/src/Primitives/DirectiveLocationUtils.cs b/src/HotChocolate/Primitives/src/Primitives/DirectiveLocationUtils.cs new file mode 100644 index 00000000000..44797f4817a --- /dev/null +++ b/src/HotChocolate/Primitives/src/Primitives/DirectiveLocationUtils.cs @@ -0,0 +1,207 @@ +using System.Globalization; +using HotChocolate.Language; +using HotChocolate.Properties; +using DirectiveLocation = HotChocolate.Types.DirectiveLocation; + +namespace HotChocolate; + +public static class DirectiveLocationUtils +{ + private static readonly Dictionary _syntaxToLocation = + new() + { + { Language.DirectiveLocation.Query, DirectiveLocation.Query }, + { Language.DirectiveLocation.Mutation, DirectiveLocation.Mutation }, + { Language.DirectiveLocation.Subscription, DirectiveLocation.Subscription }, + { Language.DirectiveLocation.Field, DirectiveLocation.Field }, + { Language.DirectiveLocation.FragmentDefinition, DirectiveLocation.FragmentDefinition }, + { Language.DirectiveLocation.FragmentSpread, DirectiveLocation.FragmentSpread }, + { Language.DirectiveLocation.InlineFragment, DirectiveLocation.InlineFragment }, + { Language.DirectiveLocation.Schema, DirectiveLocation.Schema }, + { Language.DirectiveLocation.Scalar, DirectiveLocation.Scalar }, + { Language.DirectiveLocation.Object, DirectiveLocation.Object }, + { Language.DirectiveLocation.FieldDefinition, DirectiveLocation.FieldDefinition }, + { Language.DirectiveLocation.ArgumentDefinition, DirectiveLocation.ArgumentDefinition }, + { Language.DirectiveLocation.Interface, DirectiveLocation.Interface }, + { Language.DirectiveLocation.Union, DirectiveLocation.Union }, + { Language.DirectiveLocation.Enum, DirectiveLocation.Enum }, + { Language.DirectiveLocation.EnumValue, DirectiveLocation.EnumValue }, + { Language.DirectiveLocation.InputObject, DirectiveLocation.InputObject }, + { Language.DirectiveLocation.InputFieldDefinition, DirectiveLocation.InputFieldDefinition }, + { Language.DirectiveLocation.VariableDefinition, DirectiveLocation.VariableDefinition } + }; + + private static readonly Dictionary _locationToSyntax = + new() + { + { DirectiveLocation.Query, Language.DirectiveLocation.Query }, + { DirectiveLocation.Mutation, Language.DirectiveLocation.Mutation }, + { DirectiveLocation.Subscription, Language.DirectiveLocation.Subscription }, + { DirectiveLocation.Field, Language.DirectiveLocation.Field }, + { DirectiveLocation.FragmentDefinition, Language.DirectiveLocation.FragmentDefinition }, + { DirectiveLocation.FragmentSpread, Language.DirectiveLocation.FragmentSpread }, + { DirectiveLocation.InlineFragment, Language.DirectiveLocation.InlineFragment }, + { DirectiveLocation.VariableDefinition, Language.DirectiveLocation.VariableDefinition }, + { DirectiveLocation.Schema, Language.DirectiveLocation.Schema }, + { DirectiveLocation.Scalar, Language.DirectiveLocation.Scalar }, + { DirectiveLocation.Object, Language.DirectiveLocation.Object }, + { DirectiveLocation.FieldDefinition, Language.DirectiveLocation.FieldDefinition }, + { DirectiveLocation.ArgumentDefinition, Language.DirectiveLocation.ArgumentDefinition }, + { DirectiveLocation.Interface, Language.DirectiveLocation.Interface }, + { DirectiveLocation.Union, Language.DirectiveLocation.Union }, + { DirectiveLocation.Enum, Language.DirectiveLocation.Enum }, + { DirectiveLocation.EnumValue, Language.DirectiveLocation.EnumValue }, + { DirectiveLocation.InputObject, Language.DirectiveLocation.InputObject }, + { DirectiveLocation.InputFieldDefinition, Language.DirectiveLocation.InputFieldDefinition }, + }; + + + public static DirectiveLocation Parse( + IReadOnlyList locations) + { + DirectiveLocation location = default; + + foreach (var locationName in locations) + { + if (Language.DirectiveLocation.TryParse( + locationName.Value, + out var parsedLocation)) + { + location |= Parse(parsedLocation); + } + } + + return location; + } + + private static DirectiveLocation Parse( + Language.DirectiveLocation location) + { + if (!_syntaxToLocation.TryGetValue(location, out var loc)) + { + throw new NotSupportedException(string.Format( + CultureInfo.InvariantCulture, + PrimitivesResources.DirectiveTypeFactory_LocationNotSupported, + location)); + } + + return loc; + } + + public static Language.DirectiveLocation Format( + this DirectiveLocation location) + { + if (!_locationToSyntax.TryGetValue(location, out var l)) + { + throw new NotSupportedException(string.Format( + CultureInfo.InvariantCulture, + PrimitivesResources.DirectiveTypeFactory_LocationNotSupported, + location)); + } + return l; + } + + public static IEnumerable AsEnumerable( + this DirectiveLocation locations) + { + if ((locations & DirectiveLocation.Query) == DirectiveLocation.Query) + { + yield return DirectiveLocation.Query; + } + + if ((locations & DirectiveLocation.Mutation) == DirectiveLocation.Mutation) + { + yield return DirectiveLocation.Mutation; + } + + if ((locations & DirectiveLocation.Subscription) == DirectiveLocation.Subscription) + { + yield return DirectiveLocation.Subscription; + } + + if ((locations & DirectiveLocation.Field) == DirectiveLocation.Field) + { + yield return DirectiveLocation.Field; + } + + if ((locations & DirectiveLocation.FragmentDefinition) == + DirectiveLocation.FragmentDefinition) + { + yield return DirectiveLocation.FragmentDefinition; + } + + if ((locations & DirectiveLocation.FragmentSpread) == DirectiveLocation.FragmentSpread) + { + yield return DirectiveLocation.FragmentSpread; + } + + if ((locations & DirectiveLocation.InlineFragment) == DirectiveLocation.InlineFragment) + { + yield return DirectiveLocation.InlineFragment; + } + + if ((locations & DirectiveLocation.VariableDefinition) == + DirectiveLocation.VariableDefinition) + { + yield return DirectiveLocation.VariableDefinition; + } + + if ((locations & DirectiveLocation.Schema) == DirectiveLocation.Schema) + { + yield return DirectiveLocation.Schema; + } + + if ((locations & DirectiveLocation.Scalar) == DirectiveLocation.Scalar) + { + yield return DirectiveLocation.Scalar; + } + + if ((locations & DirectiveLocation.Object) == DirectiveLocation.Object) + { + yield return DirectiveLocation.Object; + } + + if ((locations & DirectiveLocation.FieldDefinition) == + DirectiveLocation.FieldDefinition) + { + yield return DirectiveLocation.FieldDefinition; + } + + if ((locations & DirectiveLocation.ArgumentDefinition) == + DirectiveLocation.ArgumentDefinition) + { + yield return DirectiveLocation.ArgumentDefinition; + } + + if ((locations & DirectiveLocation.Interface) == DirectiveLocation.Interface) + { + yield return DirectiveLocation.Interface; + } + + if ((locations & DirectiveLocation.Union) == DirectiveLocation.Union) + { + yield return DirectiveLocation.Union; + } + + if ((locations & DirectiveLocation.Enum) == DirectiveLocation.Enum) + { + yield return DirectiveLocation.Enum; + } + + if ((locations & DirectiveLocation.EnumValue) == DirectiveLocation.EnumValue) + { + yield return DirectiveLocation.EnumValue; + } + + if ((locations & DirectiveLocation.InputObject) == DirectiveLocation.InputObject) + { + yield return DirectiveLocation.InputObject; + } + + if ((locations & DirectiveLocation.InputFieldDefinition) == + DirectiveLocation.InputFieldDefinition) + { + yield return DirectiveLocation.InputFieldDefinition; + } + } +} diff --git a/src/HotChocolate/Primitives/src/Primitives/Properties/PrimitivesResources.Designer.cs b/src/HotChocolate/Primitives/src/Primitives/Properties/PrimitivesResources.Designer.cs index 2a23b4c0adb..120af5321eb 100644 --- a/src/HotChocolate/Primitives/src/Primitives/Properties/PrimitivesResources.Designer.cs +++ b/src/HotChocolate/Primitives/src/Primitives/Properties/PrimitivesResources.Designer.cs @@ -62,5 +62,11 @@ internal static string ThrowHelper_SchemaCoordinate_MemberNameCannotBeSetOnADire return ResourceManager.GetString("ThrowHelper_SchemaCoordinate_MemberNameCannotBeSetOnADirectiveCoordinate", resourceCulture); } } + + internal static string DirectiveTypeFactory_LocationNotSupported { + get { + return ResourceManager.GetString("DirectiveTypeFactory_LocationNotSupported", resourceCulture); + } + } } } diff --git a/src/HotChocolate/Primitives/src/Primitives/Properties/PrimitivesResources.resx b/src/HotChocolate/Primitives/src/Primitives/Properties/PrimitivesResources.resx index 0463132731e..c71fb98c17c 100644 --- a/src/HotChocolate/Primitives/src/Primitives/Properties/PrimitivesResources.resx +++ b/src/HotChocolate/Primitives/src/Primitives/Properties/PrimitivesResources.resx @@ -27,4 +27,7 @@ A directive cannot contain a member name. + + The specified location `{0}` is not supported. +