Graphql-ruby objects
From wikinotes
Fields
All objects in graphql are exposed using fields.
Mutations are added as fields to the rootMutation
object,
and Queries are added to the rootQuery
object.Fields
class User < GraphQL::Schema::Object field :id, Integer # name, returntype field :age, Integer # name, returntype endParametrized Fields
class MyGraph < GraphQL::Schema::Object field :user, User, do |field| field.argument(:id, Integer, required: true) end end