protected override void Configure(IObjectTypeDescriptor <User> descriptor)
 {
     descriptor
     .ImplementsNode()
     .IdField(f => f.Id)
     .ResolveNode(ResolveNode);
 }
        protected override void Configure(IObjectTypeDescriptor <Farm> descriptor)
        {
            descriptor
            .ImplementsNode()
            .IdField(x => x.Id)
            .ResolveNode((context, id) =>
                         context.DataLoader <FarmByIdDataLoader>()
                         .LoadAsync(id, context.RequestAborted));

            descriptor
            .Field(x => x.Name)
            .Description("The name of the Farm.");


            descriptor
            .Field(x => x.PersonId)
            .ID(nameof(Person))
            .Description("The id of the Farm's owner.");

            descriptor
            .Field(x => x.Person)
            .Description("Farm's owner.");

            descriptor
            .Field(x => x.Animals)
            .UsePaging <NonNullType <AnimalType> >()
            .ResolveWith <AnimalResolvers>(ar => ar.GetAnimalsByFarmIdsAsync(default !, default !, default))
Exemple #3
0
 protected override void Configure(IObjectTypeDescriptor <Speaker> descriptor)
 {
     descriptor
     .ImplementsNode()
     .IdField(t => t.Id)
     .ResolveNode((ctx, id) => ctx.DataLoader <SpeakerByIdDataLoader>().LoadAsync(id, ctx.RequestAborted));
 }
Exemple #4
0
        protected override void Configure(IObjectTypeDescriptor <Batch> descriptor)
        {
            base.Configure(descriptor);

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

            descriptor
            .Field(c => c.Number)
            .Name("number");

            descriptor
            .Field(c => c.DLC)
            .Name("dlc");

            descriptor
            .Field(c => c.DDM)
            .Name("ddm");

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

            descriptor
            .Field("observations")
            .UseDbContext <QueryDbContext>()
            .ResolveWith <BatchResolvers>(c =>
                                          c.GetObservations(default, default, default, default, default, default))
Exemple #5
0
        protected override void Configure(IObjectTypeDescriptor <PreAuthorization> descriptor)
        {
            base.Configure(descriptor);

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

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

            descriptor
            .Field(c => c.PaymentStatus)
            .Name("paymentStatus");

            descriptor
            .Field(c => c.SecureModeRedirectUrl)
            .Name("secureModeRedirectURL");

            descriptor
            .Field(c => c.SecureModeNeeded)
            .Name("secureModeNeeded");

            descriptor
            .Field(c => c.Order)
            .Name("order")
            .ResolveWith <PreAuthorizationResolvers>(c => c.GetOrder(default, default, default))
Exemple #6
0
        protected override void Configure(IObjectTypeDescriptor <Recall> descriptor)
        {
            base.Configure(descriptor);

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

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

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

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

            descriptor
            .Field(c => c.SaleStartedOn)
            .Name("saleStartedOn");

            descriptor
            .Field(c => c.SaleEndedOn)
            .Name("saleEndedOn");

            descriptor
            .Field(c => c.Producer)
            .Type <ProducerType>()
            .Name("producer")
            .ResolveWith <BatchObservationResolvers>(c => c.GetProducer(default, default, default));
Exemple #7
0
 protected override void Configure(
     IObjectTypeDescriptor <TEntity> descriptor
     )
 {
     descriptor
     .ImplementsNode()
     .IdField(t => t.Id)
     .ResolveNode((context, id) =>
                  context
                  .DataLoader <TEntityByIdDataLoader>()
                  .LoadAsync(id, context.RequestAborted) ! // Notice the null-forgiving operator `!`. It's bad that we need to use it here.
                  );
     descriptor
     .Field("uuid")
     .Type <NonNullType <UuidType> >()
     .Resolve(context =>
              context.Parent <TEntity>().Id
              );
     // TODO Do we want to expose this, require it as input, and use it to discover concurrent writes?
     descriptor
     .Field(t => t.xmin)
     .Type <NonNullType <NonNegativeIntType> >()
     .Name("version")
     .Ignore();
 }
Exemple #8
0
        protected override void Configure(IObjectTypeDescriptor <BusinessLegal> descriptor)
        {
            base.Configure(descriptor);

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

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

            descriptor
            .Field(c => c.Validation)
            .Name("validation");

            descriptor
            .Field(c => c.Email)
            .Name("email");

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

            descriptor
            .Field(c => c.BillingAddress)
            .Name("billing");

            descriptor
            .Field(c => c.Owner)
            .Name("owner");
        }
Exemple #9
0
        protected override void Configure(IObjectTypeDescriptor <BatchDefinition> descriptor)
        {
            base.Configure(descriptor);

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

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

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

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

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

            descriptor
            .Field(c => c.FieldDefinitions)
            .Type <ListType <BatchFieldType> >()
            .Name("fieldDefinitions");
        }
Exemple #10
0
        protected override void Configure(IObjectTypeDescriptor <Rating> descriptor)
        {
            base.Configure(descriptor);

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

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

            descriptor
            .Field(c => c.Value)
            .Name("value");

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

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

            descriptor
            .Field(c => c.User)
            .Name("user")
            .ResolveWith <RatingResolvers>(c => c.GetUser(default, default, default))
Exemple #11
0
        protected override void Configure(IObjectTypeDescriptor <Animal> descriptor)
        {
            descriptor
            .ImplementsNode()
            .IdField(x => x.Id)
            .ResolveNode((context, id) =>
                         context.DataLoader <AnimalByIdDataLoader>()
                         .LoadAsync(id, context.RequestAborted));

            descriptor
            .Field(x => x.Name)
            .Description("The name of the Animal.");

            descriptor
            .Field(x => x.Species)
            .UseUpperCase()
            .Description("The species of the Animal.");

            descriptor
            .Field(x => x.FarmId)
            .ID(nameof(Farm))
            .Description("The id of farm where the Animal lives");

            descriptor
            .Field(x => x.Farm)
            .ResolveWith <FarmResolvers>(r => r.GetFarmsByIdsAsync(default !, default !, default))
Exemple #12
0
        protected override void Configure(IObjectTypeDescriptor <Job> descriptor)
        {
            base.Configure(descriptor);

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

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

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

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

            descriptor
            .Field(c => c.Archived)
            .Name("archived");

            descriptor
            .Field(c => c.Retried)
            .Name("retried");

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

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

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

            descriptor
            .Field(c => c.Message)
            .Name("message");

            descriptor
            .Field(c => c.File)
            .Name("file");

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

            descriptor
            .Field(c => c.User)
            .Name("user")
            .ResolveWith <JobResolvers>(c => c.GetUser(default, default, default))
 protected override void Configure(IObjectTypeDescriptor <Foo> descriptor)
 {
     descriptor.ImplementsNode()
     .IdField(x => x.Id)
     .ResolveNode((_, objectId) => Task.FromResult(new Foo {
         Id = objectId
     }));
 }
Exemple #14
0
        protected override void Configure(IObjectTypeDescriptor <DeliveryReturnable> descriptor)
        {
            base.Configure(descriptor);

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

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

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


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

            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.TotalWholeSalePrice)
            .Name("totalWholeSalePrice");

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

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

            descriptor
            .Field(c => c.Name)
            .Name("name")
            .Type <NonNullType <StringType> >();
        }
Exemple #15
0
        protected override void Configure(IObjectTypeDescriptor <Material> descriptor)
        {
            base.Configure(descriptor);

            descriptor
            .ImplementsNode()
            .IdField(model => model.Id)
            .ResolveNode((context, id) => context.DataLoader <MaterialDataLoader>().LoadAsync(id, context.RequestAborted));
        }
Exemple #16
0
        /// <summary>
        /// Configures the specified descriptor.
        /// </summary>
        /// <param name="descriptor">The descriptor.</param>
        protected override void Configure(IObjectTypeDescriptor <Tag> descriptor)
        {
            descriptor.ImplementsNode()
            .IdField(t => t.Id)
            .ResolveNode((c, i) => c.DataLoader <TagByIdDataLoader>()
                         .LoadAsync(i, c.RequestAborted));

            descriptor.Field(t => t.Posts)
            .ResolveWith <TagResolvers>(t => t.GetPostsAsync(default !, default !, default !, default))
        protected override void Configure(IObjectTypeDescriptor <BookRecommedation> descriptor)
        {
            descriptor
            .ImplementsNode()
            .IdField(t => t.Id)
            .ResolveNode((ctx, id) => ctx.DataLoader <BookRecommendationByIdDataLoader>().LoadAsync(id, ctx.RequestAborted));

            descriptor.Field(e => e.RecommendedBook)
            .ResolveWith <BookRecommedationResolvers>(t => t.GetRecommendedBookAsync(default !, default !, default));
Exemple #18
0
        /// <summary>
        /// Configures the specified descriptor.
        /// </summary>
        /// <param name="descriptor">The descriptor.</param>
        protected override void Configure(IObjectTypeDescriptor <Post> descriptor)
        {
            descriptor.ImplementsNode()
            .IdField(p => p.Id)
            .ResolveNode((c, i) => c.DataLoader <PostByIdDataLoader>()
                         .LoadAsync(i, c.RequestAborted));

            descriptor.Field(p => p.Tags)
            .ResolveWith <PostResolvers>(p => p.GetTagsAsync(default !, default !, default !, default))
Exemple #19
0
 protected override void Configure(IObjectTypeDescriptor <Track> descriptor)
 {
     descriptor
     .ImplementsNode()
     .IdField(t => t.Id)
     .ResolveNode((ctx, id) => ctx.DataLoader <TrackByIdDataLoader>().LoadAsync(id, ctx.RequestAborted));
     descriptor
     .Field(t => t.Sessions)
     .ResolveWith <TrackResolvers>(t => t.GetSessionsAsync(default !, default !, default !, default))
Exemple #20
0
        protected override void Configure(IObjectTypeDescriptor <Author> descriptor)
        {
            descriptor
            .ImplementsNode()
            .IdField(t => t.Id)
            .ResolveNode((ctx, id) => ctx.DataLoader <AuthorByIdDataLoader>().LoadAsync(id, ctx.RequestAborted));

            descriptor.Field(e => e.Books)
            .ResolveWith <AuthorResolvers>(t => t.GetBooksAsync(default !, default !, default !, default))
Exemple #21
0
 protected override void Configure(IObjectTypeDescriptor <Tenant> descriptor)
 {
     descriptor
     .ImplementsNode()
     .IdField(t => t.Id)
     .ResolveNode((ctx, id) => ctx.DataLoader <TenantByIdDataLoader>().LoadAsync(id, ctx.RequestAborted));
     descriptor
     .Field(t => t.CurrentResidence)
     .ResolveWith <TenantResolvers>(resolver => resolver.GetResidenceAsync(default !, default !, default))
        protected override void Configure(IObjectTypeDescriptor <Badge> descriptor)
        {
            descriptor
            .ImplementsNode()
            .IdField(badge => badge.Id)
            .ResolveNode((ctx, id) => ctx.DataLoader <BadgeByIdDataLoader>().LoadAsync(id, ctx.RequestAborted));

            descriptor
            .Field(b => b.Dancers)
            .ResolveWith <BadgeResolvers>(t => t.GetDancersAsync(default !, default !, default !, default !))
        protected override void Configure(IObjectTypeDescriptor <Rune> descriptor)
        {
            descriptor
            .ImplementsNode()
            .IdField(t => t.Id)
            .ResolveNode((ctx, id) => ctx.DataLoader <RuneByIdDataLoader>().LoadAsync(id, ctx.RequestAborted));

            descriptor
            .Field(r => r.PrimaryPage)
            .ResolveWith <RuneResolvers>(r => r.GetPrimaryPageAsync(default !, default !, default !, default))
        protected override void Configure(IObjectTypeDescriptor <Dancer> descriptor)
        {
            descriptor
            .ImplementsNode()
            .IdField(dancer => dancer.Id)
            .ResolveNode((ctx, id) => ctx.DataLoader <DancerByIdDataLoader>().LoadAsync(id, ctx.RequestAborted));

            descriptor
            .Field(d => d.Badges)
            .ResolveWith <DancerResolvers>(t => t.GetBadgesAsync(default !, default !, default !, default !))
Exemple #25
0
        protected override void Configure(IObjectTypeDescriptor <Family> descriptor)
        {
            descriptor
            .ImplementsNode()
            .IdField(t => t.Id)
            .ResolveNode((ctx, id) => ctx.DataLoader <FamilyByIdDataLoader>().LoadAsync(id, ctx.RequestAborted));

            descriptor
            .Field(f => f.Members)
            .ResolveWith <FamilyResolvers>(t => t.GetMembersAsync(default !, default !, default !, default))
Exemple #26
0
        protected override void Configure(IObjectTypeDescriptor <Build> descriptor)
        {
            descriptor
            .ImplementsNode()
            .IdField(t => t.Id)
            .ResolveNode((ctx, id) => ctx.DataLoader <BuildByIdDataLoader>().LoadAsync(id, ctx.RequestAborted));

            descriptor
            .Field(b => b.BuildItems)
            .ResolveWith <BuildResolvers>(r => r.GetItemsAsync(default !, default !, default !, default))
        protected override void Configure(IObjectTypeDescriptor <User> descriptor)
        {
            descriptor
            .ImplementsNode()
            .IdField(t => t.Id)
            .ResolveNode((ctx, id) => ctx.DataLoader <UserByIdDataLoader>().LoadAsync(id, ctx.RequestAborted));

            descriptor
            .Field(u => u.Posts)
            .ResolveWith <UserResolvers>(r => r.GetPostsAsync(default !, default !, default !, default))
Exemple #28
0
        protected override void Configure(IObjectTypeDescriptor <Score> descriptor)
        {
            descriptor
            .ImplementsNode()
            .IdField(score => score.Id)
            .ResolveNode((ctx, id) => ctx.DataLoader <ScoreByIdDataLoader>().LoadAsync(id, ctx.RequestAborted));

            descriptor
            .Field(t => t.SongDifficulty)
            .ResolveWith <ScoreResolvers>(t => t.GetSongDifficultyAsync(default !, default !, default));
Exemple #29
0
        protected override void Configure(IObjectTypeDescriptor <Region> descriptor)
        {
            // descriptor.Field(c => c.Id).Ignore();
            descriptor
            .ImplementsNode()
            .IdField(t => t.CustomerId)
            .ResolveNode((ctx, id) => ctx.DataLoader <RegionByIdDataLoader>().LoadAsync(id, ctx.RequestAborted));

            descriptor
            .Field(t => t.Customer)
            .ResolveWith <CustomerResolvers>(t => t.GetCustomerAsync(default !, default !, default !, default))
Exemple #30
0
 protected override void Configure(IObjectTypeDescriptor descriptor)
 {
     descriptor.Name("_DummyNodeType")
     .Description("Dummy type to enable Relay support with only default types. Do not use this type.")
     .Field("id")
     .Deprecated("Do not use this type.")
     .Resolve("__dummy")
     .Type <IdType>();
     descriptor.ImplementsNode()
     .ResolveNode <string>((ctx, id) => Task.FromResult(new object()));
 }