Created
October 28, 2015 20:16
-
-
Save ChrisMLee/2386356b1fca579d09cc 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
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 |
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
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