Esempio n. 1
0
        public RootMutation(InMemoryRepository repository)
        {
            Field <BrandType>("createBrand",
                              arguments: new QueryArguments(
                                  new QueryArgument <NonNullGraphType <BrandInputType> > {
                Name = "brand"
            }
                                  ),
                              resolve: context =>
            {
                var brandInput = context.GetArgument <BrandInputType>("brand");

                var brand = new Brand(Guid.NewGuid(), brandInput.Name);

                return(repository.AddBrand(brand));
            });
        }