Пример #1
0
        public CreateAuthorInputType(CMSGraphQLSchema schema)
            : base("CreateAuthor", "Model for creating and author")
        {
            schema.AddKnownType(this);

            this.Field("name", e => e.Name);
            this.Field("surname", e => e.Surname);
        }
        public AuthorSchemaType(CMSGraphQLSchema schema) : base("Author", "Represents an author that writes articles")
        {
            schema.AddKnownType(this);

            this.Field("id", e => e.Id);
            this.Field("name", e => e.Name);
            this.Field("surname", e => e.Surname);
        }
Пример #3
0
        public PagedListSchemaType(CMSGraphQLSchema schema, AuthorSchemaType author)
            : base($"PagedListOf{schema.SchemaRepository.GetSchemaTypeFor(typeof(TViewModel)).Name}", "Paged list")
        {
            schema.AddKnownType(this);

            this.Field("hasNextPage", e => e.HasNextPage);
            this.Field("hasPreviousPage", e => e.HasPreviousPage);
            this.Field("indexFrom", e => e.IndexFrom);
            this.Field("items", e => e.Items);
            this.Field("pageIndex", e => e.PageIndex);
            this.Field("pageSize", e => e.PageSize);
            this.Field("totalCount", e => e.TotalCount);
            this.Field("totalPages", e => e.TotalPages);
        }