Created
September 26, 2018 22:12
-
-
Save shrirambalakrishnan/2632573f23c6ca9b615ba73e8d59ef62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
field :actors do | |
type types[Types::ActorType] | |
description "Actor" | |
resolve ->(obj, args, ctx) { | |
# obj is the "movie" object | |
obj.actors | |
} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment