Skip to content
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

Ignoring operation in the FilterInputType does not work #7096

Open
marekbomber opened this issue May 9, 2024 · 4 comments
Open

Ignoring operation in the FilterInputType does not work #7096

marekbomber opened this issue May 9, 2024 · 4 comments
Labels
🌶️ hot chocolate ❓ question This issue is a question about feature of Hot Chocolate.

Comments

@marekbomber
Copy link

Product

Hot Chocolate

Version

13.9.1

Link to minimal reproduction

tbd

Steps to reproduce

public class MyTypeFilterType : FilterInputType<MyType>
{
    protected override void Configure(IFilterInputTypeDescriptor<MyType> descriptor)
    {
        descriptor.Ignore(DefaultFilterOperations.Equals); // not working
        descriptor.Operation(DefaultFilterOperations.Equals).Type<StringType>().Ignore(); // not working
        descriptor.Operation(DefaultFilterOperations.Equals).Type<StringOperationFilterInputType>().Ignore(); // not working
    }
}

What is expected?

I would like to be able to ignore operations in the filter definition.

What is actually happening?

Operations are not ignored.

Relevant log output

No response

Additional context

No response

@marekbomber marekbomber added the 🐛 bug Something isn't working label May 9, 2024
@michaelstaib
Copy link
Member

Did you register the filter type?

@michaelstaib
Copy link
Member

Ah, I see ... what are you trying to do?

@michaelstaib michaelstaib added ❓ question This issue is a question about feature of Hot Chocolate. and removed 🐛 bug Something isn't working labels May 9, 2024
@marekbomber
Copy link
Author

Did you register the filter type?

Standard registration IRequestExecutorBuider.AddType(typeof(MyTypeFilterType ));
Registration is correct because ignoring properties works.
`

public class MyTypeFilterType : FilterInputType<MyType>
{
    protected override void Configure(IFilterInputTypeDescriptor<MyType> descriptor)
    {
        descriptor.Field(x => x.MyProperty1).Ignore(); // working
        descriptor.Field(x => x.MyProperty2).Description("description 2"); // working

        descriptor.Ignore(DefaultFilterOperations.Equals); // not working
        descriptor.Operation(DefaultFilterOperations.Equals).Type<StringType>().Ignore(); // not working
        descriptor.Operation(DefaultFilterOperations.Equals).Type<StringOperationFilterInputType>().Ignore(); // not working
    }
}
``` `

@marekbomber
Copy link
Author

Ah, I see ... what are you trying to do?

I would like it to be impossible to use Operation Equals for all string properties in my object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌶️ hot chocolate ❓ question This issue is a question about feature of Hot Chocolate.
Projects
None yet
Development

No branches or pull requests

2 participants