Пример #1
0
        protected override void Configure(IObjectTypeDescriptor <ModuleTag> descriptor)
        {
            descriptor.BindFieldsExplicitly();

            descriptor.Field(f => f.Id)
            .Type <NonNullType <IntType> >();

            descriptor.Field(f => f.Name)
            .Type <NonNullType <StringType> >();
        }
Пример #2
0
 protected override void Configure(IObjectTypeDescriptor <Product> descriptor)
 {
     descriptor.BindFieldsExplicitly();
     descriptor.Field(t => t.Name);
     descriptor.Field(t => t.Description);
     descriptor.Field(t => t.Price);
     descriptor.Field(t => t.Rating);
     descriptor.Field(t => t.PhotoFileName);
     descriptor.Field(t => t.IntroducedAt);
 }
Пример #3
0
 protected override void Configure(IObjectTypeDescriptor <Game> descriptor)
 {
     descriptor.BindFieldsExplicitly();
     descriptor.Field(g => g.Id);
     descriptor.Field(g => g.IsOffered);
     descriptor.Field(g => g.Matches).UseFiltering().Type <ListType <MatchType> >();
     descriptor.Field(g => g.QueuedPlayers).UseFiltering().Type <ListType <GamePlayerType> >();
     descriptor.Field(g => g.Name);
     descriptor.Field(g => g.PlayerCount);
 }
Пример #4
0
        protected override void Configure(IObjectTypeDescriptor <Continent> descriptor)
        {
            base.Configure(descriptor);

            descriptor.BindFieldsExplicitly();

            descriptor.Field(f => f.Name).Type <NonNullType <StringType> >();

            descriptor.Field(f => f.Country).Type <NonNullType <ListType <NonNullType <CountryType> > > >();
        }
Пример #5
0
        protected override void Configure(IObjectTypeDescriptor <User> descriptor)
        {
            descriptor.BindFieldsExplicitly();

            descriptor.Field(_ => _.Id);
            descriptor.Field("notesOne").UseDbContext <DemoContext>().Resolve(async _ => await GetNotes(_.Parent <User>())).Type(typeof(List <UserNote>));
            //descriptor.Field("notesOne").UseDbContext<DemoContext>().Resolve(_ => GetNotes(_.Parent<User>()).Result).Type(typeof(List<UserNote>));
            descriptor.Field("notesTwo").UseDbContext <DemoContext>().Resolve(async _ => await GetNotes(_.Parent <User>())).Type(typeof(List <UserNote>));
            //descriptor.Field("notesTwo").UseDbContext<DemoContext>().Resolve(_ => GetNotes(_.Parent<User>()).Result).Type(typeof(List<UserNote>));
        }
Пример #6
0
        protected override void Configure(
            IObjectTypeDescriptor <Query> descriptor)
        {
            descriptor
            .BindFieldsExplicitly();

            descriptor
            .Field(t => t.Get())
            .Type <NonNullType <ListType <NonNullType <TodoPayload> > > >();
        }
Пример #7
0
        protected override void Configure(IObjectTypeDescriptor <Module> descriptor)
        {
            descriptor.BindFieldsExplicitly();

            descriptor.Field(f => f.Id)
            .Type <NonNullType <IntType> >();

            descriptor.Field(f => f.Name)
            .Type <NonNullType <StringType> >();

            descriptor.Field(f => f.Description)
            .Type <NonNullType <StringType> >();

            descriptor.Field(f => f.GithubLink)
            .Type <UrlType>();

            descriptor.Field(f => f.PublishedDateTime)
            .Type <NonNullType <DateTimeType> >();

            descriptor.Field(f => f.LastUpdatedDateTime)
            .Type <NonNullType <DateTimeType> >();

            descriptor.Field(f => f.IsCore)
            .Type <NonNullType <BooleanType> >();

            descriptor.Field("author")
            .Type <NonNullType <AccountType> >()
            .Resolver(ctx =>
            {
                var dataContext = ctx.DataLoader <AccountById>();
                var module      = ctx.Parent <Module>();

                return(dataContext.LoadAsync(module.AuthorId));
            });

            descriptor.Field("tags")
            .Type <NonNullType <ListType <NonNullType <ModuleTagType> > > >()
            .Resolver(ctx =>
            {
                var dataContext = ctx.DataLoader <ModuleTagsByModuleId>();
                var module      = ctx.Parent <Module>();

                return(dataContext.LoadAsync(module.Id));
            });

            descriptor.Field("replacements")
            .Type <NonNullType <ListType <NonNullType <ModuleReplacementType> > > >()
            .Resolver(ctx =>
            {
                var dataContext = ctx.DataLoader <ModuleReplacementByModuleId>();
                var module      = ctx.Parent <Module>();

                return(dataContext.LoadAsync(module.Id));
            });
        }
Пример #8
0
        protected override void Configure(IObjectTypeDescriptor <ClaimDto> descriptor)
        {
            descriptor.Name(nameof(ClaimDto));

            descriptor.BindFieldsExplicitly();

            descriptor.Field(o => o.Id).Type <NonNullType <UuidType> >();
            descriptor.Field(o => o.Name).Type <NonNullType <StringType> >().Description("");
            descriptor.Field(o => o.Description).Type <NonNullType <StringType> >().Description("");
            descriptor.Field(o => o.Value).Type <NonNullType <StringType> >().Description("");
        }
Пример #9
0
        protected override void Configure(IObjectTypeDescriptor <Events> descriptor)
        {
            descriptor
            .BindFieldsExplicitly();

            /*
             * Users
             */
            descriptor
            .Name(Events.ON_USER_LOGIN)
            .Field(x => x.OnUserLogin(default))
 protected override void Configure(IObjectTypeDescriptor <Core.Model.Project> descriptor)
 {
     descriptor.BindFieldsExplicitly();
     descriptor.Field(x => x.Id);
     descriptor.Field(x => x.CompanyId);
     descriptor.Field(x => x.Title);
     descriptor.Field(x => x.Status);
     descriptor.Field(x => x.UserProjects);
     descriptor.Field(x => x.Description);
     descriptor.Field("users").Resolver(resolve => resolve.Parent <Project>().UserProjects.Select(u => u.User));
 }
        protected override void Configure(IObjectTypeDescriptor <SanitaryMeasure> descriptor)
        {
            base.Configure(descriptor);

            descriptor.BindFieldsExplicitly();

            descriptor.Field(t => t.Name).
            Type <NonNullType <StringType> >();

            descriptor.Field(t => t.Description).
            Type <StringType>();
        }
Пример #12
0
    protected override void Configure(IObjectTypeDescriptor <EmailServerDto> descriptor)
    {
        descriptor.Name(nameof(EmailServerDto));

        descriptor.BindFieldsExplicitly();

        descriptor.Field(d => d.Host).Type <StringType>();
        descriptor.Field(d => d.Port).Type <PortType>();
        descriptor.Field(d => d.UserName).Type <StringType>();
        descriptor.Field(d => d.FromAddress).Type <EmailAddressType>();
        descriptor.Field(d => d.FromDisplayName).Type <StringType>();
    }
Пример #13
0
        protected override void Configure(IObjectTypeDescriptor <Medication> descriptor)
        {
            base.Configure(descriptor);

            descriptor.BindFieldsExplicitly();

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

            descriptor.Field(f => f.Pharmacist).Type <StringType>()
            .Name("pharmaceutical");
        }
Пример #14
0
        protected override void Configure(IObjectTypeDescriptor <ScopeDto> descriptor)
        {
            descriptor.Name(nameof(ScopeDto));

            descriptor.BindFieldsExplicitly();

            descriptor.Field(o => o.Id).Type <NonNullType <UuidType> >();
            descriptor.Field(o => o.Name).Type <NonNullType <StringType> >().Description("");
            descriptor.Field(o => o.DisplayName).Type <NonNullType <StringType> >().Description("");
            descriptor.Field(o => o.Description).Type <NonNullType <StringType> >();
            descriptor.Field(o => o.Resources).Type <NonNullType <ListType <NonNullType <StringType> > > >().Description("");
        }
Пример #15
0
        protected override void Configure(IObjectTypeDescriptor <Region> descriptor)
        {
            base.Configure(descriptor);

            descriptor.BindFieldsExplicitly();

            descriptor.Field(f => f.Name).Type <StringType>();

            descriptor.Field(f => f.CountryNavigation)
            .Type <NonNullType <CountryType> >()
            .Name("country");
        }
Пример #16
0
        protected override void Configure(IObjectTypeDescriptor <AuthToken> descriptor)
        {
            descriptor.BindFieldsExplicitly();

            descriptor.Field(f => f.Id)
            .Type <NonNullType <IntType> >();

            descriptor.Field(f => f.Description)
            .Type <NonNullType <StringType> >();

            descriptor.Field(f => f.Token)
            .Type <NonNullType <StringType> >();
        }
Пример #17
0
 protected override void Configure(IObjectTypeDescriptor <JToken> descriptor)
 {
     descriptor.Name("Json");
     descriptor.BindFieldsExplicitly();
     descriptor
     .Field("object")
     .Type <JsonObjectType>()
     .Resolve(ctx => (Dummy <JToken, object>)ctx.Parent <JToken>());
     descriptor
     .Field("string")
     .Type <JsonStringType>()
     .Resolve(ctx => (Dummy <JToken, string>)ctx.Parent <JToken>());
 }
Пример #18
0
        protected override void Configure(IObjectTypeDescriptor <MedicalProcedures> descriptor)
        {
            base.Configure(descriptor);

            descriptor.Name("Procedure");

            descriptor.BindFieldsExplicitly();

            descriptor.Field(e => e.Name)
            .Type <NonNullType <StringType> >();

            descriptor.Field(e => e.RecoveringDays)
            .Type <NonNullType <ShortType> >();
        }
Пример #19
0
 protected override void Configure(IObjectTypeDescriptor <Core.Model.User> descriptor)
 {
     descriptor.BindFieldsExplicitly();
     descriptor.Field(x => x.Id);
     descriptor.Field(x => x.CompanyId);
     descriptor.Field(x => x.Email);
     descriptor.Field(x => x.Status);
     descriptor.Field(x => x.EmailConfirmed);
     descriptor.Field(x => x.PhoneNumber);
     descriptor.Field(x => x.PhoneNumberConfirmed);
     descriptor.Field(x => x.UserName);
     descriptor.Field(x => x.UserProjects);
     descriptor.Field(x => x.Company);
 }
Пример #20
0
        protected override void Configure(IObjectTypeDescriptor <PatientContact> descriptor)
        {
            base.Configure(descriptor);

            descriptor.Name("ContactVisit");

            descriptor.BindFieldsExplicitly();

            descriptor.Field(f => f.Patient).Type <NonNullType <PatientType> >();

            descriptor.Field(f => f.Contact).Type <NonNullType <ContactType> >();

            descriptor.Field(f => f.LastVisit)
            .Type <NonNullType <DateType> >()
            .Name("visitDate");
        }
Пример #21
0
        protected override void Configure(IObjectTypeDescriptor <MedicalEquipment> descriptor)
        {
            base.Configure(descriptor);

            descriptor.BindFieldsExplicitly();

            descriptor.Field(e => e.SerialNumber)
            .Type <NonNullType <StringType> >();

            descriptor.Field(e => e.Name)
            .Type <NonNullType <StringType> >();

            descriptor.Field(e => e.Stock)
            .Type <NonNullType <IntType> >();

            descriptor.Field(e => e.Provider)
            .Type <NonNullType <StringType> >();
        }
Пример #22
0
        protected override void Configure(
            IObjectTypeDescriptor <Todo> descriptor)
        {
            descriptor
            .BindFieldsExplicitly();

            descriptor
            .Field(x => x.Id)
            .Type <NonNullType <IdType> >();

            descriptor
            .Field(x => x.Title)
            .Type <NonNullType <StringType> >();

            descriptor
            .Field(x => x.Status)
            .Type <NonNullType <EnumType <TodoStatus> > >();
        }
Пример #23
0
        protected override void Configure(IObjectTypeDescriptor <MedicalProcedureRecord> descriptor)
        {
            base.Configure(descriptor);

            descriptor.Name("Appointment");

            descriptor.BindFieldsExplicitly();

            descriptor.Field(e => e.ProcedureNameNavigation)
            .Name("procedure")
            .Description("This is the procedure object related")
            .Type <NonNullType <ProcedureType> >();

            descriptor.Field(e => e.OperationExecutionDate)
            .Name("executionDate")
            .Description("Execution date of procedure.")
            .Type <NonNullType <DateType> >();
        }
Пример #24
0
        protected override void Configure(IObjectTypeDescriptor <AuthorizationDto> descriptor)
        {
            descriptor.Name(nameof(AuthorizationDto));

            descriptor.BindFieldsExplicitly();

            descriptor.Field(x => x.Id).Type <NonNullType <UuidType> >().Description("The Id of the api resource");
            descriptor.Field(x => x.Application).Type <NonNullType <ClientType> >().Description("Is the resource enabled");
            descriptor.Field(x => x.Scopes).Type <NonNullType <ListType <NonNullType <StringType> > > >()
            .Description("The name of the resource");
            descriptor.Field(x => x.Status).Type <NonNullType <StringType> >()
            .Description("The display name used in consent screens");
            descriptor.Field(x => x.Subject).Type <NonNullType <StringType> >()
            .Description("The description of the api resource");
            descriptor.Field(x => x.CreationDate).Type <DateTimeType>()
            .Description("The secrets registered for the resource");
            descriptor.Field(x => x.Type).Type <StringType>().Description("The scopes registered for this resource");
        }
Пример #25
0
        protected override void Configure(IObjectTypeDescriptor <PaginatedResult <T> > descriptor)
        {
            descriptor.BindFieldsExplicitly();

            descriptor.Field(f => f.PageNumber)
            .Type <NonNullType <IntType> >();

            descriptor.Field(f => f.PageSize)
            .Type <NonNullType <IntType> >();

            descriptor.Field(f => f.TotalRecords)
            .Type <IntType>();

            descriptor.Field(f => f.TotalPages)
            .Type <IntType>();

            descriptor.Field(f => f.Result);
        }
Пример #26
0
        protected override void Configure(IObjectTypeDescriptor <IUser> descriptor)
        {
            descriptor.BindFieldsExplicitly();

            descriptor.Name("Account");

            descriptor.Field(f => f.Id)
            .Type <NonNullType <IntType> >();

            descriptor.Field("tokens")
            .Type <NonNullType <ListType <NonNullType <AuthTokenType> > > >()
            .Resolver(ctx =>
            {
                var dataContext = ctx.DataLoader <AuthTokensByAccountId>();
                var account     = ctx.Parent <IUser>();

                return(dataContext.LoadAsync(account.Id));
            });

            descriptor.Field("modules")
            .Type <NonNullType <PaginatedResultType <Module> > >()
            .AddPaginationArgument()
            .Resolver(ctx =>
            {
                var paginationQuery = ctx.GetPaginationQuery();

                var moduleRepository = ctx.Service <IModuleRepository>();
                var account          = ctx.Parent <IUser>();

                return(moduleRepository.GetModulesByAuthorId(account.Id, paginationQuery));
            });

            descriptor.Field(f => f.ProfilePicUrl)
            .Type <NonNullType <UrlType> >();

            descriptor.Field(f => f.Nickname)
            .Type <NonNullType <StringType> >();

            descriptor.Field(f => f.Email)
            .Type <NonNullType <StringType> >();
        }
Пример #27
0
        protected override void Configure(IObjectTypeDescriptor <Hospital> descriptor)
        {
            base.Configure(descriptor);

            descriptor.Name("HealthCenter");

            descriptor.BindFieldsExplicitly();

            descriptor.Field(f => f.Name).Type <NonNullType <StringType> >();

            descriptor.Field(f => f.Capacity).Type <NonNullType <IntType> >();

            descriptor.Field(f => f.IcuCapacity).Type <NonNullType <IntType> >()
            .Name("totalICUBeds");

            descriptor.Field(f => f.ManagerNavigation).Type <NonNullType <ContactType> >()
            .Name("directorContact");

            descriptor.Field(f => f.RegionNavigation).Type <NonNullType <RegionType> >()
            .Name("ubication");
        }
        protected override void Configure(IObjectTypeDescriptor <Core.Model.WorkItem> descriptor)
        {
            descriptor.BindFieldsExplicitly();
            descriptor.Field(x => x.Id);

            descriptor.Field(x => x.Status);
            descriptor.Field(x => x.Description);
            descriptor.Field(x => x.Discussion);
            descriptor.Field(x => x.WorkItemType);

            descriptor.Field(x => x.Name);
            descriptor.Field(x => x.ParentId);

            descriptor.Field(x => x.Project);

            descriptor.Field(x => x.Tags);
            descriptor.Field(x => x.UpdateHistory);
            descriptor.Field(x => x.Parent);
            descriptor.Field(x => x.Children);
            descriptor.Field(x => x.Parent);
        }
Пример #29
0
        protected override void Configure(IObjectTypeDescriptor <ClinicRecord> descriptor)
        {
            base.Configure(descriptor);

            descriptor.Name("Record");

            descriptor.BindFieldsExplicitly();

            descriptor.Field(e => e.PathologyName)
            .Type <NonNullType <StringType> >();

            descriptor.Field(e => e.DiagnosticDate)
            .Type <NonNullType <DateType> >();

            descriptor.Field(e => e.Treatment)
            .Type <StringType>();

            descriptor.Field(e => e.MedicalProcedureRecord)
            .Name("Appointment")
            .Type <ListType <NonNullType <AppointmentType> > >();
        }
        protected override void Configure(IObjectTypeDescriptor <SRecipe> descriptor)
        {
            descriptor.BindFieldsExplicitly();
            descriptor.Name("Recipe");
            //descriptor.Field(x => x.Name);
            descriptor.Field(x => x.CookingMethod);
            descriptor.Field(x => x.RecipeIngredient);

            return;

            var recipeType = typeof(SRecipe);

            descriptor.Name(recipeType.Name);

            var props = recipeType.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);

            foreach (var prop in props)
            {
                if (prop.PropertyType.Name.StartsWith("OneOrMany"))
                {
                    GenerateOneOrManyDescriptor(descriptor, prop);
                }
                else if (prop.PropertyType.Name.StartsWith("Values"))
                {
                    GenerateValuesDescriptor(descriptor, prop);
                }
                else
                {
                    var parameterExpression = Expression.Parameter(recipeType, "x");

                    var expression = Expression.Lambda(
                        Expression.MakeMemberAccess(parameterExpression, prop),
                        parameterExpression
                        ) as Expression <Func <SRecipe, object> >;

                    descriptor.Field(expression);
                }
            }
        }