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

Fix sorting custom field variables (issue #6545) #6660

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

alex-mazzariol
Copy link

Summary of the changes (Less than 80 chars)

  • Ensure the InputParser uses the correct type when parsing variables

Closes #6545

@CLAassistant
Copy link

CLAassistant commented Nov 2, 2023

CLA assistant check
All committers have signed the CLA.

Copy link

codecov bot commented Nov 2, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (6965960) 78.98% compared to head (9d4d66f) 80.67%.
Report is 62 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6660      +/-   ##
==========================================
+ Coverage   78.98%   80.67%   +1.68%     
==========================================
  Files        2903     2541     -362     
  Lines      139771   127082   -12689     
==========================================
- Hits       110397   102521    -7876     
+ Misses      29374    24561    -4813     
Flag Coverage Δ
unittests 80.67% <87.17%> (+1.68%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...e/src/CookieCrumble/Extensions/WriterExtensions.cs 100.00% <ø> (ø)
...CookieCrumble/src/CookieCrumble/TestEnvironment.cs 0.00% <ø> (ø)
...polloFederationRequestExecutorBuilderExtensions.cs 66.66% <100.00%> (ø)
...ensions/ApolloFederationSchemaBuilderExtensions.cs 86.66% <ø> (ø)
.../src/ApolloFederation/FederationTypeInterceptor.cs 100.00% <100.00%> (ø)
...ion/src/ApolloFederation/Helpers/ArgumentParser.cs 68.65% <100.00%> (+0.47%) ⬆️
...rc/AspNetCore.CommandLine/Command/ExportCommand.cs 100.00% <100.00%> (ø)
...tChocolateAspNetCoreServiceCollectionExtensions.cs 93.33% <ø> (+26.66%) ⬆️
...rc/AspNetCore/Extensions/HttpResponseExtensions.cs 26.31% <ø> (+4.57%) ⬆️
...pNetCore/src/AspNetCore/GraphQLRequestException.cs 25.00% <ø> (+5.00%) ⬆️
... and 13 more

... and 759 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@michaelstaib
Copy link
Member

I do not thing that this is correct... the formatter tries to get the data hooked onto the underlying type ... the property is captured on the field runtime type which takes it directly from the PropertInfo. The type runtime type could be completly different and cause unnecessary conversion.

@michaelstaib
Copy link
Member

Can you add a test so we have you error case captured?

@alex-mazzariol
Copy link
Author

Thank you for the review; I will try to add tests to capture the issue and the fix.

What is actually happening is exactly what you describe: the formatter tries to hook the data onto the underlying type, but for sorting the type is wrong - the type that is tried is the underlying type, while the actual type is the input type that accepts the sorting direction enum values, not any raw value.

@michaelstaib
Copy link
Member

OK, lets get a test in that shows this error and see what the actual issue is. I need something that we can debug. Thanks so much for your work on this!

@alex-mazzariol
Copy link
Author

In the meantime if you want you may check the sample project that I made to showcase issue #6545 at https://github.com/alex-mazzariol/hotchocolate-issue-6545, I'll try converting it into tests in the weekend.

@michaelstaib
Copy link
Member

We can use the project as test case. Its really easy to get this in and than we do a snapshot test on top of your project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants