-
-
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
Can not create new field which the same name with ingored field #1453
Comments
Can you create a little repro? |
I created a project to demo this issue. Please take a look at this project: https://github.com/giangcoi48k/DemoIssue1453_Hotchocolate |
In the demo above, it seemed a bit ridiculous to ignore a field and then declare it immediately below. But imagine, if one class inherits another which ignored a few fields, and wants to re-enable that field. It's easy with version 10.2.0, but with version 10.3.5, I haven't found a way to do that yet |
It is a valid case.... thanks for putting this together :) |
Hi @giangcoi48k |
The issue here is that we are also tracking the field name ... but in this case we only need to track the field property. But there are quite a few edge case hidden here . Case 1
Case 2
Case 3
|
I think if we add a field by name (foo), but it shows as foo1 will be confusing. I think simply, if we declare a field below another field of the same name, the above field will be overwritten. |
Hmm.. I also think it is confusing when we add another field. I would just always return the same instance of the field though |
The cases are a bit wrong 🤪 I will update them tonight the it will be more clear |
So I have reworked the cases. We could also decide to throw exceptions. But, I think it can actually lead in useful cases like I might ignore a field in the main type. Then later I extend the type and will include the ignored property under a different name. I actually think that |
Closing this, since it appears to be fixed. |
When I created an ObjectType, I need Ignore some fields like:
Then I need to create a new field
FinancialStatements
, like:But the new
financialStatements
field does not show, with error message:The field `financialStatements` does not exist on the type `CompanyReportType`.
This bug occurred on 10.3.5. In 10.2.0, this bug did not occur
The text was updated successfully, but these errors were encountered: