-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.graphql
67 lines (63 loc) · 1.43 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
schema @site(type: "wordle/prod3") {
query: Query
mutation: Mutation
}
type Query {
allGames: [GameState]
allUsers: [String]
@site(
a: "username"
q: {
edn: """
{:find [e] :where [[e {{type}} "GameState"]]}
"""
}
)
timeTakenForGame(id: ID!): Int
@site(resolver: "juxt.site.wordle.resolvers/resolve-game-time")
gameForId(id: ID!): GameState
gameHistoryForId(id: ID!): [GameState] @site(history: "asc")
todaysGames(date: String!): [GameState]
@site(
q: {
edn: """
{:find [e]
:where [[e {{type}} "GameState"]
[e :date "{{args.date}}"]]}
"""
}
)
playersGames(username: String!): [GameState]
@site(
q: {
edn: """
{:find [e]
:where [[e {{type}} "GameState"]
[e :username "{{args.username}}"]]}
"""
}
)
}
type Mutation {
saveGame(id: ID!, game: GameInput!): GameState @site(mutation: "update")
}
input GameInput {
username: String!
guesses: [String!]!
timeTakenMillis: Int
date: String!
solution: String!
}
type GameState {
id: ID!
_siteQuery: String!
_siteValidTime: String!
date: String!
finished: Boolean!
@site(resolver: "juxt.site.wordle.resolvers/resolve-finished")
username: String!
guesses: [String!]
solution: String!
timeTakenMillis: Int
@site(resolver: "juxt.site.wordle.resolvers/resolve-game-time")
}