Skip to content

Commit c8c6593

Browse files
Merge pull request #67 from danerwilliams/dev
beta release 0.4.0
2 parents 1958e42 + dd843ec commit c8c6593

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3279
-299
lines changed

backend/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.env
22
yack-beer-totals.json
3+
static/.well-known

backend/graphql/schemas.js

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ const RootQuery = new GraphQLObjectType({
7575
return Player.find({});
7676
}
7777
},
78+
playerWithUserId: {
79+
type: new GraphQLList(PlayerType),
80+
args: { id: { type: GraphQLID } },
81+
resolve(parent, args) {
82+
return Player.find({user_id: args.id});
83+
}
84+
},
7885

7986
/* Comment Queries */
8087
comment: {
@@ -104,7 +111,31 @@ const RootQuery = new GraphQLObjectType({
104111
resolve(parent, args){
105112
return Game.find( {} );
106113
}
107-
}
114+
},
115+
gamesByPlayerId: {
116+
type: new GraphQLList(GameType),
117+
args: { id: {type: GraphQLID }},
118+
resolve(parent, args) {
119+
return Game.find({
120+
$or: [
121+
{
122+
"winning_team_player_ids": {
123+
"$in": [
124+
args.id
125+
]
126+
}
127+
},
128+
{
129+
"losing_team_player_ids": {
130+
"$in": [
131+
args.id
132+
]
133+
}
134+
}
135+
]
136+
});
137+
}
138+
},
108139
}
109140
});
110141

0 commit comments

Comments
 (0)