`gqlDocument` alters the case of GraphQL types and enum values
gqlDocument does not populate the typeOptions field of the GQLType instance of the generated types in a way that would allow them to preserve their casing.
import Data.ByteString.Lazy as BSL
import Data.Morpheus.Document
import Data.Morpheus.Server
import Data.Morpheus.Types
import Data.Proxy (Proxy(..))
[gqlDocument|
type Query {
foo(bar: order_by): Int!
}
enum order_by { asc, desc }
|]
main =
BSL.putStr $ printSchema $ Proxy @(RootResolver IO () Query Undefined Undefined)
This prints:
enum Order_by {
Asc
Desc
}
type Query {
foo(bar: Order_by): Int!
}
thanks @nicuveo, it is recommended in GQL that you don't use lowercase type-names. however the behavior is still wrong and worth to fixing it. do you want to fix it? i can give you some pointers, where to start.
I agree! But it is sometimes required to interface with existing / legacy systems that chose to use lowercase types. ^^
I don't have a lot of bandwidth, but I could try fixing it; if you have some pointers that'd be great!
@nicuveo sorry. i had to fix myself with new directives approach