Object

Description

GraphQL objects represent a list of named fields, each of which yields a value of a specific type.

Note that object types cannot be used for input (instead, see “InputObject” below).

Absinthe Macro

object

Examples

In an Absinthe schema:

​ @desc ​"​​A person"​
​ object ​:person​ ​do​
​  field ​:name​, non_null(​:string​)
​  ​# Other fields​
​ ​end​

Get Craft GraphQL APIs in Elixir with Absinthe now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.