protected override void Configure(
     IObjectTypeDescriptor descriptor)
 {
     descriptor.Name("Query");
     descriptor.Field("foo").Type <StringType>().Resolver("bar");
 }
Exemplo n.º 2
0
        protected override void Configure(IObjectTypeDescriptor <PreparedProduct> descriptor)
        {
            base.Configure(descriptor);

            descriptor.Name("PreparedProduct");

            descriptor
            .ImplementsNode()
            .IdField(c => c.Id)
            .ResolveNode((ctx, id) =>
                         ctx.DataLoader <PreparedProductsByIdBatchDataLoader>().LoadAsync(id, ctx.RequestAborted));

            descriptor
            .Field(c => c.ProductId)
            .ID(nameof(Product))
            .Name("productId");

            descriptor
            .Field(c => c.PreparedBy)
            .Name("preparedBy");

            descriptor
            .Field(c => c.PreparedOn)
            .Name("preparedOn");

            descriptor
            .Field("completed")
            .Resolve(ctx => ctx.Parent <PreparedProduct>().PreparedOn.HasValue);

            descriptor
            .Field(c => c.Quantity)
            .Name("quantity");

            descriptor
            .Field(c => c.Conditioning)
            .Name("conditioning");

            descriptor
            .Field(c => c.QuantityPerUnit)
            .Name("quantityPerUnit");

            descriptor
            .Field(c => c.Unit)
            .Name("unit");

            descriptor
            .Field(c => c.Vat)
            .Name("vat");

            descriptor
            .Field(c => c.TotalWeight)
            .Name("totalWeight");

            descriptor
            .Field(c => c.UnitOnSalePrice)
            .Name("unitOnSalePrice");

            descriptor
            .Field(c => c.UnitVatPrice)
            .Name("unitVatPrice");

            descriptor
            .Field(c => c.UnitWholeSalePrice)
            .Name("unitWholeSalePrice");

            descriptor
            .Field(c => c.UnitVatPrice)
            .Name("unitVatPrice");

            descriptor
            .Field(c => c.UnitWeight)
            .Name("unitWeight");

            descriptor
            .Field(c => c.TotalWholeSalePrice)
            .Name("totalWholeSalePrice");

            descriptor
            .Field(c => c.TotalVatPrice)
            .Name("totalVatPrice");

            descriptor
            .Field(c => c.TotalOnSalePrice)
            .Name("totalOnSalePrice");

            descriptor
            .Field(c => c.ReturnableWholeSalePrice)
            .Name("returnableWholeSalePrice");

            descriptor
            .Field(c => c.ReturnableOnSalePrice)
            .Name("returnableOnSalePrice");

            descriptor
            .Field(c => c.ReturnableVatPrice)
            .Name("returnableVatPrice");

            descriptor
            .Field(c => c.ReturnableName)
            .Name("returnableName");

            descriptor
            .Field(c => c.ReturnableVat)
            .Name("returnableVat");

            descriptor
            .Field(c => c.TotalReturnableWholeSalePrice)
            .Name("totalReturnableWholeSalePrice");

            descriptor
            .Field(c => c.TotalReturnableVatPrice)
            .Name("totalReturnableVatPrice");

            descriptor
            .Field(c => c.TotalReturnableOnSalePrice)
            .Name("totalReturnableOnSalePrice");

            descriptor
            .Field(c => c.TotalProductWholeSalePrice)
            .Name("totalProductWholeSalePrice");

            descriptor
            .Field(c => c.TotalProductVatPrice)
            .Name("totalProductVatPrice");

            descriptor
            .Field(c => c.TotalProductOnSalePrice)
            .Name("totalProductOnSalePrice");

            descriptor
            .Field(c => c.HasReturnable)
            .Name("isReturnable");

            descriptor
            .Field(c => c.Name)
            .Name("name")
            .Type <NonNullType <StringType> >();

            descriptor
            .Field(c => c.Reference)
            .Name("reference")
            .Type <NonNullType <StringType> >();

            descriptor
            .Field(c => c.ReturnableId)
            .ID(nameof(Returnable))
            .Name("returnableId");

            descriptor
            .Field(c => c.PurchaseOrderId)
            .ID(nameof(PurchaseOrder))
            .Name("purchaseOrderId");

            descriptor
            .Field("purchaseOrder")
            .ResolveWith <PreparedProductResolvers>(c => c.GetPurchaseOrder(default, default, default))
 protected override void Configure(
     IObjectTypeDescriptor descriptor)
 {
     descriptor.Name("Query");
     descriptor.Field("description").Resolve("bar");
 }
Exemplo n.º 4
0
 protected override void Configure(IObjectTypeDescriptor descriptor)
 {
     descriptor.Name("subscription");
     descriptor.Field("foo").Resolver(() => "bar");
 }
 protected override void Configure(IObjectTypeDescriptor <Foo> descriptor)
 {
     descriptor.Name("Renamed");
     descriptor.Field(x => x.Bar).Name("renamed");
 }
Exemplo n.º 6
0
        protected override void Configure(IObjectTypeDescriptor descriptor)
        {
            base.Configure(descriptor);
            descriptor.Name("Query");

            foreach (var q in queryDiscovery.GetQueries())
            {
                if (q.Category == "DynamicQuery" && q is DynamicQueryMeta dq)
                {
                    var f = descriptor.Field(q.LowerCamelCaseName);

                    // service to execute with.
                    var queryHandlerServiceType = typeof(IQueryHandler <,>).MakeGenericType(dq.QueryType, dq.QueryResultType);

                    // destermine argument type.
                    Type argumentType;
                    Type runnerType;
                    if (dq.ParamsType != null)
                    {
                        argumentType = typeof(GraphQL.DynamicQuery.GraphQLDynamicQuery <, ,>).MakeGenericType(
                            dq.SourceType, dq.DestinationType, dq.ParamsType);

                        runnerType = typeof(DynamicQueryRunnerWithParams <, ,>)
                                     .MakeGenericType(dq.SourceType, dq.DestinationType, dq.ParamsType);
                    }
                    else
                    {
                        argumentType = typeof(GraphQL.DynamicQuery.GraphQLDynamicQuery <,>).MakeGenericType(
                            dq.SourceType, dq.DestinationType);

                        runnerType = typeof(DynamicQueryRunner <,>)
                                     .MakeGenericType(dq.SourceType, dq.DestinationType);
                    }

                    f.Argument("params", a => a
                               .Type(argumentType)
                               .DefaultValue(Activator.CreateInstance(argumentType))
                               );

                    // make generic type of outgoing type.
                    var resultType = typeof(GraphQL.DynamicQuery.GraphQLDynamicQueryExecutionResult <>)
                                     .MakeGenericType(dq.DestinationType);

                    f.Type(resultType);

                    // security middleware
                    f.Use((sp, d) => new QueryAuthorizationMiddleware(q.QueryType, d));

                    // middleware to validate.
                    f.Use <QueryValidationMiddleware>();

                    // resolver
                    f.Resolve(async r =>
                    {
                        dynamic argument = r.ArgumentValue <object>("params");

                        // handler service.
                        var service = r.Service(queryHandlerServiceType);

                        // runner.
                        dynamic runner = Activator.CreateInstance(runnerType, new object[] { service });

                        // get outcome.
                        object outcome = await runner.RunAsync(argument, r.RequestAborted);

                        return(outcome);
                    });
                }
            }
        }
Exemplo n.º 7
0
 protected override void Configure(IObjectTypeDescriptor <HelloQuery> descriptor)
 {
     descriptor.Name("Query");
     descriptor.Field(query => query.SayHello(default))
Exemplo n.º 8
0
        protected override void Configure(IObjectTypeDescriptor <ISeedRootContext> descriptor)
        {
            descriptor.Name("SeedRootContext")
            .Description("The context root of a scraping seed tree");

            descriptor.Field(s => s.Root)
            .Description("The root seed")
            .Type <SeedType>();

            descriptor.Field("descendants")
            .Description("The unculled descendants of a given seed. " +
                         "If the seed does not exist, returns the empty array. " +
                         "If no seed is given, returns the descendants of the root.")
            .Argument("seedId", arg => arg.Type <UuidType>())
            .Resolver(ctx =>
            {
                var seedRootContext = ctx.Parent <ISeedRootContext>();
                Guid seedGuid       = ctx.Argument <Guid>("seedId");
                if (seedGuid == default)
                {
                    seedGuid = seedRootContext.Root.Guid;
                }

                var seed = seedRootContext[seedGuid];
                return(seedRootContext.GetDescendants(seed));
            })
            .Type <NonNullType <ListType <NonNullType <SeedType> > > >();

            descriptor.Field("siblings")
            .Description("The unculled siblings of a given seed. If the seed does not exist, returns the empty array.")
            .Argument("seedId", arg => arg.Type <UuidType>())
            .Resolver(ctx =>
            {
                var seedRootContext = ctx.Parent <ISeedRootContext>();
                Guid seedGuid       = ctx.Argument <Guid>("seedId");
                if (seedGuid == default)
                {
                    seedGuid = seedRootContext.Root.Guid;
                }

                var seed = seedRootContext[seedGuid];
                return(seedRootContext.GetSiblings(seed));
            })
            .Type <NonNullType <ListType <NonNullType <SeedType> > > >();

            descriptor.Field("children")
            .Description("The direct children of a given seed. If the seed does not exist, returns an empty array.")
            .Argument("seedId", arg => arg.Type <UuidType>())
            .Resolver(ctx =>
            {
                var seedRootContext = ctx.Parent <ISeedRootContext>();
                Guid seedGuid       = ctx.Argument <Guid>("seedId");
                if (seedGuid == default)
                {
                    seedGuid = seedRootContext.Root.Guid;
                }

                var seed = seedRootContext[seedGuid];
                return(seedRootContext.GetChildren(seed));
            })
            .Type <NonNullType <ListType <NonNullType <SeedType> > > >();

            descriptor.Field("allSeeds")
            .Description("All seeds, whether culled or unculled in the tree.")
            .Resolver(ctx =>
            {
                var seedRootContext = ctx.Parent <ISeedRootContext>();
                return(seedRootContext.GetAll());
            })
            .Type <NonNullType <ListType <SeedType> > >();
        }
Exemplo n.º 9
0
        protected override void Configure(IObjectTypeDescriptor <Delivery> descriptor)
        {
            base.Configure(descriptor);

            descriptor.Name("Delivery");

            descriptor
            .ImplementsNode()
            .IdField(c => c.Id)
            .ResolveNode((ctx, id) =>
                         ctx.DataLoader <DeliveriesByIdBatchDataLoader>().LoadAsync(id, ctx.RequestAborted));

            descriptor
            .Field(c => c.ScheduledOn)
            .Name("scheduledOn");

            descriptor
            .Field(c => c.DeliveredOn)
            .Name("deliveredOn");

            descriptor
            .Field(c => c.BilledOn)
            .Name("billedOn");

            descriptor
            .Field(c => c.Status)
            .Name("status");

            descriptor
            .Field(c => c.Kind)
            .Name("kind");

            descriptor
            .Field("reference")
            .Resolve((ctx, token) => ctx.Parent <Delivery>().Reference.AsDeliveryIdentifier());

            descriptor
            .Field(c => c.Address)
            .Name("address");

            descriptor
            .Field(c => c.Position)
            .Name("position");

            descriptor
            .Field(c => c.ReceptionedBy)
            .Name("receptionedBy");

            descriptor
            .Field(c => c.Comment)
            .Name("comment");

            descriptor
            .Field(c => c.PurchaseOrdersCount)
            .Name("purchaseOrdersCount");

            descriptor
            .Field(c => c.ReturnablesCount)
            .Name("returnablesCount");

            descriptor
            .Field(c => c.DeliveryFormUrl)
            .Name("deliveryFormUrl");

            descriptor
            .Field(c => c.DeliveryReceiptUrl)
            .Name("deliveryReceiptUrl");

            descriptor
            .Field(c => c.DeliveryFeesWholeSalePrice)
            .Name("deliveryFeesWholeSalePrice");

            descriptor
            .Field(c => c.DeliveryFeesVatPrice)
            .Name("deliveryFeesVatPrice");

            descriptor
            .Field(c => c.DeliveryFeesOnSalePrice)
            .Name("deliveryFeesOnSalePrice");

            descriptor
            .Field(c => c.ProductsToDeliverCount)
            .Name("productsToDeliverCount");

            descriptor
            .Field(c => c.ProductsDeliveredCount)
            .Name("productsDeliveredCount");

            descriptor
            .Field(c => c.BrokenProductsCount)
            .Name("brokenProductsCount");

            descriptor
            .Field(c => c.MissingProductsCount)
            .Name("missingProductsCount");

            descriptor
            .Field(c => c.ImproperProductsCount)
            .Name("improperProductsCount");

            descriptor
            .Field(c => c.ExcessProductsCount)
            .Name("excessProductsCount");

            descriptor
            .Field(c => c.ReturnedReturnablesCount)
            .Name("returnedReturnablesCount");

            descriptor
            .Field("purchaseOrders")
            .UseDbContext <QueryDbContext>()
            .ResolveWith <DeliveryResolvers>(c => c.GetPurchaseOrders(default, default, default, default))
Exemplo n.º 10
0
        protected override void Configure(IObjectTypeDescriptor <MailGroupMailMutation> descriptor)
        {
            descriptor.Name("Mutation");

            descriptor.Field(x => x.AddMailToMailGroup(default, default))
 protected override void Configure(IObjectTypeDescriptor <Concrete> descriptor)
 {
     descriptor.Name("ConcreteType");
     descriptor.Implements <BaseType>();
 }
 protected override void Configure(IObjectTypeDescriptor <AddOrUpdateProductInventoryResponse> descriptor)
 {
     descriptor.Name($"{nameof(ServiceOptions.InventoriesApi)}_{nameof(AddOrUpdateProductInventoryResponse)}");
 }
Exemplo n.º 13
0
        protected override void Configure(IObjectTypeDescriptor <UserMutation> descriptor)
        {
            descriptor.Name("Mutation");

            descriptor.Field(x => x.SignUp(default, default, default, default)).Name("userSignUp");
 protected override void Configure(
     IObjectTypeDescriptor descriptor)
 {
     descriptor.Name("Subscription");
     descriptor.Field("onFoo").Type <IntType>().Resolver(123);
 }
Exemplo n.º 15
0
        protected override void Configure(IObjectTypeDescriptor <Producer> descriptor)
        {
            base.Configure(descriptor);

            descriptor.Name("ProducerProfile");

            descriptor
            .Field(c => c.Id)
            .Name("id")
            .ID(nameof(Producer));

            descriptor
            .Field(c => c.Picture)
            .Name("picture");

            descriptor
            .Field(c => c.NotSubjectToVat)
            .Name("notSubjectToVat");

            descriptor
            .Field(c => c.CreatedOn)
            .Name("createdOn");

            descriptor
            .Field(c => c.UpdatedOn)
            .Name("updatedOn");

            descriptor
            .Field(c => c.Phone)
            .Name("phone");

            descriptor
            .Field(c => c.Email)
            .Name("email")
            .Type <NonNullType <StringType> >();

            descriptor
            .Field(c => c.FirstName)
            .Name("firstName")
            .Type <NonNullType <StringType> >();

            descriptor
            .Field(c => c.LastName)
            .Name("lastName")
            .Type <NonNullType <StringType> >();

            descriptor
            .Field(c => c.Name)
            .Name("name")
            .Type <NonNullType <StringType> >();

            descriptor
            .Field(c => c.Summary)
            .Name("summary");

            descriptor
            .Field(c => c.Description)
            .Name("description");

            descriptor
            .Field(c => c.Facebook)
            .Name("facebook");

            descriptor
            .Field(c => c.Twitter)
            .Name("twitter");

            descriptor
            .Field(c => c.Instagram)
            .Name("instagram");

            descriptor
            .Field(c => c.Website)
            .Name("website");

            descriptor
            .Field(c => c.OpenForNewBusiness)
            .Name("openForNewBusiness");

            descriptor
            .Field(c => c.Address)
            .Name("address")
            .Type <NonNullType <UserAddressType> >();

            descriptor
            .Field(c => c.Legal)
            .Name("legals")
            .UseDbContext <QueryDbContext>()
            .ResolveWith <ProducerProfileResolvers>(c => c.GetLegals(default !, default !, default !, default))
 protected override void Configure(IObjectTypeDescriptor descriptor)
 {
     descriptor.Name(UserGraphType.GraphName);
     descriptor.Field <UserGqlOut>(t => t.RelationToMe);
 }
Exemplo n.º 17
0
        protected override void Configure(IObjectTypeDescriptor descriptor)
        {
            descriptor.Name("Arguments");

            // multipleReqs(x: Int!, y: Int!): Int!
            descriptor.Field("multipleReqs")
            .Argument("x", t => t.Type <NonNullType <IntType> >())
            .Argument("y", t => t.Type <NonNullType <IntType> >())
            .Type <NonNullType <IntType> >()
            .Resolver(() => null);

            //  booleanArgField(booleanArg: Boolean) : Boolean
            descriptor.Field("booleanArgField")
            .Argument("booleanArg", t => t.Type <BooleanType>())
            .Type <BooleanType>()
            .Resolver(() => null);

            // floatArgField(floatArg: Float): Float
            descriptor.Field("floatArgField")
            .Argument("floatArg", t => t.Type <FloatType>())
            .Type <FloatType>()
            .Resolver(() => null);

            // intArgField(intArg: Int): Int
            descriptor.Field("intArgField")
            .Argument("intArg", t => t.Type <IntType>())
            .Type <NonNullType <IntType> >()
            .Resolver(() => null);

            // nonNullBooleanArgField(nonNullBooleanArg: Boolean!): Boolean!
            descriptor.Field("nonNullBooleanArgField")
            .Argument("nonNullBooleanArg",
                      t => t.Type <NonNullType <BooleanType> >())
            .Type <NonNullType <BooleanType> >()
            .Resolver(() => null);

            // booleanListArgField(booleanListArg: [Boolean]!) : [Boolean]
            descriptor.Field("booleanListArgField")
            .Argument("booleanListArg",
                      t => t.Type <NonNullType <ListType <BooleanType> > >())
            .Type <ListType <BooleanType> >()
            .Resolver(() => null);

            // nonNullBooleanListArgField(booleanListArg: [Boolean!]!) : [Boolean]
            descriptor.Field("nonNullBooleanListArgField")
            .Argument("booleanListArg",
                      t => t.Type <NonNullType <ListType <NonNullType <BooleanType> > > >())
            .Type <ListType <BooleanType> >()
            .Resolver(() => null);

            // optionalNonNullBooleanArgField(optionalBooleanArg: Boolean! = false) : Boolean!
            descriptor.Field("optionalNonNullBooleanArgField")
            .Argument("optionalBooleanArg",
                      t => t.Type <NonNullType <BooleanType> >().DefaultValue(false))
            .Argument("y", t => t.Type <NonNullType <IntType> >())
            .Type <NonNullType <BooleanType> >()
            .Resolver(() => null);

            // booleanListArgField(booleanListArg: [Boolean]!) : [Boolean]
            descriptor.Field("nonNullBooleanListField")
            .Argument("nonNullBooleanListArg",
                      t => t.Type <NonNullType <ListType <BooleanType> > >())
            .Type <ListType <BooleanType> >()
            .Resolver(() => null);
        }
        protected override void Configure(IObjectTypeDescriptor <AuthorizationQuery> descriptor)
        {
            descriptor.Name("Query");

            descriptor.Field(q => q.GetAuthorizationById(default !, default !))
 protected override void Configure(IObjectTypeDescriptor <ProductDto> descriptor)
 {
     descriptor.Name($"{nameof(ServiceOptions.ProductCatalogApi)}_{nameof(ProductDto)}");
 }
Exemplo n.º 20
0
 protected override void Configure(IObjectTypeDescriptor <T> descriptor)
 {
     descriptor.Name("Mutation");
 }
Exemplo n.º 21
0
        protected override void Configure(IObjectTypeDescriptor <Producer> descriptor)
        {
            base.Configure(descriptor);

            descriptor.Name("Producer");

            descriptor
            .ImplementsNode()
            .IdField(c => c.Id)
            .ResolveNode((ctx, id) =>
                         ctx.DataLoader <ProducersByIdBatchDataLoader>().LoadAsync(id, ctx.RequestAborted));

            descriptor
            .Field(c => c.Picture)
            .Name("picture");

            descriptor
            .Field(c => c.NotSubjectToVat)
            .Name("notSubjectToVat");

            descriptor
            .Field(c => c.CreatedOn)
            .Name("createdOn");

            descriptor
            .Field(c => c.UpdatedOn)
            .Name("updatedOn");

            descriptor
            .Field(c => c.Phone)
            .Name("phone")
            .Authorize(Policies.REGISTERED);

            descriptor
            .Field(c => c.Email)
            .Name("email")
            .Authorize(Policies.REGISTERED)
            .Type <NonNullType <StringType> >();

            descriptor
            .Field(c => c.FirstName)
            .Name("firstName")
            .Type <NonNullType <StringType> >();

            descriptor
            .Field(c => c.LastName)
            .Name("lastName")
            .Type <NonNullType <StringType> >();

            descriptor
            .Field(c => c.Name)
            .Name("name")
            .Type <NonNullType <StringType> >();

            descriptor
            .Field(c => c.Summary)
            .Name("summary");

            descriptor
            .Field(c => c.Description)
            .Name("description");

            descriptor
            .Field(c => c.Facebook)
            .Name("facebook");

            descriptor
            .Field(c => c.Twitter)
            .Name("twitter");

            descriptor
            .Field(c => c.Instagram)
            .Name("instagram");

            descriptor
            .Field(c => c.Website)
            .Name("website");

            descriptor
            .Field(c => c.OpenForNewBusiness)
            .Name("openForNewBusiness");

            descriptor
            .Field(c => c.ClosingsCount)
            .Name("closingsCount");

            descriptor
            .Field(c => c.TagsCount)
            .Name("tagsCount");

            descriptor
            .Field(c => c.PicturesCount)
            .Name("picturesCount");

            descriptor
            .Field("productsCount")
            .ResolveWith <ProducerResolvers>(c => c.GetProductsCount(default !, default !, default, default, default));
Exemplo n.º 22
0
 protected override void Configure(IObjectTypeDescriptor descriptor)
 {
     descriptor.Name("Query");
     descriptor.Field("s")
     .Resolver(ctx => new Foo());
 }
Exemplo n.º 23
0
 protected override void Configure(IObjectTypeDescriptor <Error> descriptor)
 {
     descriptor.Name("Error");
     descriptor.Field(x => x.ErrorMessage).Type <NonNullType <StringType> >().Description("Error message.");
     descriptor.IsOfType((context, result) => result is Error);
 }
Exemplo n.º 24
0
 protected override void Configure(IObjectTypeDescriptor descriptor)
 {
     descriptor.Name("Query");
     descriptor.Field("customProperty")
     .Resolver(ctx => "foo");
 }
Exemplo n.º 25
0
 protected override void Configure(
     IObjectTypeDescriptor <Query> descriptor)
 {
     descriptor.Name("Query");
     descriptor.Field(t => t.TestProp).Name("test");
 }
Exemplo n.º 26
0
 protected override void Configure(IObjectTypeDescriptor <TMutation> descriptor)
 {
     descriptor.Name(MutationComponent.MutationTypeName);
 }
Exemplo n.º 27
0
        protected override void Configure(IObjectTypeDescriptor <Picking> descriptor)
        {
            base.Configure(descriptor);

            descriptor.Name("Picking");

            descriptor
            .ImplementsNode()
            .IdField(c => c.Id)
            .ResolveNode((ctx, id) =>
                         ctx.DataLoader <PickingsByIdBatchDataLoader>().LoadAsync(id, ctx.RequestAborted));

            descriptor
            .Field(c => c.Status)
            .Name("status");

            descriptor
            .Field(c => c.Name)
            .Name("name");

            descriptor
            .Field(c => c.Producer)
            .Name("producer");

            descriptor
            .Field(c => c.ProducerId)
            .ID(nameof(User))
            .Name("producerId");

            descriptor
            .Field(c => c.PurchaseOrdersCount)
            .Name("purchaseOrdersCount");

            descriptor
            .Field(c => c.PickingFormUrl)
            .Name("preparationUrl");

            descriptor
            .Field(c => c.PreparedProductsCount)
            .Name("productsPreparedCount");

            descriptor
            .Field(c => c.ProductsToPrepareCount)
            .Name("productsToPrepareCount");

            descriptor
            .Field(c => c.CompletedOn)
            .Name("completedOn");

            descriptor
            .Field(c => c.StartedOn)
            .Name("startedOn");

            descriptor
            .Field(c => c.CreatedOn)
            .Name("createdOn");

            descriptor
            .Field(c => c.UpdatedOn)
            .Name("updatedOn");

            descriptor
            .Field("purchaseOrders")
            .UseDbContext <QueryDbContext>()
            .ResolveWith <PickingResolvers>(c => c.GetPurchaseOrders(default, default, default, default))
Exemplo n.º 28
0
 protected override void Configure(IObjectTypeDescriptor descriptor)
 {
     descriptor.Name("Query");
     descriptor.Field("a").Type <SomeEnumType>().Resolver("DEF");
     descriptor.Field("b").Type <StringType>().Resolver("StringResolver");
 }
Exemplo n.º 29
0
 protected override void Configure(IObjectTypeDescriptor descriptor)
 {
     descriptor.Name(_typeName);
     descriptor.Field("bar").Resolver("baz");
 }
Exemplo n.º 30
0
        protected override void Configure(IObjectTypeDescriptor <DeliveryMode> descriptor)
        {
            base.Configure(descriptor);

            descriptor.Name("DeliveryMode");

            descriptor
            .ImplementsNode()
            .IdField(c => c.Id)
            .ResolveNode((ctx, id) =>
                         ctx.DataLoader <DeliveryModesByIdBatchDataLoader>().LoadAsync(id, ctx.RequestAborted));

            descriptor
            .Field(c => c.CreatedOn)
            .Name("createdOn");

            descriptor
            .Field(c => c.UpdatedOn)
            .Name("updatedOn");

            descriptor
            .Field(c => c.LockOrderHoursBeforeDelivery)
            .Name("lockOrderHoursBeforeDelivery");

            descriptor
            .Field(c => c.Kind)
            .Name("kind");

            descriptor
            .Field(c => c.Name)
            .Name("name");

            descriptor
            .Field(c => c.MaxPurchaseOrdersPerTimeSlot)
            .Name("maxPurchaseOrdersPerTimeSlot");

            descriptor
            .Field(c => c.Available)
            .Name("available");

            descriptor
            .Field(c => c.AutoAcceptRelatedPurchaseOrder)
            .Name("autoAcceptRelatedPurchaseOrder");

            descriptor
            .Field(c => c.AutoCompleteRelatedPurchaseOrder)
            .Name("autoCompleteRelatedPurchaseOrder");

            descriptor
            .Field(c => c.Description)
            .Name("description");

            descriptor
            .Field(c => c.DeliveryFeesWholeSalePrice)
            .Name("deliveryFeesWholeSalePrice");

            descriptor
            .Field(c => c.DeliveryFeesVatPrice)
            .Name("deliveryFeesVatPrice");

            descriptor
            .Field(c => c.DeliveryFeesOnSalePrice)
            .Name("deliveryFeesOnSalePrice");

            descriptor
            .Field(c => c.DeliveryFeesMinPurchaseOrdersAmount)
            .Name("deliveryFeesMinPurchaseOrdersAmount");

            descriptor
            .Field(c => c.ApplyDeliveryFeesWhen)
            .Name("applyDeliveryFeesWhen");

            descriptor
            .Field(c => c.AcceptPurchaseOrdersWithAmountGreaterThan)
            .Name("acceptPurchaseOrdersWithAmountGreaterThan");

            descriptor
            .Field(c => c.DeliveryHoursCount)
            .Name("deliveryHoursCount");

            descriptor
            .Field(c => c.ClosingsCount)
            .Name("closingsCount");

            descriptor
            .Field(c => c.Address)
            .Name("address")
            .Type <DeliveryAddressType>();

            descriptor
            .Field(c => c.Producer)
            .Name("producer")
            .UseDbContext <QueryDbContext>()
            .ResolveWith <DeliveryResolvers>(c => c.GetProducer(default, default, default))