Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ internal static void Enqueue(
{
var typeInspector = context.TypeInspector;

if (context.Options.EnableOneOf)
{
EnqueueTypeRef(backlog, typeInspector.GetTypeRef(typeof(OneOfDirectiveType)), nextIndex++);
}

if (context.Options.EnableDefer)
{
EnqueueTypeRef(backlog, typeInspector.GetTypeRef(typeof(DeferDirectiveType)), nextIndex++);
Expand All @@ -40,6 +35,7 @@ internal static void Enqueue(
EnqueueTypeRef(backlog, typeInspector.GetTypeRef(typeof(SkipDirectiveType)), nextIndex++);
EnqueueTypeRef(backlog, typeInspector.GetTypeRef(typeof(IncludeDirectiveType)), nextIndex++);
EnqueueTypeRef(backlog, typeInspector.GetTypeRef(typeof(DeprecatedDirectiveType)), nextIndex++);
EnqueueTypeRef(backlog, typeInspector.GetTypeRef(typeof(OneOfDirectiveType)), nextIndex++);

static void EnqueueTypeRef(
PriorityQueue<TypeReference, (TypeReferenceStrength, int)> backlog,
Expand Down
5 changes: 0 additions & 5 deletions src/HotChocolate/Core/src/Types/IReadOnlySchemaOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,6 @@ public interface IReadOnlySchemaOptions
/// </summary>
IsOfTypeFallback? DefaultIsOfTypeCheck { get; }

/// <summary>
/// Defines if the one-of feature shall be enabled.
/// </summary>
bool EnableOneOf { get; }

/// <summary>
/// Defines if flag enums should be inferred as object value nodes
/// </summary>
Expand Down
4 changes: 0 additions & 4 deletions src/HotChocolate/Core/src/Types/SchemaOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ public FieldBindingFlags DefaultFieldBindingFlags
/// <inheritdoc cref="IReadOnlySchemaOptions.DefaultIsOfTypeCheck"/>
public IsOfTypeFallback? DefaultIsOfTypeCheck { get; set; }

/// <inheritdoc cref="IReadOnlySchemaOptions.EnableOneOf"/>
public bool EnableOneOf { get; set; } = true;

/// <inheritdoc cref="IReadOnlySchemaOptions.EnableFlagEnums"/>
public bool EnableFlagEnums { get; set; }

Expand Down Expand Up @@ -214,7 +211,6 @@ public static SchemaOptions FromOptions(IReadOnlySchemaOptions options)
RemoveUnusedTypeSystemDirectives = options.RemoveUnusedTypeSystemDirectives,
SortFieldsByName = options.SortFieldsByName,
DefaultIsOfTypeCheck = options.DefaultIsOfTypeCheck,
EnableOneOf = options.EnableOneOf,
EnableFlagEnums = options.EnableFlagEnums,
EnableDefer = options.EnableDefer,
EnableStream = options.EnableStream,
Expand Down
10 changes: 2 additions & 8 deletions src/HotChocolate/Core/src/Types/Types/Introspection/__Type.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,11 @@ protected override ObjectTypeConfiguration CreateConfiguration(ITypeDiscoveryCon
new(Names.SpecifiedByUrl,
TypeResources.Type_SpecifiedByUrl_Description,
stringType,
pureResolver: Resolvers.SpecifiedBy)
pureResolver: Resolvers.SpecifiedBy),
new(Names.IsOneOf, type: booleanType, pureResolver: Resolvers.IsOneOf)
}
};

if (context.DescriptorContext.Options.EnableOneOf)
{
def.Fields.Add(new(Names.IsOneOf,
type: booleanType,
pureResolver: Resolvers.IsOneOf));
}

if (context.DescriptorContext.Options.EnableDirectiveIntrospection)
{
def.Fields.Add(new(Names.AppliedDirectives,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,6 @@
"EnumType<TypeKind!>"
]
},
{
"type": "HotChocolate.Types.OneOfDirectiveType",
"runtimeType": "System.Object",
"references": [
"HotChocolate.Types.OneOfDirectiveType",
"OneOfDirectiveType"
]
},
{
"type": "HotChocolate.Types.SkipDirectiveType",
"runtimeType": "System.Object",
Expand All @@ -106,6 +98,14 @@
"@DeprecatedDirective"
]
},
{
"type": "HotChocolate.Types.OneOfDirectiveType",
"runtimeType": "System.Object",
"references": [
"HotChocolate.Types.OneOfDirectiveType",
"OneOfDirectiveType"
]
},
{
"type": "HotChocolate.Types.StringType",
"runtimeType": "System.String",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,6 @@
"EnumType<TypeKind!>"
]
},
{
"type": "HotChocolate.Types.OneOfDirectiveType",
"runtimeType": "System.Object",
"references": [
"HotChocolate.Types.OneOfDirectiveType",
"OneOfDirectiveType"
]
},
{
"type": "HotChocolate.Types.SkipDirectiveType",
"runtimeType": "System.Object",
Expand All @@ -106,6 +98,14 @@
"@DeprecatedDirective"
]
},
{
"type": "HotChocolate.Types.OneOfDirectiveType",
"runtimeType": "System.Object",
"references": [
"HotChocolate.Types.OneOfDirectiveType",
"OneOfDirectiveType"
]
},
{
"type": "HotChocolate.Configuration.TypeDiscovererTests.FooType",
"runtimeType": "HotChocolate.Configuration.TypeDiscovererTests.Foo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,6 @@
"EnumType<TypeKind!>"
]
},
{
"type": "HotChocolate.Types.OneOfDirectiveType",
"runtimeType": "System.Object",
"references": [
"HotChocolate.Types.OneOfDirectiveType",
"OneOfDirectiveType"
]
},
{
"type": "HotChocolate.Types.SkipDirectiveType",
"runtimeType": "System.Object",
Expand All @@ -106,6 +98,14 @@
"@DeprecatedDirective"
]
},
{
"type": "HotChocolate.Types.OneOfDirectiveType",
"runtimeType": "System.Object",
"references": [
"HotChocolate.Types.OneOfDirectiveType",
"OneOfDirectiveType"
]
},
{
"type": "HotChocolate.Configuration.TypeDiscovererTests.FooType",
"runtimeType": "HotChocolate.Configuration.TypeDiscovererTests.Foo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,7 @@ builder.Services
")
.BindRuntimeType<Mutation>()
.BindRuntimeType<Pet>()
.BindRuntimeType<Dog>()
.ModifyOptions(o => o.EnableOneOf = true);
.BindRuntimeType<Dog>();
```

</Schema>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,10 @@ In an effort to standardize our abstractions, we've renamed `IHasRuntimeType` to

The conversion from GUID to string in the default type converter has been updated to format with hyphens (format "D") instead of without (format "N"), to follow the documented behavior.

## EnableOneOf option removed

The `EnableOneOf` option has been removed, as the `@oneOf` directive is now built in.

# Deprecations

Things that will continue to function this release, but we encourage you to move away from.
Expand Down
Loading