Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamarthurryan/c0b9b9d98a5a04a282bd575b1620f404 to your computer and use it in GitHub Desktop.
Save adamarthurryan/c0b9b9d98a5a04a282bd575b1620f404 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