Closed barnuri-cp closed 1 year ago
@barnuri-cp Reproduced, Workaround, do not use SetOptions just use ModifyOptions
Also, why do you want to do this?
@PascalSenn im writing a feature to distinct the result of IQueryable, and i put it after the projections and its works good, but the sort happen before, and i need it after the distict because i wanted the distinct results to be sorted so sort need to be in the end
It also will not work... sorting cannot work after paging since paging is not outputing a list or queryable.
But you could handle the order in your resolver.
@michaelstaib can you give me an example ? i want one resolver for the whole app, dont want to config it each method
How do you want to have one resolver for different types?
HC 13 allows you tow wrap attributes in attributes and introduce a new pipeline in there. The new pipeline can do the apply on the queryable.
@michaelstaib
yeah i want to make it generic, dont wont to work hard it every type, like all other works
for example if i had a way to just receive the IQueryable before everything else is running i can do it generic
IQueryable
@michaelstaib nice ! find that
public class UseSearchAttribute : DescriptorAttribute
{
protected override void TryConfigure(IDescriptorContext context, IDescriptor descriptor, ICustomAttributeProvider element)
{
ApplyAttribute(context, descriptor, element, new UseSortingAttribute());
ApplyAttribute(context, descriptor, element, new UsePagingAttribute());
ApplyAttribute(context, descriptor, element, new UseProjectionAttribute());
ApplyAttribute(context, descriptor, element, new UseFilteringAttribute());
}
}
thanks for the help and the quick response !!!
Is there an existing issue for this?
Product
Hot Chocolate
Describe the bug
when setting ValidatePipelineOrder=false, its probably not populate to MiddlewareValidationTypeInterceptor because it keep throwing errors of invalid order
Steps to reproduce
var graphqlBuilder = servicesCollection.AddGraphQLServer(); graphqlBuilder = graphqlBuilder.AddProjections(); graphqlBuilder = graphqlBuilder.AddFiltering(); graphqlBuilder = graphqlBuilder.AddSorting(); graphqlBuilder = graphqlBuilder.SetOptions(new() {ValidatePipelineOrder =false}); graphqlBuilder = graphqlBuilder.ModifyOptions(c => c.ValidatePipelineOrder = false);
[UseDbContext(typeof(User))] [UseSorting] [UsePaging] [UseProjection] [UseFiltering] public IQueryable GetUser([Service] Repo repository) => repository.Users;
Relevant log output
No response
Additional Context?
No response
Version
13