Skip to content

Ignoring operation in the FilterInputType does not work #7096

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

Closed
marekbomber opened this issue May 9, 2024 · 7 comments
Closed

Ignoring operation in the FilterInputType does not work #7096

marekbomber opened this issue May 9, 2024 · 7 comments

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

@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 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.

@glen-84
Copy link
Collaborator

glen-84 commented Jun 6, 2024

Related: #5406.

@glen-84
Copy link
Collaborator

glen-84 commented Jun 6, 2024

Please add a link to a minimal reproduction of this issue.

@michaelstaib
Copy link
Member

Closing this issue as there is no repro

@michaelstaib michaelstaib closed this as not planned Won't fix, can't repro, duplicate, stale Jun 23, 2024
@michaelstaib michaelstaib removed the ❓ question This issue is a question about feature of Hot Chocolate. label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants