File tree Expand file tree Collapse file tree 6 files changed +20
-24
lines changed Expand file tree Collapse file tree 6 files changed +20
-24
lines changed Original file line number Diff line number Diff line change @@ -33,35 +33,35 @@ public sealed class DefaultValueSyntaxAttribute : DescriptorAttribute
33
33
/// <summary>
34
34
/// Creates a new instance of <see cref="DefaultValueSyntaxAttribute"/>.
35
35
/// </summary>
36
- public DefaultValueSyntaxAttribute ( string ? syntax )
36
+ public DefaultValueSyntaxAttribute ( string syntax )
37
37
{
38
38
Syntax = syntax ;
39
39
}
40
40
41
41
/// <summary>
42
42
/// The GraphQL syntax of the default value.
43
43
/// </summary>
44
- public string ? Syntax { get ; }
44
+ public string Syntax { get ; }
45
45
46
46
/// <inheritdoc />
47
47
protected internal override void TryConfigure (
48
48
IDescriptorContext context ,
49
49
IDescriptor descriptor ,
50
50
ICustomAttributeProvider element )
51
51
{
52
- if ( descriptor is IArgumentDescriptor arg )
52
+ switch ( descriptor )
53
53
{
54
- arg . DefaultValueSyntax ( Syntax ) ;
55
- }
54
+ case IArgumentDescriptor arg :
55
+ arg . DefaultValueSyntax ( Syntax ) ;
56
+ break ;
56
57
57
- if ( descriptor is IDirectiveArgumentDescriptor darg )
58
- {
59
- darg . DefaultValueSyntax ( Syntax ) ;
60
- }
58
+ case IDirectiveArgumentDescriptor arg :
59
+ arg . DefaultValueSyntax ( Syntax ) ;
60
+ break ;
61
61
62
- if ( descriptor is IInputFieldDescriptor field )
63
- {
64
- field . DefaultValueSyntax ( Syntax ) ;
62
+ case IInputFieldDescriptor arg :
63
+ arg . DefaultValueSyntax ( Syntax ) ;
64
+ break ;
65
65
}
66
66
}
67
67
}
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ public static class DirectiveTypeDescriptorExtensions
7
7
{
8
8
public static IDirectiveTypeDescriptor < T > Ignore < T > (
9
9
this IDirectiveTypeDescriptor < T > descriptor ,
10
- Expression < Func < T , object > > property )
10
+ Expression < Func < T , object ? > > property )
11
11
{
12
12
ArgumentNullException . ThrowIfNull ( descriptor ) ;
13
13
ArgumentNullException . ThrowIfNull ( property ) ;
Original file line number Diff line number Diff line change 1
- #nullable disable
2
-
3
1
using System . Linq . Expressions ;
4
2
using HotChocolate . Language ;
5
3
using System . Diagnostics . CodeAnalysis ;
@@ -32,7 +30,7 @@ public static class InputObjectTypeDescriptorExtensions
32
30
/// </exception>
33
31
public static IInputObjectTypeDescriptor < T > Ignore < T > (
34
32
this IInputObjectTypeDescriptor < T > descriptor ,
35
- Expression < Func < T , object > > property )
33
+ Expression < Func < T , object ? > > property )
36
34
{
37
35
ArgumentNullException . ThrowIfNull ( descriptor ) ;
38
36
ArgumentNullException . ThrowIfNull ( property ) ;
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ public static class InterfaceTypeDescriptorExtensions
7
7
{
8
8
public static IInterfaceTypeDescriptor < T > Ignore < T > (
9
9
this IInterfaceTypeDescriptor < T > descriptor ,
10
- Expression < Func < T , object > > propertyOrMethod )
10
+ Expression < Func < T , object ? > > propertyOrMethod )
11
11
{
12
12
ArgumentNullException . ThrowIfNull ( descriptor ) ;
13
13
ArgumentNullException . ThrowIfNull ( propertyOrMethod ) ;
Original file line number Diff line number Diff line change 1
- #nullable disable
2
-
3
1
using System . Linq . Expressions ;
4
2
using HotChocolate . Language ;
5
3
@@ -12,7 +10,7 @@ public static class ObjectTypeDescriptorExtensions
12
10
{
13
11
public static IObjectTypeDescriptor < T > Ignore < T > (
14
12
this IObjectTypeDescriptor < T > descriptor ,
15
- Expression < Func < T , object > > propertyOrMethod )
13
+ Expression < Func < T , object ? > > propertyOrMethod )
16
14
{
17
15
ArgumentNullException . ThrowIfNull ( descriptor ) ;
18
16
ArgumentNullException . ThrowIfNull ( propertyOrMethod ) ;
Original file line number Diff line number Diff line change @@ -369,7 +369,7 @@ public void Ignore_DescriptorIsNull_ArgumentNullException()
369
369
// arrange
370
370
// act
371
371
void Action ( )
372
- => InputObjectTypeDescriptorExtensions . Ignore < SimpleInput > ( null , t => t . Id ) ;
372
+ => InputObjectTypeDescriptorExtensions . Ignore < SimpleInput > ( null ! , t => t . Id ) ;
373
373
374
374
// assert
375
375
Assert . Throws < ArgumentNullException > ( Action ) ;
@@ -384,7 +384,7 @@ public void Ignore_ExpressionIsNull_ArgumentNullException()
384
384
DescriptorContext . Create ( ) ) ;
385
385
386
386
// act
387
- void Action ( ) => descriptor . Ignore ( null ) ;
387
+ void Action ( ) => descriptor . Ignore ( null ! ) ;
388
388
389
389
// assert
390
390
Assert . Throws < ArgumentNullException > ( Action ) ;
@@ -721,15 +721,15 @@ input Foo {
721
721
[ Fact ]
722
722
public void OneOf_descriptor_is_null ( )
723
723
{
724
- void Fail ( ) => InputObjectTypeDescriptorExtensions . OneOf ( null ) ;
724
+ void Fail ( ) => InputObjectTypeDescriptorExtensions . OneOf ( null ! ) ;
725
725
726
726
Assert . Throws < ArgumentNullException > ( Fail ) ;
727
727
}
728
728
729
729
[ Fact ]
730
730
public void OneOf_generic_descriptor_is_null ( )
731
731
{
732
- void Fail ( ) => InputObjectTypeDescriptorExtensions . OneOf < object > ( null ) ;
732
+ void Fail ( ) => InputObjectTypeDescriptorExtensions . OneOf < object > ( null ! ) ;
733
733
734
734
Assert . Throws < ArgumentNullException > ( Fail ) ;
735
735
}
You can’t perform that action at this time.
0 commit comments