cmeeren / FSharp.HotChocolate

Support for F# types and nullability in HotChocolate
MIT License
7 stars 1 forks source link

Update for nullability changes in 15.0.0-p.12 #20

Open cmeeren opened 3 weeks ago

cmeeren commented 3 weeks ago

@michaelstaib, I'm having problems due to this change in 15.0.0-p.12, which removed some Option<_> unwrapping I was not aware was present in the core of HotChocolate.

I am trying to modify FSharp.HotChocolate to account for this (not committed/pushed yet). I am now removing Option wrappers myself, so now the field/argument types are correct (and correctly queryable), but the schema is still full of unused/unreachable types like this:

type FSharpOptionOfDouble {
  get_Value: Float!
  value: Float!
}

Again, these are unused/unreachable. For example, this particular type appears if I have a field that returns Option<double> (which, in the schema, is correctly typed as Float, not FSharpOptionOfDouble).

Why is that happening, and what can I do about it? (Apart from .TrimTypes(), which I obviously don't want to force on our users, and which doesn't fix the root issue.)

michaelstaib commented 3 weeks ago

Yes, we removed FSharp related code from the core as with your package we do not see need for ours. However we will have new hooks that you can tap into the core. However, at the moment we are just doing some realignment for the main project, so we kick things out but have not yet put any new things in.

cmeeren commented 3 weeks ago

Thanks for the quick reply! So there is nothing for me to do except wait for p.13 (or whichever release this will be present in)?

Could I bother you to post a comment here when and how I can use the new API?

michaelstaib commented 3 weeks ago

I still have to think about how we redesign the type inspection. We need to prepare the type inspection to allow for providers as we also want to use source generators for C# here, but for F# you might want to stay on the reflection API or tap into F# source generators once they arrive,

michaelstaib commented 3 weeks ago

Yes, nothing todo yet, I will ping you once we untangled the type inspection.