And given the fact that we only add one query root and one mutation root we could omit the name of the query root (and implicityly call them QueryRoot and MutationRoot)
There should be two overwritten methods queries(Closure) and queries(String, Closure) in case something would want to name his/her query root with a custom name
Although I thought to change field by query and addField to addQuery however the type of object created or passed as an argument is a field, not a query. That would have led the API a little bit incoherent.
At the moment
DSL.schema
queries are defined like:But I would say that if we're adding queries definitions inside one query root, it would make more sense to have defined it like:
And given the fact that we only add one query root and one mutation root we could omit the name of the query root (and implicityly call them
QueryRoot
andMutationRoot
)or:
Some final thoughts:
queries(Closure)
andqueries(String, Closure)
in case something would want to name his/her query root with a custom namefield
byquery
andaddField
toaddQuery
however the type of object created or passed as an argument is a field, not a query. That would have led the API a little bit incoherent.