public ContentResultGraphType(ContentGraphType contentType, SchemaInfo schemaInfo)
        {
            Name = schemaInfo.ResultType;

            AddField(new FieldType
            {
                Name         = "total",
                ResolvedType = AllTypes.NonNullInt,
                Resolver     = ContentResolvers.ListTotal,
                Description  = $"The total number of {schemaInfo.DisplayName} items."
            });

            AddField(new FieldType
            {
                Name         = "items",
                ResolvedType = new ListGraphType(new NonNullGraphType(contentType)),
                Resolver     = ContentResolvers.ListItems,
                Description  = $"The {schemaInfo.DisplayName} items."
            });

            Description = $"List of {schemaInfo.DisplayName} items and total count.";
        }
示例#2
0
        public ContentResultGraphType(ContentGraphType contentType, SchemaInfo schemaInfo)
        {
            // The name is used for equal comparison. Therefore it is important to treat it as readonly.
            Name = schemaInfo.ResultType;

            AddField(new FieldType
            {
                Name         = "total",
                ResolvedType = AllTypes.NonNullInt,
                Resolver     = ContentResolvers.ListTotal,
                Description  = FieldDescriptions.ContentsTotal
            });

            AddField(new FieldType
            {
                Name         = "items",
                ResolvedType = new ListGraphType(new NonNullGraphType(contentType)),
                Resolver     = ContentResolvers.ListItems,
                Description  = FieldDescriptions.ContentsItems
            });

            Description = $"List of {schemaInfo.DisplayName} items and total count.";
        }