Skip to content

Commit 7710bd9

Browse files
authored
[Fusion] Removed unused code in Composition (#8780)
1 parent f006523 commit 7710bd9

File tree

8 files changed

+2
-83
lines changed

8 files changed

+2
-83
lines changed

src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Extensions/DirectivesProviderExtensions.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ public static bool HasFusionInaccessibleDirective(this IDirectivesProvider type)
4949
return type.Directives.ContainsName(WellKnownDirectiveNames.FusionInaccessible);
5050
}
5151

52-
public static bool HasFusionRequiresDirective(this IDirectivesProvider type)
53-
{
54-
return type.Directives.ContainsName(WellKnownDirectiveNames.FusionRequires);
55-
}
56-
5752
public static bool HasInaccessibleDirective(this IDirectivesProvider type)
5853
{
5954
return type.Directives.ContainsName(WellKnownDirectiveNames.Inaccessible);

src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Extensions/MutableOutputFieldDefinitionExtensions.cs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Collections.Immutable;
2-
using HotChocolate.Fusion.Definitions;
32
using HotChocolate.Fusion.Language;
43
using HotChocolate.Fusion.Rewriters;
54
using HotChocolate.Language;
@@ -13,16 +12,6 @@ namespace HotChocolate.Fusion.Extensions;
1312

1413
internal static class MutableOutputFieldDefinitionExtensions
1514
{
16-
public static void ApplyShareableDirective(this MutableOutputFieldDefinition field)
17-
{
18-
if (field.Directives.ContainsName(DirectiveNames.Shareable))
19-
{
20-
return;
21-
}
22-
23-
field.Directives.Add(new Directive(new ShareableMutableDirectiveDefinition()));
24-
}
25-
2615
public static bool ExistsInSchema(this MutableOutputFieldDefinition field, string schemaName)
2716
{
2817
return field.Directives.AsEnumerable().Any(
@@ -106,9 +95,9 @@ public static string GetKeyFields(
10695
return mergedSelectionSet.ToString(indented: false).AsSpan()[2..^2].ToString();
10796
}
10897

109-
public static bool HasInternalDirective(this MutableOutputFieldDefinition type)
98+
public static bool HasInternalDirective(this MutableOutputFieldDefinition field)
11099
{
111-
return type.Directives.ContainsName(DirectiveNames.Internal);
100+
return field.Directives.ContainsName(DirectiveNames.Internal);
112101
}
113102

114103
public static bool IsPartial(this MutableOutputFieldDefinition field, string schemaName)

src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Logging/Contracts/ILoggingSession.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Logging/LogEntryCodes.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public static class LogEntryCodes
5555
public const string RootMutationUsed = "ROOT_MUTATION_USED";
5656
public const string RootQueryUsed = "ROOT_QUERY_USED";
5757
public const string RootSubscriptionUsed = "ROOT_SUBSCRIPTION_USED";
58-
public const string TypeDefinitionInvalid = "TYPE_DEFINITION_INVALID";
5958
public const string TypeKindMismatch = "TYPE_KIND_MISMATCH";
6059
public const string Unsatisfiable = "UNSATISFIABLE";
6160
}

src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Logging/LogEntryHelper.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -982,21 +982,6 @@ public static LogEntry RootSubscriptionUsed(MutableSchemaDefinition schema)
982982
schema: schema);
983983
}
984984

985-
public static LogEntry TypeDefinitionInvalid(
986-
INameProvider member,
987-
MutableSchemaDefinition schema,
988-
string? details = null)
989-
{
990-
return new LogEntry(
991-
string.Format(LogEntryHelper_TypeDefinitionInvalid, member.Name, schema.Name),
992-
LogEntryCodes.TypeDefinitionInvalid,
993-
LogSeverity.Error,
994-
new SchemaCoordinate(member.Name),
995-
member,
996-
schema,
997-
details);
998-
}
999-
1000985
public static LogEntry TypeKindMismatch(
1001986
ITypeDefinition type,
1002987
MutableSchemaDefinition schemaA,

src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Properties/CompositionResources.Designer.cs

Lines changed: 0 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Properties/CompositionResources.resx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,6 @@
336336
<data name="LogEntryHelper_RootSubscriptionUsed" xml:space="preserve">
337337
<value>The root subscription type in schema '{0}' must be named 'Subscription'.</value>
338338
</data>
339-
<data name="LogEntryHelper_TypeDefinitionInvalid" xml:space="preserve">
340-
<value>The type or directive '{0}' in schema '{1}' is incompatible with the built-in type or directive of the same name.</value>
341-
</data>
342339
<data name="LogEntryHelper_TypeKindMismatch" xml:space="preserve">
343340
<value>The type '{0}' has a different kind in schema '{1}' ({2}) than it does in schema '{3}' ({4}).</value>
344341
</data>
@@ -414,10 +411,4 @@
414411
<data name="TypeDefinitionExtensions_TheSpecifiedTypeIsNotAnAbstractType" xml:space="preserve">
415412
<value>The specified type is not an abstract type.</value>
416413
</data>
417-
<data name="TypeDefinitionInvalidRule_ArgumentMissing" xml:space="preserve">
418-
<value>The argument '{0}' is missing.</value>
419-
</data>
420-
<data name="TypeDefinitionInvalidRule_ArgumentTypeDifferent" xml:space="preserve">
421-
<value>The argument '{0}' has a different type.</value>
422-
</data>
423414
</root>

src/HotChocolate/Fusion-vnext/src/Fusion.Composition/WellKnownArgumentNames.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ internal static class WellKnownArgumentNames
1818
public const string Requirements = "requirements";
1919
public const string Schema = "schema";
2020
public const string SourceType = "sourceType";
21-
public const string Value = "value";
2221
}

0 commit comments

Comments
 (0)