public GraphqlQuery(Respository respository) { Name = "Query"; Description = "...."; Field <ListGraphType <AccountType> >( "Account", resolve: context => respository.GetAccountDetails() ); Field <ListGraphType <BranchType> >( "Branch", resolve: context => respository.GetBranchDetails() ); }
public GraphqlMutation(Respository respository) { Name = "Mutaiton"; Description = "Mutaitons are used to perform the Create Update and Delete operations."; Field <AccountType>( "CreateAccount", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <AccountInputType> > { Name = "Account" } ), resolve: context => { var account = context.GetArgument <Account>("Account"); return(respository.AddNewAccount(account)); }); }