@@ -53,6 +53,7 @@ public function testExecutesAnIntrospectionQuery(): void
53
53
[
54
54
'kind ' => 'OBJECT ' ,
55
55
'name ' => 'SomeObject ' ,
56
+ 'isOneOf ' => null ,
56
57
'fields ' => [
57
58
[
58
59
'name ' => 'someField ' ,
@@ -74,6 +75,7 @@ public function testExecutesAnIntrospectionQuery(): void
74
75
[
75
76
'kind ' => 'SCALAR ' ,
76
77
'name ' => 'String ' ,
78
+ 'isOneOf ' => null ,
77
79
'fields ' => null ,
78
80
'inputFields ' => null ,
79
81
'interfaces ' => null ,
@@ -83,6 +85,7 @@ public function testExecutesAnIntrospectionQuery(): void
83
85
[
84
86
'kind ' => 'SCALAR ' ,
85
87
'name ' => 'Boolean ' ,
88
+ 'isOneOf ' => null ,
86
89
'fields ' => null ,
87
90
'inputFields ' => null ,
88
91
'interfaces ' => null ,
@@ -92,6 +95,7 @@ public function testExecutesAnIntrospectionQuery(): void
92
95
[
93
96
'kind ' => 'OBJECT ' ,
94
97
'name ' => '__Schema ' ,
98
+ 'isOneOf ' => null ,
95
99
'fields ' => [
96
100
0 => [
97
101
'name ' => 'types ' ,
@@ -185,6 +189,7 @@ public function testExecutesAnIntrospectionQuery(): void
185
189
[
186
190
'kind ' => 'OBJECT ' ,
187
191
'name ' => '__Type ' ,
192
+ 'isOneOf ' => null ,
188
193
'fields ' => [
189
194
0 => [
190
195
'name ' => 'kind ' ,
@@ -385,6 +390,7 @@ public function testExecutesAnIntrospectionQuery(): void
385
390
[
386
391
'kind ' => 'ENUM ' ,
387
392
'name ' => '__TypeKind ' ,
393
+ 'isOneOf ' => null ,
388
394
'fields ' => null ,
389
395
'inputFields ' => null ,
390
396
'interfaces ' => null ,
@@ -435,6 +441,7 @@ public function testExecutesAnIntrospectionQuery(): void
435
441
[
436
442
'kind ' => 'OBJECT ' ,
437
443
'name ' => '__Field ' ,
444
+ 'isOneOf ' => null ,
438
445
'fields ' => [
439
446
0 => [
440
447
'name ' => 'name ' ,
@@ -547,6 +554,7 @@ public function testExecutesAnIntrospectionQuery(): void
547
554
[
548
555
'kind ' => 'OBJECT ' ,
549
556
'name ' => '__InputValue ' ,
557
+ 'isOneOf ' => null ,
550
558
'fields ' => [
551
559
0 => [
552
560
'name ' => 'name ' ,
@@ -635,6 +643,7 @@ public function testExecutesAnIntrospectionQuery(): void
635
643
[
636
644
'kind ' => 'OBJECT ' ,
637
645
'name ' => '__EnumValue ' ,
646
+ 'isOneOf ' => null ,
638
647
'fields ' => [
639
648
0 => [
640
649
'name ' => 'name ' ,
@@ -697,6 +706,7 @@ public function testExecutesAnIntrospectionQuery(): void
697
706
[
698
707
'kind ' => 'OBJECT ' ,
699
708
'name ' => '__Directive ' ,
709
+ 'isOneOf ' => null ,
700
710
'fields ' => [
701
711
[
702
712
'name ' => 'name ' ,
@@ -794,6 +804,7 @@ public function testExecutesAnIntrospectionQuery(): void
794
804
[
795
805
'kind ' => 'ENUM ' ,
796
806
'name ' => '__DirectiveLocation ' ,
807
+ 'isOneOf ' => null ,
797
808
'fields ' => null ,
798
809
'inputFields ' => null ,
799
810
'interfaces ' => null ,
@@ -1831,4 +1842,30 @@ public static function invisibleFieldDataProvider(): iterable
1831
1842
yield [fn (): bool => false ];
1832
1843
yield [false ];
1833
1844
}
1845
+
1846
+ public function testIsOneOf (): void
1847
+ {
1848
+ $ input = new InputObjectType ([
1849
+ 'name ' => 'SearchInput ' ,
1850
+ 'isOneOf ' => true ,
1851
+ 'fields ' => [
1852
+ 'name ' => ['type ' => Type::string ()],
1853
+ 'email ' => ['type ' => Type::string ()],
1854
+ ],
1855
+ ]);
1856
+
1857
+ $ query = new ObjectType ([
1858
+ 'name ' => 'QueryRoot ' ,
1859
+ 'fields ' => [
1860
+ 'input ' => ['type ' => $ input ],
1861
+ ],
1862
+ ]);
1863
+
1864
+ $ schema = new Schema ([
1865
+ 'query ' => $ query ,
1866
+ ]);
1867
+
1868
+ $ introspection = Introspection::fromSchema ($ schema );
1869
+ self ::assertTrue ($ introspection ['__schema ' ]['types ' ][1 ]['isOneOf ' ]);
1870
+ }
1834
1871
}
0 commit comments