graphql-platform icon indicating copy to clipboard operation
graphql-platform copied to clipboard

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

Open cmeeren opened this issue 1 year ago • 13 comments

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

cmeeren avatar Feb 12 '24 09:02 cmeeren

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

michaelstaib avatar Feb 13 '24 00:02 michaelstaib

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 avatar Feb 13 '24 06:02 cmeeren

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?

cmeeren avatar Mar 26 '24 20:03 cmeeren