-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
140 lines (120 loc) · 2.47 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
type Pick {
id: ID!
user: User!
league: FantasyLeague!
team: SportsTeam!
week: Int
isInvalidated: Boolean!
}
input SubmitPickRequest {
userID: ID!
leagueID: ID!
teamIDs: [ID!]
week: Int!
}
type SubmitPickResponse {
pick: [Pick!]
errors: [Error!]
}
type User {
id: ID!
email: String!
displayName(leagueID: ID!): String
fantasyLeagues: [FantasyLeague!]
}
input CreateUserRequest {
email: String!
}
type CreateUserResponse {
user: User
errors: [Error!]
}
input AddUserToFantasyLeagueRequest {
userID: ID!
leagueID: ID!
}
type AddUserToFantasyLeagueResponse {
league: FantasyLeague
errors: [Error!]
}
type FantasyLeague {
id: ID!
name: String!
owner: User!
users: [User!]
picks: [Pick!]
gameMode: GameMode!
currentWeek: Int!
revealedWeek: Int!
season: String!
}
input CreateFantasyLeagueRequest {
name: String!
ownerID: ID!
gameMode: GameMode!
}
type CreateFantasyLeagueResponse {
league: FantasyLeague
errors: [Error!]
}
type SportsTeam {
id: ID!
name: String!
shortName: String!
sportsLeague: SportsLeague!
}
type SportsGame {
id: ID!
sportsLeague: SportsLeague!
startsAt: String!
awayTeam: SportsTeam!
homeTeam: SportsTeam!
season: String!
week: Int!
result: SportsGameResult
}
type SportsGameResult {
complete: Boolean!
awayTeamScore: Int
homeTeamScore: Int
}
input CreateSportsGameRequest {
league: SportsLeague
awayTeamShortName: String!
homeTeamShortName: String!
scheduledStart: String
season: String
round: Int
}
type CreateSportsGameResponse {
sportsGame: SportsGame
errors: [Error!]
}
type Query {
user(email: String!): User
league(leagueID: ID!): FantasyLeague
leagues(userID: String): [FantasyLeague!]
currentPick(leagueID: ID!, userID: ID!): [Pick!]
sportsTeams(league: SportsLeague): [SportsTeam!]
sportsGames(league: SportsLeague, season: String, week: Int): [SportsGame!]
currentSeason(league: SportsLeague): String
}
type Mutation {
#createUser(request: CreateUserRequest!): CreateUserResponse
#createFantasyLeague(request: CreateFantasyLeagueRequest!): CreateFantasyLeagueResponse
#addUserToFantasyLeague(request: AddUserToFantasyLeagueRequest!): AddUserToFantasyLeagueResponse
submitPick(request: SubmitPickRequest!): SubmitPickResponse
#createSportsGame(request: CreateSportsGameRequest!): CreateSportsGameResponse
}
type Error {
code: String!
message: String
}
enum SportsLeague {
NFL
}
enum GameMode {
PICK_TWO
STREAKIN
SURVIVOR
}