public void ResolveMutation(GraphQlMutation graphQlMutation) { // SUGGEST CHANNEL graphQlMutation.FieldAsync <BooleanGraphType>( "suggestChannel", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <StringGraphType> > { Name = "channelId" } ), resolve: async(context) => { try { // read user context dictionary var userContext = (GraphQlUserContext)context.UserContext; var userId = userContext.GetUserId(); // require user to be authenticated if (userId == null) { return(false); } await _suggestionRepository.AddSuggestion( context.GetArgument <string>("channelId"), userId ); return(true); } catch { return(false); } }); }