Skip to content

Commit 0886871

Browse files
committed
Renamed __Type.oneOf to __Type.isOneOf
1 parent 527a3cf commit 0886871

File tree

10 files changed

+30
-30
lines changed

10 files changed

+30
-30
lines changed

src/HotChocolate/Core/src/Types/Types/Introspection/__Type.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ protected override ObjectTypeConfiguration CreateConfiguration(ITypeDiscoveryCon
8585

8686
if (context.DescriptorContext.Options.EnableOneOf)
8787
{
88-
def.Fields.Add(new(Names.OneOf,
88+
def.Fields.Add(new(Names.IsOneOf,
8989
type: booleanType,
90-
pureResolver: Resolvers.OneOf));
90+
pureResolver: Resolvers.IsOneOf));
9191
}
9292

9393
if (context.DescriptorContext.Options.EnableDirectiveIntrospection)
@@ -160,7 +160,7 @@ public static object Kind(IResolverContext context)
160160
_ => null
161161
};
162162

163-
public static object? OneOf(IResolverContext context)
163+
public static object? IsOneOf(IResolverContext context)
164164
=> context.Parent<IType>() is IInputObjectTypeDefinition iot
165165
? iot.Directives.ContainsName(DirectiveNames.OneOf.Name)
166166
: null;
@@ -191,7 +191,7 @@ public static class Names
191191
public const string EnumValues = "enumValues";
192192
public const string InputFields = "inputFields";
193193
public const string OfType = "ofType";
194-
public const string OneOf = "oneOf";
194+
public const string IsOneOf = "isOneOf";
195195
public const string SpecifiedByUrl = "specifiedByURL";
196196
public const string IncludeDeprecated = "includeDeprecated";
197197
public const string AppliedDirectives = "appliedDirectives";

src/HotChocolate/Core/test/Execution.Tests/Integration/StarWarsCodeFirst/__snapshots__/StarWarsCodeFirstTests.Ensure_Benchmark_Query_LargeQuery.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5818,7 +5818,7 @@
58185818
"deprecationReason": null
58195819
},
58205820
{
5821-
"name": "oneOf",
5821+
"name": "isOneOf",
58225822
"description": null,
58235823
"args": [],
58245824
"type": {

src/HotChocolate/Core/test/Execution.Tests/__snapshots__/IntrospectionTests.DefaultValueIsInputObject.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@
913913
"deprecationReason": null
914914
},
915915
{
916-
"name": "oneOf",
916+
"name": "isOneOf",
917917
"description": null,
918918
"args": [],
919919
"type": {

src/HotChocolate/Core/test/Execution.Tests/__snapshots__/IntrospectionTests.ExecuteGraphiQLIntrospectionQuery.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@
913913
"deprecationReason": null
914914
},
915915
{
916-
"name": "oneOf",
916+
"name": "isOneOf",
917917
"description": null,
918918
"args": [],
919919
"type": {

src/HotChocolate/Core/test/Execution.Tests/__snapshots__/IntrospectionTests.ExecuteGraphiQLIntrospectionQuery_ToJson.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@
913913
"deprecationReason": null
914914
},
915915
{
916-
"name": "oneOf",
916+
"name": "isOneOf",
917917
"description": null,
918918
"args": [],
919919
"type": {

src/HotChocolate/Core/test/Types.Tests/Types/OneOfIntegrationTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,17 +318,17 @@ public async Task OneOf_introspection()
318318
@"{
319319
oneOf_input: __type(name: ""ExampleInput"") {
320320
# should be true
321-
oneOf
321+
isOneOf
322322
}
323323
324324
input: __type(name: ""StandardInput"") {
325325
# should be false
326-
oneOf
326+
isOneOf
327327
}
328328
329329
object: __type(name: ""Query"") {
330330
# should be null
331-
oneOf
331+
isOneOf
332332
}
333333
}")
334334
.MatchSnapshotAsync();
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
{
1+
{
22
"data": {
33
"oneOf_input": {
4-
"oneOf": true
4+
"isOneOf": true
55
},
66
"input": {
7-
"oneOf": false
7+
"isOneOf": false
88
},
99
"object": {
10-
"oneOf": null
10+
"isOneOf": null
1111
}
1212
}
1313
}

src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.DescriptionsAreCorrectlyRead.snap

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,18 @@
840840
"isDeprecated": false,
841841
"deprecationReason": null
842842
},
843+
{
844+
"name": "isOneOf",
845+
"description": null,
846+
"args": [],
847+
"type": {
848+
"kind": "SCALAR",
849+
"name": "Boolean",
850+
"ofType": null
851+
},
852+
"isDeprecated": false,
853+
"deprecationReason": null
854+
},
843855
{
844856
"name": "kind",
845857
"description": null,
@@ -880,18 +892,6 @@
880892
"isDeprecated": false,
881893
"deprecationReason": null
882894
},
883-
{
884-
"name": "oneOf",
885-
"description": null,
886-
"args": [],
887-
"type": {
888-
"kind": "SCALAR",
889-
"name": "Boolean",
890-
"ofType": null
891-
},
892-
"isDeprecated": false,
893-
"deprecationReason": null
894-
},
895895
{
896896
"name": "possibleTypes",
897897
"description": null,

src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.Interfaces_Impl_Interfaces_Are_Correctly_Exposed_Through_Introspection.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@
913913
"deprecationReason": null
914914
},
915915
{
916-
"name": "oneOf",
916+
"name": "isOneOf",
917917
"description": null,
918918
"args": [],
919919
"type": {

src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/__snapshots__/StarWarsIntrospectionTest.Execute_StarWarsIntrospection_Test.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@
907907
"DeprecationReason": null
908908
},
909909
{
910-
"Name": "oneOf",
910+
"Name": "isOneOf",
911911
"Description": null,
912912
"Args": [],
913913
"Type": {
@@ -4193,7 +4193,7 @@
41934193
},
41944194
{
41954195
"__typename": "__Field",
4196-
"Name": "oneOf",
4196+
"Name": "isOneOf",
41974197
"Description": null,
41984198
"Args": [],
41994199
"Type": {

0 commit comments

Comments
 (0)