You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
... a type definition like type Query { }type Queryis a valid definition, because the production of FieldsDefinition is optional.
People might wonder why this could possibly be useful. Well in conjunction with union, it can be used to implement variant types like in OCaml, where some variants might have parameters, and others might not. For example:
type RGB {
red: Int
green: Int
blue: Int
}
type SystemDefault
union Color = RGB | SystemDefault
Edit: Apologies, type Query { } is invalid, because it requires one or more FieldDefinition productions. However, type Query is valid, which is now not possible to model in graphql-ruby.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
According to both the current and draft specs:
... a type definition like
type Query { }
type Query
is a valid definition,because the production of.FieldsDefinition
is optionalPeople might wonder why this could possibly be useful. Well in conjunction with union, it can be used to implement variant types like in OCaml, where some variants might have parameters, and others might not. For example:
Edit: Apologies,
type Query { }
is invalid, because it requires one or moreFieldDefinition
productions. However,type Query
is valid, which is now not possible to model in graphql-ruby.The text was updated successfully, but these errors were encountered: