@@ -879,9 +879,6 @@ of rules must be adhered to by every Object type in a GraphQL schema.
879
879
{"\_\_" } (two underscores).
880
880
2. The argument must accept a type where {IsInputType (argumentType)}
881
881
returns {true }.
882
- 3. If the field is a Oneof Field :
883
- 1. The argument must be nullable .
884
- 2. The argument must not have a default value .
885
882
3. An object type may declare that it implements one or more unique interfaces .
886
883
4. An object type must be a super -set of all interfaces it implements :
887
884
1. Let this object type be {objectType }.
@@ -909,8 +906,6 @@ IsValidImplementation(type, implementedType):
909
906
2. Let {implementedFieldType } be the return type of {implementedField }.
910
907
3. {IsValidImplementationFieldType (fieldType, implementedFieldType)} must
911
908
be {true }.
912
- 6. {field } must be a Oneof Field if and only if {implementedField } is a
913
- Oneof Field .
914
909
915
910
IsValidImplementationFieldType (fieldType, implementedFieldType):
916
911
@@ -984,31 +979,6 @@ May return the result:
984
979
The type of an object field argument must be an input type (any type except an
985
980
Object, Interface, or Union type).
986
981
987
- **Oneof Fields **
988
-
989
- Oneof Fields are a special variant of Object Type fields where the type system
990
- asserts that exactly one of the field 's arguments must be set and non -null , all
991
- others being omitted . This is useful for representing situations where a field
992
- provides more than one input option to accomplish the same (or similar) goal .
993
-
994
- When using the type system definition language , the `@oneOf ` directive is used
995
- to indicate that a Field is a Oneof Field (and thus requires exactly one of its
996
- arguments be provided):
997
-
998
- ```graphql
999
- type Query {
1000
- findUser (
1001
- byID : ID
1002
- byUsername : String
1003
- byEmail : String
1004
- byRegistrationNumber : Int
1005
- ): User @oneOf
1006
- }
1007
- ```
1008
-
1009
- In schema introspection , the `__Field .oneOf ` field will return {true } for Oneof
1010
- Fields , and {false } for all other Fields .
1011
-
1012
982
### Field Deprecation
1013
983
1014
984
Fields in an object may be marked as deprecated as deemed necessary by the
@@ -1254,9 +1224,6 @@ Interface types have the potential to be invalid if incorrectly defined.
1254
1224
{"\_\_" } (two underscores).
1255
1225
2. The argument must accept a type where {IsInputType (argumentType)}
1256
1226
returns {true }.
1257
- 3. If the field is a Oneof Field :
1258
- 1. The argument must be nullable .
1259
- 2. The argument must not have a default value .
1260
1227
3. An interface type may declare that it implements one or more unique
1261
1228
interfaces , but may not implement itself .
1262
1229
4. An interface type must be a super -set of all interfaces it implements :
@@ -1712,7 +1679,7 @@ input ExampleInputObject {
1712
1679
| `{ b : $var }` | `{ var : null }` | Error : {b } must be non -null . |
1713
1680
| `{ b : 123, c : "xyz" }` | `{}` | Error : Unexpected field {c } |
1714
1681
1715
- Following are examples of input coercion for a Oneof Input Object with a
1682
+ Following are examples of input coercion for a oneOf input object type with a
1716
1683
`String ` member field `a ` and an `Int ` member field `b `:
1717
1684
1718
1685
```graphql example
@@ -2007,8 +1974,7 @@ GraphQL implementations that support the type system definition language should
2007
1974
provide the `@specifiedBy ` directive if representing custom scalar definitions .
2008
1975
2009
1976
GraphQL implementations that support the type system definition language should
2010
- provide the `@oneOf ` directive if the schema contains Oneof Input Objects or
2011
- Oneof Fields .
1977
+ provide the `@oneOf ` directive if representing Oneof Input Objects .
2012
1978
2013
1979
When representing a GraphQL schema using the type system definition language any
2014
1980
_built -in directive_ may be omitted for brevity .
@@ -2201,14 +2167,11 @@ scalar UUID @specifiedBy(url: "https://tools.ietf.org/html/rfc4122")
2201
2167
### @oneOf
2202
2168
2203
2169
```graphql
2204
- directive @oneOf on INPUT_OBJECT | FIELD_DEFINITION
2170
+ directive @oneOf on INPUT_OBJECT
2205
2171
```
2206
2172
2207
2173
The `@oneOf ` directive is used within the type system definition language to
2208
- indicate :
2209
-
2210
- - an Input Object is a Oneof Input Object , or
2211
- - an Object Type 's Field is a Oneof Field .
2174
+ indicate an Input Object is a Oneof Input Object .
2212
2175
2213
2176
```graphql example
2214
2177
input UserUniqueCondition @oneOf {
0 commit comments