Open cmeeren opened 7 months ago
Why was my comment deleted? I spent more than a day of research on that comment and I come back to check and it is deleted without comment? Please explain.
I did not delete it, but since it was off-topic, I reported it as such after several days of inactivity had passed. My intention was for the owners of this repo to hide it as off-topic in order to clean up this thread, but apparently it was deleted (along with my reply suggesting that you open a separate issue).
I did open another issue, but initially, I was told on the slack channel to post into this thread. The two are most likely related as they post deal specifically with default values of enums. Not sure why you assumed it was off topic.
There may be many issues related to default enum values. Yours clearly seems to be a completely separate issue for the following reasons, as I described in my (now deleted) original comment:
AddMutationConventions
throwing. I do not experience that; it is not a symptom of my bug.These two points clearly point to these two bugs not overlapping in any meaningful way. That is why I suggested you open a different issue, and why after some time, I reported the comment as off-topic.
Product
Hot Chocolate
Version
14.0.0-p.85
Link to minimal reproduction
See zip below
Steps to reproduce
Repro solution: HotChocolateRepro.zip
Repro code for reference:
What is expected?
What is actually happening?
Relevant log output
No response
Additional context
Strangely enough, the following C# code, which as far as I know is equivalent to the F# code above, does not exhibit the problem, and produces the expected schema:
I tried also adding the
GraphQLType(typeof<MyEnum>)
attribute to the field. This did not help.The following workaround seems to work (requires removing the
[DefaultValue]
attribute from the property to avoid other bugs):