Closed thatvineyard closed 1 year ago
I did try using --classMapping <classMapping>
but it didn't work since it's a scalar and not a type
Ok, the source generator has option to specify custom scalar types using RegexScalarFieldTypeMappingProvider.gql.config.json
file. I could add similar option for using the console tool. So you can then define rules like
[
{
"patternBaseType": ".+",
"patternValueType": "^Time$",
"patternValueName": ".+",
"netTypeName": "DateTime?",
"formatMask": null
}
]
and use the file as an input parameter.
Does this sound good?
Yeah that sounds like a good solution!
use --regexScalarFieldTypeMappingConfigurationFile <fileName>
Hi, love the tool so far and am inspired by the amount of work you put into it 😊
I'm admittedly a bit out of my depth since I know nothing about c# source generation generation, but I've been using
dotnet tool run graphql-client-generator ...
to generate files and it's been working great for the majority of files generated!Unfortunately the schema I'm generating from has a custom scalar called
Time
which results in aobject
type in the generated code, and I was wondering if there is support to map this scalar to aDateTime
using the cli command.I saw this issue #73 and saw that there was support for this when using source generation, but not when using the CLI.
I'm using version
0.9.13
of the dotnet tool.