From fd1e64eeaa920cae1d68150a61bcbb4719544f15 Mon Sep 17 00:00:00 2001 From: Michael Staib Date: Tue, 19 Mar 2024 08:15:38 +0100 Subject: [PATCH] Edits --- .../Contracts/DependencyInjectionScope.cs | 17 ++++++++++++++ .../Types/Contracts/IComplexOutputType.cs | 2 ++ .../Types/Contracts/IDirectiveCollection.cs | 1 + .../src/Types/Types/Contracts/IEnumType.cs | 4 ++-- .../src/Types/Types/Contracts/IEnumType~1.cs | 4 ++-- .../Types/Contracts/IHasFieldCoordinate.cs | 2 ++ .../src/Types/Types/Contracts/IHasName.cs | 2 ++ .../src/Types/Types/Contracts/IHasOptional.cs | 8 +++++++ .../src/Types/Types/Contracts/IHasProperty.cs | 10 ++++++++ .../src/Types/Types/Contracts/IInputField.cs | 14 +---------- .../Types/Types/Contracts/ILiteralParser.cs | 8 ------- .../Types/Types/Contracts/INamedOutputType.cs | 6 ++--- .../src/Types/Types/Contracts/IObjectField.cs | 6 ----- .../Types/Types/Contracts/IOutputFieldInfo.cs | 2 ++ .../Types/Contracts/ITypeSystemObject.cs | 6 ++--- .../src/Types/Types/Contracts/MemberKind.cs | 23 ++++++++++++++++++- 16 files changed, 77 insertions(+), 38 deletions(-) create mode 100644 src/HotChocolate/Core/src/Types/Types/Contracts/DependencyInjectionScope.cs create mode 100644 src/HotChocolate/Core/src/Types/Types/Contracts/IHasOptional.cs create mode 100644 src/HotChocolate/Core/src/Types/Types/Contracts/IHasProperty.cs delete mode 100644 src/HotChocolate/Core/src/Types/Types/Contracts/ILiteralParser.cs diff --git a/src/HotChocolate/Core/src/Types/Types/Contracts/DependencyInjectionScope.cs b/src/HotChocolate/Core/src/Types/Types/Contracts/DependencyInjectionScope.cs new file mode 100644 index 00000000000..688cee46868 --- /dev/null +++ b/src/HotChocolate/Core/src/Types/Types/Contracts/DependencyInjectionScope.cs @@ -0,0 +1,17 @@ +namespace HotChocolate.Types; + +/// +/// Defines the resolver dependency injection scopes. +/// +public enum DependencyInjectionScope +{ + /// + /// Use standard request service scope. + /// + Request, + + /// + /// Use a separate service scope for the resolver. + /// + Resolver, +} \ No newline at end of file diff --git a/src/HotChocolate/Core/src/Types/Types/Contracts/IComplexOutputType.cs b/src/HotChocolate/Core/src/Types/Types/Contracts/IComplexOutputType.cs index 84ab71f8725..7c3ad6c1355 100644 --- a/src/HotChocolate/Core/src/Types/Types/Contracts/IComplexOutputType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Contracts/IComplexOutputType.cs @@ -1,3 +1,5 @@ +#nullable enable + using System.Collections.Generic; namespace HotChocolate.Types; diff --git a/src/HotChocolate/Core/src/Types/Types/Contracts/IDirectiveCollection.cs b/src/HotChocolate/Core/src/Types/Types/Contracts/IDirectiveCollection.cs index c2628ac2d2c..4d2b82e46e5 100644 --- a/src/HotChocolate/Core/src/Types/Types/Contracts/IDirectiveCollection.cs +++ b/src/HotChocolate/Core/src/Types/Types/Contracts/IDirectiveCollection.cs @@ -1,4 +1,5 @@ #nullable enable + using System.Collections.Generic; namespace HotChocolate.Types; diff --git a/src/HotChocolate/Core/src/Types/Types/Contracts/IEnumType.cs b/src/HotChocolate/Core/src/Types/Types/Contracts/IEnumType.cs index 642a7300abe..0dc36c7d6ce 100644 --- a/src/HotChocolate/Core/src/Types/Types/Contracts/IEnumType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Contracts/IEnumType.cs @@ -1,8 +1,8 @@ +#nullable enable + using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -#nullable enable - namespace HotChocolate.Types; /// diff --git a/src/HotChocolate/Core/src/Types/Types/Contracts/IEnumType~1.cs b/src/HotChocolate/Core/src/Types/Types/Contracts/IEnumType~1.cs index 5ea961f63eb..0e7c0f61142 100644 --- a/src/HotChocolate/Core/src/Types/Types/Contracts/IEnumType~1.cs +++ b/src/HotChocolate/Core/src/Types/Types/Contracts/IEnumType~1.cs @@ -1,7 +1,7 @@ -using System.Diagnostics.CodeAnalysis; - #nullable enable +using System.Diagnostics.CodeAnalysis; + namespace HotChocolate.Types; /// diff --git a/src/HotChocolate/Core/src/Types/Types/Contracts/IHasFieldCoordinate.cs b/src/HotChocolate/Core/src/Types/Types/Contracts/IHasFieldCoordinate.cs index f0ca48f12d9..1a8f38721ab 100644 --- a/src/HotChocolate/Core/src/Types/Types/Contracts/IHasFieldCoordinate.cs +++ b/src/HotChocolate/Core/src/Types/Types/Contracts/IHasFieldCoordinate.cs @@ -1,3 +1,5 @@ +#nullable enable + namespace HotChocolate.Types; /// diff --git a/src/HotChocolate/Core/src/Types/Types/Contracts/IHasName.cs b/src/HotChocolate/Core/src/Types/Types/Contracts/IHasName.cs index ca025d9cf46..991b3e80dda 100644 --- a/src/HotChocolate/Core/src/Types/Types/Contracts/IHasName.cs +++ b/src/HotChocolate/Core/src/Types/Types/Contracts/IHasName.cs @@ -1,3 +1,5 @@ +#nullable enable + namespace HotChocolate.Types; /// diff --git a/src/HotChocolate/Core/src/Types/Types/Contracts/IHasOptional.cs b/src/HotChocolate/Core/src/Types/Types/Contracts/IHasOptional.cs new file mode 100644 index 00000000000..4048c024b69 --- /dev/null +++ b/src/HotChocolate/Core/src/Types/Types/Contracts/IHasOptional.cs @@ -0,0 +1,8 @@ +#nullable enable + +namespace HotChocolate.Types; + +internal interface IHasOptional +{ + bool IsOptional { get; } +} \ No newline at end of file diff --git a/src/HotChocolate/Core/src/Types/Types/Contracts/IHasProperty.cs b/src/HotChocolate/Core/src/Types/Types/Contracts/IHasProperty.cs new file mode 100644 index 00000000000..b01029d7a68 --- /dev/null +++ b/src/HotChocolate/Core/src/Types/Types/Contracts/IHasProperty.cs @@ -0,0 +1,10 @@ +#nullable enable + +using System.Reflection; + +namespace HotChocolate.Types; + +internal interface IHasProperty +{ + PropertyInfo? Property { get; } +} \ No newline at end of file diff --git a/src/HotChocolate/Core/src/Types/Types/Contracts/IInputField.cs b/src/HotChocolate/Core/src/Types/Types/Contracts/IInputField.cs index b4325a6e903..850c14470df 100644 --- a/src/HotChocolate/Core/src/Types/Types/Contracts/IInputField.cs +++ b/src/HotChocolate/Core/src/Types/Types/Contracts/IInputField.cs @@ -1,7 +1,5 @@ #nullable enable -using System.Reflection; - namespace HotChocolate.Types; /// @@ -19,14 +17,4 @@ public interface IInputField : IField, IInputFieldInfo /// Gets the deprecation reason. /// string? DeprecationReason { get; } -} - -internal interface IHasProperty -{ - PropertyInfo? Property { get; } -} - -internal interface IHasOptional -{ - bool IsOptional { get; } -} +} \ No newline at end of file diff --git a/src/HotChocolate/Core/src/Types/Types/Contracts/ILiteralParser.cs b/src/HotChocolate/Core/src/Types/Types/Contracts/ILiteralParser.cs deleted file mode 100644 index 976f81a21e6..00000000000 --- a/src/HotChocolate/Core/src/Types/Types/Contracts/ILiteralParser.cs +++ /dev/null @@ -1,8 +0,0 @@ -using HotChocolate.Language; - -namespace HotChocolate.Types; - -public interface ILiteralParser -{ - object ParseLiteral(IValueNode literal); -} diff --git a/src/HotChocolate/Core/src/Types/Types/Contracts/INamedOutputType.cs b/src/HotChocolate/Core/src/Types/Types/Contracts/INamedOutputType.cs index 0b8f3cab9d7..2fe41b2a1c5 100644 --- a/src/HotChocolate/Core/src/Types/Types/Contracts/INamedOutputType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Contracts/INamedOutputType.cs @@ -1,3 +1,5 @@ +#nullable enable + namespace HotChocolate.Types; /// @@ -5,6 +7,4 @@ namespace HotChocolate.Types; /// public interface INamedOutputType : INamedType - , IOutputType -{ -} + , IOutputType; diff --git a/src/HotChocolate/Core/src/Types/Types/Contracts/IObjectField.cs b/src/HotChocolate/Core/src/Types/Types/Contracts/IObjectField.cs index b9e620ed94e..d318ee4aa2d 100644 --- a/src/HotChocolate/Core/src/Types/Types/Contracts/IObjectField.cs +++ b/src/HotChocolate/Core/src/Types/Types/Contracts/IObjectField.cs @@ -68,10 +68,4 @@ public interface IObjectField : IOutputField /// this property will return . /// MemberInfo? ResolverMember { get; } -} - -public enum DependencyInjectionScope -{ - Request, - Resolver, } \ No newline at end of file diff --git a/src/HotChocolate/Core/src/Types/Types/Contracts/IOutputFieldInfo.cs b/src/HotChocolate/Core/src/Types/Types/Contracts/IOutputFieldInfo.cs index 51fca198ce1..3867bc640a8 100644 --- a/src/HotChocolate/Core/src/Types/Types/Contracts/IOutputFieldInfo.cs +++ b/src/HotChocolate/Core/src/Types/Types/Contracts/IOutputFieldInfo.cs @@ -1,3 +1,5 @@ +#nullable enable + namespace HotChocolate.Types; /// diff --git a/src/HotChocolate/Core/src/Types/Types/Contracts/ITypeSystemObject.cs b/src/HotChocolate/Core/src/Types/Types/Contracts/ITypeSystemObject.cs index 0d5fee91f94..901eafef99c 100644 --- a/src/HotChocolate/Core/src/Types/Types/Contracts/ITypeSystemObject.cs +++ b/src/HotChocolate/Core/src/Types/Types/Contracts/ITypeSystemObject.cs @@ -1,3 +1,5 @@ +#nullable enable + namespace HotChocolate.Types; public interface ITypeSystemObject @@ -5,6 +7,4 @@ public interface ITypeSystemObject , IHasDescription , IHasReadOnlyContextData , IHasScope - , ITypeSystemMember -{ -} + , ITypeSystemMember; diff --git a/src/HotChocolate/Core/src/Types/Types/Contracts/MemberKind.cs b/src/HotChocolate/Core/src/Types/Types/Contracts/MemberKind.cs index 9861a61b0f2..08f5e29db41 100644 --- a/src/HotChocolate/Core/src/Types/Types/Contracts/MemberKind.cs +++ b/src/HotChocolate/Core/src/Types/Types/Contracts/MemberKind.cs @@ -1,11 +1,32 @@ namespace HotChocolate.Types; +/// +/// GraphQL Type System Member Kind +/// public enum MemberKind { - Field, + /// + /// GraphQL Interface Field. + /// InterfaceField, + + /// + /// GraphQL Object Field. + /// ObjectField, + + /// + /// GraphQL Input Object Field + /// InputObjectField, + + /// + /// GraphQL Output Field Argument + /// Argument, + + /// + /// GraphQL Directive Argument. + /// DirectiveArgument, }