Remove Symbol references from IOutputTypeInfo and implementations#9058
Remove Symbol references from IOutputTypeInfo and implementations#9058michaelstaib merged 7 commits intomainfrom
IOutputTypeInfo and implementations#9058Conversation
🚀 Fusion Gateway Performance ResultsSimple Composite QueryConstant Load (50 VUs)
📊 Response Time Metrics
Ramping Load (0→50→500→50 VUs)
📊 Response Time Metrics
Executed Query fragment User on User {
id
username
name
}
fragment Review on Review {
id
body
}
fragment Product on Product {
inStock
name
price
shippingEstimate
upc
weight
}
query TestQuery {
topProducts(first: 5) {
...Product
reviews {
...Review
author {
...User
}
}
}
}Deep Recursion QueryConstant Load (50 VUs)
📊 Response Time Metrics
Ramping Load (0→50→500→50 VUs)
📊 Response Time Metrics
Executed Query fragment User on User {
id
username
name
}
fragment Review on Review {
id
body
}
fragment Product on Product {
inStock
name
price
shippingEstimate
upc
weight
}
query TestQuery {
users {
...User
reviews {
...Review
product {
...Product
reviews {
...Review
author {
...User
reviews {
...Review
product {
...Product
}
}
}
}
}
}
}
topProducts(first: 5) {
...Product
reviews {
...Review
author {
...User
reviews {
...Review
product {
...Product
}
}
}
}
}
}Variable Batching ThroughputConstant Load (50 VUs)
📊 Response Time Metrics
Ramping Load (0→50→500→50 VUs)
📊 Response Time Metrics
Executed Query query TestQuery_8f7a46ce_2(
$__fusion_1_upc: ID!
$__fusion_2_price: Long!
$__fusion_2_weight: Long!
) {
productByUpc(upc: $__fusion_1_upc) {
inStock
shippingEstimate(weight: $__fusion_2_weight, price: $__fusion_2_price)
}
}Variables (5 sets batched in single request) [
{ "__fusion_1_upc": "1", "__fusion_2_price": 899, "__fusion_2_weight": 100 },
{ "__fusion_1_upc": "2", "__fusion_2_price": 1299, "__fusion_2_weight": 1000 },
{ "__fusion_1_upc": "3", "__fusion_2_price": 15, "__fusion_2_weight": 20 },
{ "__fusion_1_upc": "4", "__fusion_2_price": 499, "__fusion_2_weight": 100 },
{ "__fusion_1_upc": "5", "__fusion_2_price": 1299, "__fusion_2_weight": 1000 }
]No baseline data available for comparison. Run 21286323203 • Commit 14ea88d • Fri, 23 Jan 2026 12:52:42 GMT |
There was a problem hiding this comment.
Pull request overview
Refactors the analyzer models/generators to remove direct Roslyn symbol storage from IOutputTypeInfo implementations, replacing it with a lightweight TypeNameInfo representation.
Changes:
- Introduces
TypeNameInfoand updates output-type models to store type names/keys instead ofINamedTypeSymbolreferences. - Removes
AttributesfromIOutputTypeInfo/implementations and adjusts downstream generator/builder logic accordingly. - Centralizes “assembly-qualified” key generation into
SymbolExtensions.ToAssemblyQualified.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/HotChocolate/Core/src/Types.Analyzers/Polyfills.cs | Adds polyfills for required-member related attributes and IsExternalInit. |
| src/HotChocolate/Core/src/Types.Analyzers/Models/TypeNameInfo.cs | New TypeNameInfo record for storing full + fully-qualified type names. |
| src/HotChocolate/Core/src/Types.Analyzers/Models/RootTypeInfo.cs | Replaces stored symbols/full-name strings with TypeNameInfo + RegistrationKey; removes Attributes. |
| src/HotChocolate/Core/src/Types.Analyzers/Models/Resolver.cs | Stops storing member attributes; computes directive/user-attributes from a local attribute array. |
| src/HotChocolate/Core/src/Types.Analyzers/Models/ObjectTypeInfo.cs | Replaces schema/runtime symbol storage with TypeNameInfo + RegistrationKey; removes Attributes. |
| src/HotChocolate/Core/src/Types.Analyzers/Models/InterfaceTypeInfo.cs | Replaces schema/runtime symbol storage with TypeNameInfo + RegistrationKey; removes Attributes. |
| src/HotChocolate/Core/src/Types.Analyzers/Models/IOutputTypeInfo.cs | Updates interface to expose SchemaTypeName/RuntimeTypeName and RegistrationKey; removes symbol/attributes properties. |
| src/HotChocolate/Core/src/Types.Analyzers/Models/EdgeTypeInfo.cs | Replaces runtime symbol/full-name usage with TypeNameInfo and caches node type fully-qualified name. |
| src/HotChocolate/Core/src/Types.Analyzers/Models/ConnectionTypeInfo.cs | Replaces runtime symbol/full-name usage with TypeNameInfo and caches node type fully-qualified name. |
| src/HotChocolate/Core/src/Types.Analyzers/Inspectors/ConnectionTypeTransformer.cs | Updates runtime-type lookups to use RuntimeTypeName.FullName. |
| src/HotChocolate/Core/src/Types.Analyzers/Helpers/SymbolExtensions.cs | Adds ToAssemblyQualified extension for registration keys. |
| src/HotChocolate/Core/src/Types.Analyzers/Generators/TypeModuleSyntaxGenerator.cs | Uses RegistrationKey and TypeNameInfo fields instead of symbols; removes local helper. |
| src/HotChocolate/Core/src/Types.Analyzers/FileBuilders/TypeFileBuilderBase.cs | Switches runtime-type handling to RuntimeTypeName; updates resolver ctor type-name selection. |
| src/HotChocolate/Core/src/Types.Analyzers/FileBuilders/RootTypeFileBuilder.cs | Uses SchemaTypeName.FullyQualifiedName instead of symbol-based formatting. |
| src/HotChocolate/Core/src/Types.Analyzers/FileBuilders/ObjectTypeFileBuilder.cs | Uses TypeNameInfo for runtime/schema type formatting in generated code. |
| src/HotChocolate/Core/src/Types.Analyzers/FileBuilders/InterfaceTypeFileBuilder.cs | Uses TypeNameInfo for runtime/schema type formatting in generated code. |
| src/HotChocolate/Core/src/Types.Analyzers/FileBuilders/EdgeTypeFileBuilder.cs | Uses TypeNameInfo and cached node type name when generating code. |
| src/HotChocolate/Core/src/Types.Analyzers/FileBuilders/ConnectionTypeFileBuilder.cs | Uses TypeNameInfo and cached node type name when generating code. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/HotChocolate/Core/src/Types.Analyzers/FileBuilders/EdgeTypeFileBuilder.cs
Outdated
Show resolved
Hide resolved
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (syntaxInfo is IOutputTypeInfo { HasRuntimeType: true } typeInfo) | ||
| { | ||
| #if NET8_0_OR_GREATER | ||
| connectionTypeLookup[typeInfo.RuntimeTypeFullName] = typeInfo; | ||
| connectionTypeLookup[typeInfo.RuntimeTypeName.FullName] = typeInfo; | ||
| #else | ||
| connectionTypeLookup[typeInfo.RuntimeTypeFullName!] = typeInfo; | ||
| connectionTypeLookup[typeInfo.RuntimeTypeName!.FullName] = typeInfo; | ||
| #endif |
There was a problem hiding this comment.
connectionTypeLookup is seeded with RuntimeTypeName.FullName, but later lookups/additions use keys prefixed with "global::" (e.g., connectionTypeName). This inconsistency means existing types won't be found and can lead to duplicate generated connection/edge types (potentially causing duplicate AddSource hint names / generator failures). Use a consistent key representation—likely RuntimeTypeName.FullyQualifiedName (and drop manual "global::" concatenation or keep it consistent everywhere).
| var resolverTypeName = | ||
| type.SchemaTypeName?.FullyQualifiedName | ||
| ?? type.RuntimeTypeName?.FullyQualifiedName | ||
| ?? throw new InvalidOperationException("Schema type and runtime type are null."); | ||
|
|
||
| WriteResolverConstructor( | ||
| type, | ||
| typeLookup, | ||
| resolverType.ToFullyQualified(), | ||
| resolverTypeName, |
There was a problem hiding this comment.
resolverTypeName is computed and passed into WriteResolverConstructor(...), but the resolverTypeName parameter is never used inside TypeFileBuilderBase (only referenced at the call site and in the signature). This adds noise and risks future divergence. Either remove the parameter entirely (and the computation), or use it inside the constructor generation logic if it’s intended to influence output.
🚀 Fusion Gateway Performance ResultsSimple Composite QueryConstant Load (50 VUs)
📊 Response Time Metrics
Ramping Load (0→50→500→50 VUs)
📊 Response Time Metrics
Executed Query fragment User on User {
id
username
name
}
fragment Review on Review {
id
body
}
fragment Product on Product {
inStock
name
price
shippingEstimate
upc
weight
}
query TestQuery {
topProducts(first: 5) {
...Product
reviews {
...Review
author {
...User
}
}
}
}Deep Recursion QueryConstant Load (50 VUs)
📊 Response Time Metrics
Ramping Load (0→50→500→50 VUs)
📊 Response Time Metrics
Executed Query fragment User on User {
id
username
name
}
fragment Review on Review {
id
body
}
fragment Product on Product {
inStock
name
price
shippingEstimate
upc
weight
}
query TestQuery {
users {
...User
reviews {
...Review
product {
...Product
reviews {
...Review
author {
...User
reviews {
...Review
product {
...Product
}
}
}
}
}
}
}
topProducts(first: 5) {
...Product
reviews {
...Review
author {
...User
reviews {
...Review
product {
...Product
}
}
}
}
}
}Variable Batching ThroughputConstant Load (50 VUs)
📊 Response Time Metrics
Ramping Load (0→50→500→50 VUs)
📊 Response Time Metrics
Executed Query query TestQuery_8f7a46ce_2(
$__fusion_1_upc: ID!
$__fusion_2_price: Long!
$__fusion_2_weight: Long!
) {
productByUpc(upc: $__fusion_1_upc) {
inStock
shippingEstimate(weight: $__fusion_2_weight, price: $__fusion_2_price)
}
}Variables (5 sets batched in single request) [
{ "__fusion_1_upc": "1", "__fusion_2_price": 899, "__fusion_2_weight": 100 },
{ "__fusion_1_upc": "2", "__fusion_2_price": 1299, "__fusion_2_weight": 1000 },
{ "__fusion_1_upc": "3", "__fusion_2_price": 15, "__fusion_2_weight": 20 },
{ "__fusion_1_upc": "4", "__fusion_2_price": 499, "__fusion_2_weight": 100 },
{ "__fusion_1_upc": "5", "__fusion_2_price": 1299, "__fusion_2_weight": 1000 }
]No baseline data available for comparison. Run 21516271682 • Commit 87fc888 • Fri, 30 Jan 2026 13:15:01 GMT |
|
The 2 comments by Copilot seem valid, but these were existing issues before my changes. Can you confirm:
(or just make the necessary changes in this PR) |
IOutputTypeInfo and implementationsIOutputTypeInfo and implementations
Summary of the changes (Less than 80 chars)
IOutputTypeInfoand implementations.TypeNameInfotype to store type name information, replacing direct storage ofINamedTypeSymbols (SchemaType/RuntimeType).Attributescollection fromIOutputTypeInfoand derived types.