Skip to content

Commit 6229b24

Browse files
committed
Added oneOf to built-in types, well-known directives, etc.
1 parent 9b17281 commit 6229b24

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

src/HotChocolate/Core/src/Types.Shared/BuiltInTypes.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ public static class BuiltInTypes
2828
WellKnownDirectives.Deprecated,
2929
WellKnownDirectives.Defer,
3030
WellKnownDirectives.Stream,
31-
WellKnownDirectives.SpecifiedBy
31+
WellKnownDirectives.SpecifiedBy,
32+
WellKnownDirectives.OneOf
3233
];
3334

3435
public static bool IsBuiltInType(string name)

src/HotChocolate/Core/src/Types.Shared/WellKnownDirectives.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ internal static class WellKnownDirectives
99
public const string Deprecated = "deprecated";
1010
public const string SpecifiedBy = "specifiedBy";
1111
public const string DeprecationReasonArgument = "reason";
12+
public const string OneOf = "oneOf";
1213
}

src/HotChocolate/Core/src/Types/Types/Directives/DirectiveTypeInterceptor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ internal override void OnBeforeRegisterSchemaTypes(
3434
{
3535
if (directiveType is { IsTypeSystemDirective: true, IsExecutableDirective: false } &&
3636
!directiveType.Name.EqualsOrdinal(DirectiveNames.Deprecated.Name) &&
37+
!directiveType.Name.EqualsOrdinal(DirectiveNames.OneOf.Name) &&
3738
!directiveType.Name.EqualsOrdinal(DirectiveNames.SpecifiedBy.Name) &&
3839
!_usedDirectives.Contains(directiveType))
3940
{

0 commit comments

Comments
 (0)