Modeling optional filter params in react-apollo
问题 I am using react-apollo to access a graphql in a web app. I have a query that looks like this that allows me to filter a schedule of games: query($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 } The startDate and endDate