Skip to content

Instantly share code, notes, and snippets.

@ChrisMLee
Created October 28, 2015 20:16
Show Gist options
  • Save ChrisMLee/2386356b1fca579d09cc to your computer and use it in GitHub Desktop.
Save ChrisMLee/2386356b1fca579d09cc to your computer and use it in GitHub Desktop.
ListingType = GraphQL::ObjectType.define do
name "Listing"
description "Book listing by user"
global_id_field :id
field :id, !types.ID
field :user, !UserType, "if of user who owns book"
field :price, !types.Float
end
UserType = GraphQL::ObjectType.define do
name "User"
description "Application user"
interfaces [NodeIdentification.interface]
field :id, !types.ID
global_id_field :id
field :username, !types.String, "The name the person chose upon registration"
connection :listings, ListingType.connection_type, "Listings for user"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment