ChilliCream / graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
https://chillicream.com
MIT License
5.11k stars 726 forks source link

F# option-wrapped values are only nullable if inner type is a reference type #6884

Open cmeeren opened 5 months ago

cmeeren commented 5 months ago

Product

Hot Chocolate

Version

13.8.1

Link to minimal reproduction

See zip below

Steps to reproduce

Repro: HotChocolateRepro.zip

Code for quick reference (using HotChocolate.Types.FSharp with .AddFSharpTypeConverters():

type Foo = {
    A: string option
    B: int option
}

type Query() =
    member _.GetStuff(a: string option, b: int option) =
        { A = a; B = b }

What is expected?

This schema definition:

type Query {
  stuff(a: String, b: Int): Foo
}

type Foo {
  a: String
  b: Int
}

What is actually happening?

This schema definition:

type Query {
  stuff(a: String, b: Int!): Foo
}

type Foo {
  a: String
  b: Int!
}

Relevant log output

No response

Additional context

No response

michaelstaib commented 5 months ago

Can you open a PR with a snapshot test? Once the PR is there. I can help fix it.

cmeeren commented 5 months ago

Sure, can you point me in the right direction? Is there a test I can copy, and where should I place the new test?

cmeeren commented 4 months ago

Hi, just a reminder that I'm happy to contribute. Could you point me in the right direction? Is there a test I can copy, and where should I place the new test?