Skip to content

Commit fc8d3d6

Browse files
authored
[Fusion] Include internal types/fields during source schema validation (#9554)
1 parent 58d2bd0 commit fc8d3d6

4 files changed

Lines changed: 3 additions & 14 deletions

File tree

526 Bytes
Binary file not shown.

src/HotChocolate/Fusion/benchmarks/k6/eShop.Reviews/ProductQueries.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ namespace eShop.Reviews;
88
public static partial class ProductQueries
99
{
1010
[Lookup, Internal]
11-
public static Product GetProduct([ID] string upc)
11+
public static Product? GetProduct([ID] string upc)
1212
=> new() { Upc = upc };
1313
}

src/HotChocolate/Fusion/benchmarks/k6/eShop.Reviews/schema.graphqls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type Product {
88
}
99

1010
type Query {
11-
product(upc: ID!): Product! @lookup @internal
11+
product(upc: ID!): Product @lookup @internal
1212
review(id: ID!): Review @lookup
1313
user(id: ID!): User @lookup @internal
1414
}
@@ -43,7 +43,7 @@ type User @internal {
4343
id: ID!
4444
name: String!
4545
}
46-
46+
4747
directive @internal on OBJECT | FIELD_DEFINITION
4848
"""
4949
directive @internal on OBJECT | FIELD_DEFINITION

src/HotChocolate/Fusion/src/Fusion.Composition/SourceSchemaValidator.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using HotChocolate.Fusion.Errors;
33
using HotChocolate.Fusion.Events;
44
using HotChocolate.Fusion.Events.Contracts;
5-
using HotChocolate.Fusion.Extensions;
65
using HotChocolate.Fusion.Logging.Contracts;
76
using HotChocolate.Fusion.Results;
87
using HotChocolate.Types.Mutable;
@@ -33,11 +32,6 @@ private void PublishEvents()
3332

3433
foreach (var type in schema.Types)
3534
{
36-
if (type is MutableObjectTypeDefinition { IsInternal: true })
37-
{
38-
continue;
39-
}
40-
4135
PublishEvent(new TypeEvent(type, schema), context);
4236

4337
if (type is MutableComplexTypeDefinition complexType)
@@ -46,11 +40,6 @@ private void PublishEvents()
4640

4741
foreach (var field in complexType.Fields)
4842
{
49-
if (field.IsInternal)
50-
{
51-
continue;
52-
}
53-
5443
PublishEvent(new OutputFieldEvent(field, type, schema), context);
5544

5645
foreach (var argument in field.Arguments)

0 commit comments

Comments
 (0)