Skip to content

Instantly share code, notes, and snippets.

View shrirambalakrishnan's full-sized avatar

Shriram shrirambalakrishnan

View GitHub Profile
field :first_movie do
type Types::MovieType
description "Return the first movie"
resolve ->(obj, args, ctx) { Movie.first }
end
Types::MovieType = GraphQL::ObjectType.define do
name 'Movie'
description 'Movie Details'
field :id, !types.ID
field :name, !types.String
field :genre, types.String
field :year, types.String
end