Skip to content

Commit 7d923e6

Browse files
authored
Fix Several Source Generator Issues (#8856)
1 parent c395c16 commit 7d923e6

File tree

288 files changed

+1881
-938
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

288 files changed

+1881
-938
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,3 +326,4 @@ conferences.db-wal
326326
packages.lock.json
327327

328328
Directory.Build.props.user
329+
.generated/

src/HotChocolate/ApolloFederation/src/ApolloFederation/FederationTypeInterceptor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using HotChocolate.ApolloFederation.Resolvers;
55
using HotChocolate.ApolloFederation.Types;
66
using HotChocolate.Configuration;
7+
using HotChocolate.Internal;
78
using HotChocolate.Language;
89
using HotChocolate.Resolvers;
910
using HotChocolate.Types.Descriptors;

src/HotChocolate/ApolloFederation/src/ApolloFederation/Resolvers/ReferenceResolverAttribute.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ public class ReferenceResolverAttribute : DescriptorAttribute
2424
protected internal override void TryConfigure(
2525
IDescriptorContext context,
2626
IDescriptor descriptor,
27-
ICustomAttributeProvider element)
27+
ICustomAttributeProvider? attributeProvider)
2828
{
2929
if (descriptor is IObjectTypeDescriptor objectTypeDescriptor)
3030
{
31-
switch (element)
31+
switch (attributeProvider)
3232
{
3333
case Type type:
3434
OnConfigure(objectTypeDescriptor, type);
@@ -42,7 +42,7 @@ protected internal override void TryConfigure(
4242

4343
if (descriptor is IInterfaceTypeDescriptor interfaceTypeDescriptor)
4444
{
45-
switch (element)
45+
switch (attributeProvider)
4646
{
4747
case Type type:
4848
OnConfigure(interfaceTypeDescriptor, type);

src/HotChocolate/ApolloFederation/src/ApolloFederation/ThrowHelper.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,25 +148,25 @@ public static SchemaException Key_FieldSet_ResolvableMustBeConsistent(
148148
/// <see cref="string.Empty"/>.
149149
/// </summary>
150150
public static SchemaException Provides_FieldSet_CannotBeEmpty(
151-
MemberInfo member) =>
151+
string fieldName) =>
152152
new SchemaException(
153153
SchemaErrorBuilder.New()
154154
.SetMessage(ThrowHelper_Provides_FieldSet_CannotBeEmpty)
155155
// .SetCode(ErrorCodes.ApolloFederation.ProvidesFieldSetNullOrEmpty)
156-
.SetExtension(nameof(member), member)
156+
.SetExtension(nameof(fieldName), fieldName)
157157
.Build());
158158

159159
/// <summary>
160160
/// The requires attribute is used and the fieldset is set to <c>null</c> or
161161
/// <see cref="string.Empty"/>.
162162
/// </summary>
163163
public static SchemaException Requires_FieldSet_CannotBeEmpty(
164-
MemberInfo member) =>
164+
string fieldName) =>
165165
new SchemaException(
166166
SchemaErrorBuilder.New()
167167
.SetMessage(ThrowHelper_Requires_FieldSet_CannotBeEmpty)
168168
// .SetCode(ErrorCodes.ApolloFederation.RequiresFieldSetNullOrEmpty)
169-
.SetExtension(nameof(member), member)
169+
.SetExtension(nameof(fieldName), fieldName)
170170
.Build());
171171

172172
/// <summary>

src/HotChocolate/ApolloFederation/src/ApolloFederation/Types/Directives/AuthenticatedAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public sealed class AuthenticatedAttribute : DescriptorAttribute
3838
protected internal override void TryConfigure(
3939
IDescriptorContext context,
4040
IDescriptor descriptor,
41-
ICustomAttributeProvider element)
41+
ICustomAttributeProvider? attributeProvider)
4242
{
4343
switch (descriptor)
4444
{

src/HotChocolate/ApolloFederation/src/ApolloFederation/Types/Directives/ExtendServiceTypeAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ public sealed class ExtendServiceTypeAttribute : ObjectTypeDescriptorAttribute
2626
protected override void OnConfigure(
2727
IDescriptorContext context,
2828
IObjectTypeDescriptor descriptor,
29-
Type type)
29+
Type? type)
3030
=> descriptor.ExtendServiceType();
3131
}

src/HotChocolate/ApolloFederation/src/ApolloFederation/Types/Directives/ExternalAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public sealed class ExternalAttribute : DescriptorAttribute
3939
protected internal override void TryConfigure(
4040
IDescriptorContext context,
4141
IDescriptor descriptor,
42-
ICustomAttributeProvider element)
42+
ICustomAttributeProvider? attributeProvider)
4343
{
4444
switch (descriptor)
4545
{

src/HotChocolate/ApolloFederation/src/ApolloFederation/Types/Directives/InaccessibleAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public sealed class InaccessibleAttribute : DescriptorAttribute
4848
protected internal override void TryConfigure(
4949
IDescriptorContext context,
5050
IDescriptor descriptor,
51-
ICustomAttributeProvider element)
51+
ICustomAttributeProvider? attributeProvider)
5252
{
5353
switch (descriptor)
5454
{

src/HotChocolate/ApolloFederation/src/ApolloFederation/Types/Directives/InterfaceObjectAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ public sealed class InterfaceObjectAttribute : ObjectTypeDescriptorAttribute
2424
protected override void OnConfigure(
2525
IDescriptorContext context,
2626
IObjectTypeDescriptor descriptor,
27-
Type type)
27+
Type? type)
2828
=> descriptor.InterfaceObject();
2929
}

src/HotChocolate/ApolloFederation/src/ApolloFederation/Types/Directives/KeyAttribute.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ public KeyAttribute(string fieldSet, bool resolvable = true)
7979
protected internal override void TryConfigure(
8080
IDescriptorContext context,
8181
IDescriptor descriptor,
82-
ICustomAttributeProvider element)
82+
ICustomAttributeProvider? attributeProvider)
8383
{
84-
switch (element)
84+
switch (attributeProvider)
8585
{
8686
case Type type:
8787
ConfigureType(type, descriptor);

0 commit comments

Comments
 (0)