-
-
Notifications
You must be signed in to change notification settings - Fork 748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValidatePipelineOrder=false wont work #5883
Comments
@barnuri-cp 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 |
@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
The text was updated successfully, but these errors were encountered: