type User {
  id: ID!
  name: String!
  avatar: String!
}

type Photo {
  id: ID!
  user: User!
  url: String!
  comment: String!
  rating: Int!
  liked: Boolean!
  followed: Boolean!
}

type Query {
  # query{timeline{id,url,user{id,name}}}
  timeline: [Photo!]!

  # query{user(userID:"1"){id,avatar,name}}
  user(userID: ID!): User!

  # query{photos(userID:"1"){id,url,user{id,name}}}
  photos(userID: ID!): [Photo!]!
}

type Mutation {
  # mutation _{ratePhoto(photoID:"1", direction:"up"){id,url,rating,user{id,name}}}
  ratePhoto(photoID: ID!, direction: String!): Photo!
}

# go run github.com/99designs/gqlgen init
# go run github.com/99designs/gqlgen -v

# rm -rf generated.go models_generated gqlgen.yml models_gen.go resolver.go server.go