public Task <Player> CreatePlayer(Player player) { var query = @" mutation {{ createPlayer(data: {{ firstName: \""{0}\"", lastName: \""{1}\"", teamLogoUrl: \""{2}\"", score: {3} }}) {{ id }} }} "; var withParams = string.Format( query, player.FirstName, player.LastName, player.TeamLogoUrl, player.Score); return(graphHelper.ExecuteMutation <Player>(withParams, "createPlayer")); }
public Task <Match> CreateMatch(CreateMatchModel match) { var query = @" mutation {{ createMatch(data: {{ player1Id: \""{0}\"", player2Id: \""{1}\"", score1: {2}, score2: {3} }}) {{ id }} }} "; var withParams = string.Format( query, match.Player1Id, match.Player2Id, match.Score1, match.Score2); return(graphHelper.ExecuteMutation <Match>(withParams, "createMatch")); }