Skip to content

Instantly share code, notes, and snippets.

@WesSouza
Created September 28, 2017 15:34
Show Gist options
  • Save WesSouza/8f52a54e25e3ab904f0bacc30d3b2983 to your computer and use it in GitHub Desktop.
Save WesSouza/8f52a54e25e3ab904f0bacc30d3b2983 to your computer and use it in GitHub Desktop.
Choosing GraphQL for your API - Schema
# The Meetup object, and all of its properties
type Meetup {
id: ID!
name: String!
description: String!
price: Int!
priceFormatted: String!
isAvailable: Boolean!
}
# Exclamation marks indicate the field cannot be null, so it always returns the
# expected value type
# The Wishlist object has one property, an array of meetups
type Wishlist {
meetups: [Meetup!]!
}
# The RootQuery object is used as a starting point for all the queries a client
# can run
type RootQuery {
meetup(id: ID!): Meetup
meetups: [Meetup!]!
wishlist: Wishlist
}
# The schema keyword defines the entry point of a GraphQL schema
schema {
query: RootQuery
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment