Skip to content

Instantly share code, notes, and snippets.

@dabit3
Last active November 5, 2018 21:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save dabit3/3688834a8f14397352116690bdf7ba6e to your computer and use it in GitHub Desktop.
Save dabit3/3688834a8f14397352116690bdf7ba6e to your computer and use it in GitHub Desktop.
Cities App Schema
type City {
id: ID!
name: String!
country: String!
locations: [Location]
}
type Location {
id: ID!
cityId: ID!
name: String!
info: String
}
type Mutation {
putCity(id: ID!, name: String!, country: String!): City
deleteCity(id: ID!): City
putLocation(
id: ID!,
cityId: ID!,
name: String!,
info: String
): Location
deleteLocation(id: ID!): Location
}
type Query {
getCity(id: ID!): City
allCity(count: Int, nextToken: String): [City]
getLocation(id: ID!): Location
allLocation(count: Int, nextToken: String): [Location]
}
type Subscription {
putLocation: Location
@aws_subscribe(mutations: ["putLocation"])
putCity: City
@aws_subscribe(mutations: ["putCity"])
}
schema {
query: Query
mutation: Mutation
subscription: Subscription
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment