Files
old-spike/config/graphql/schema.graphql
2016-01-31 18:18:53 -06:00

65 lines
963 B
GraphQL

type House implements Node {
id: ID!
name: String!
power_data(after: String, first: Int, before: String, last: Int): PowerDatumConnection
habitants(after: String, first: Int, before: String, last: Int): UserConnection
}
type HouseConnection {
pageInfo: PageInfo!
edges: [HouseEdge]
}
type HouseEdge {
node: House
cursor: String!
}
interface Node {
id: ID!
}
type PageInfo {
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}
type PowerDatum implements Node {
id: ID!
power: Float
time: Int
}
type PowerDatumConnection {
pageInfo: PageInfo!
edges: [PowerDatumEdge]
}
type PowerDatumEdge {
node: PowerDatum
cursor: String!
}
type Query {
node(id: ID!): Node
viewer: User
}
type User implements Node {
id: ID!
username: String!
house: HouseConnection
}
type UserConnection {
pageInfo: PageInfo!
edges: [UserEdge]
}
type UserEdge {
node: User
cursor: String!
}