Example #1
0
        private object AddDroid(ResolveFieldContext <object> context)
        {
            var droid    = context.GetArgument <Droid>("droid");
            var droidOut = _droidRepository.Add(droid);

            return(droidOut);
        }
Example #2
0
 public DroidMutation(IDataLoaderContextAccessor accessor, IDroidRepository droids)
 {
     Field <IntGraphType>(
         "addDroid",
         arguments: new QueryArguments(
             new QueryArgument <NonNullGraphType <DroidInputType> > {
         Name = "droid"
     }
             ),
         resolve: context =>
         droids.Add(context.GetArgument <Droid>("droid"))
         );
 }
 public Droid AddDroid(Droid droid)
 {
     return(_droidRepository.Add(droid));
 }