输入对象值
ObjectValue[Const]:
{}
{ObjectField[?Const] list}
ObjectField[Const]
Name:Value[Const]
Input object literal values are unordered lists of keyed input values wrapped in curly‐braces{ }
. The values of an object literal may be any input value literal or variable (ex.{ name: "Hello world", score: 1.0 }
). We refer to literal representation of input objects as “object literals.”
Input object fields are unordered
Input object fields may be provided in any syntactic order and maintain identical semantic meaning.
These two queries are semantically identical:
{
nearestThing(location: { lon: 12.43, lat: -53.211 })
}
{
nearestThing(location: { lat: -53.211, lon: 12.43 })
}
Semantics
ObjectValue : {}
Return a new input object value with no fields.
ObjectValue : {ObjectField list}
Let inputObject be a new input object value with no fields.
For each field in ObjectFieldlist
Let name be Name in field.
Let value be the result of evaluating Value in field.
Add a field to inputObject of name name containing value value.
Return inputObject