dotansimha / dotansimha/graphql-code-generator-community
Update C#-Operations Docs
- Dominant language
- TypeScript
- Stars
- 137
- Forks
- 195
- Avg merge
- 6h 20m
- Merged PRs (30d)
- 16
Description
Currently Enums are not properly serialized when the standard Newtonsoft Serializer is used.
Solution:
```c-sharp
public sealed class GraphQLEnumConverter : StringEnumConverter
{
public GraphQLEnumConverter()
: base(new PascalCaseNamingStrategy())
{
}
}
internal sealed class PascalCaseNamingStrategy : NamingStrategy
{
protected override string ResolvePropertyName(string name) => name;
}
GQLClient = new GraphQLHttpClient(new GraphQLHttpClientOptions
{
EndPoint = new Uri(EndpointHttp)
}, new NewtonsoftJsonSerializer(new JsonSerializerSettings
{
Converters = new List{
new StringEnumConverter(new PascalCaseNamingStrategy())
}
}));
```
This should be added to the docs.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.