pcooney10
09/23/2017, 4:44 PMpcooney10
09/23/2017, 4:47 PMquery($pagination:Int!, $divisionId:ID, $teamId:ID, $startDate:DateTime!, $endDate:DateTime!
){
games: allGames (
orderBy: date_ASC,
first: $pagination,
filter: {
date_gte: $startDate,
date_lte: $endDate,
division: {id: $divisionId},
OR: [
{homeTeam: {id: $teamId} },
{awayTeam: {id: $teamId} },
]
}
){
id
.... more fields
}pcooney10
09/23/2017, 4:51 PMpcooney10
09/23/2017, 4:55 PMdivisionId or teamId is null, I would like the query to return all potential values for that field. I get somewhat similar functionality on mutations (since null is a valid parameter for omitted fields, I can write 1 mutation that will work in multiple scenarios), but am not sure how to achieve that queriespcooney10
09/23/2017, 4:56 PMdivisionId or teamId?pcooney10
09/23/2017, 4:58 PMdivision and id to division_in and id_in and pass them (somewhat large) arrays with all the possible values for for divisionIds and teamIds as initial props?nilan
09/23/2017, 8:35 PMpcooney10
09/23/2017, 11:55 PMsomeField_in approach as I’d already had the arrays mapped out in the presentational dropdown in the app, but the Filter Object seems like a much better approach!nilan
09/24/2017, 9:01 AM