Data passed to schema's resolver/field
# schema definition type Query { resources: [Resource!]! resource(format: DataFormat!): Resource! }
resources
field returns array of Resource
type data
resource
field returns object of Resource
type after taking in format
argument
input
value and executes functionFor resource
field, argument/input allows user to narrow down the data returned.
For resources
field, the field is an all-or-nothing
return as we can only get back predefined results.
# schema definition field resource(format: DataFormat!): Resource!
resource
would be the field nameformat
would be the argument nameDataFormat
would be the argument's data type
!
, makes it non-nullable argumentResource
would be the return data type on the field
!
, makes it non-nullable# client query query GetResource { resource(format: "jpeg") { id data } }
The argument on the client query and the schema can be named anything.
field name
on the schemaFor example, when we are passing argument id
,