File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed
src/HotChocolate/Mutable/src/Types.Mutable Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,16 @@ public static SpecifiedByMutableDirectiveDefinition Create(MutableSchemaDefiniti
105
105
}
106
106
}
107
107
108
+ public static class OneOf
109
+ {
110
+ public const string Name = "oneOf" ;
111
+
112
+ public static OneOfMutableDirectiveDefinition Create ( )
113
+ {
114
+ return new OneOfMutableDirectiveDefinition ( ) ;
115
+ }
116
+ }
117
+
108
118
public static bool IsBuiltInScalar ( string name )
109
119
=> name switch
110
120
{
@@ -123,6 +133,7 @@ public static bool IsBuiltInDirective(string name)
123
133
Skip . Name => true ,
124
134
Deprecated . Name => true ,
125
135
SpecifiedBy . Name => true ,
136
+ OneOf . Name => true ,
126
137
_ => false
127
138
} ;
128
139
}
Original file line number Diff line number Diff line change
1
+ namespace HotChocolate . Types . Mutable ;
2
+
3
+ public sealed class OneOfMutableDirectiveDefinition : MutableDirectiveDefinition
4
+ {
5
+ internal OneOfMutableDirectiveDefinition ( )
6
+ : base ( BuiltIns . OneOf . Name )
7
+ {
8
+ IsSpecDirective = true ;
9
+ Locations = DirectiveLocation . InputObject ;
10
+ }
11
+ }
Original file line number Diff line number Diff line change @@ -709,6 +709,10 @@ private static void BuildDirectiveCollection(
709
709
{
710
710
directiveType = BuiltIns . Deprecated . Create ( schema ) ;
711
711
}
712
+ else if ( directiveNode . Name . Value == BuiltIns . OneOf . Name )
713
+ {
714
+ directiveType = BuiltIns . OneOf . Create ( ) ;
715
+ }
712
716
else if ( directiveNode . Name . Value == BuiltIns . SpecifiedBy . Name )
713
717
{
714
718
directiveType = BuiltIns . SpecifiedBy . Create ( schema ) ;
You can’t perform that action at this time.
0 commit comments