dotansimha / dotansimha/graphql-code-generator-community

Update C#-Operations Docs

Open
#98 1 comment 0 reactions 0 assignees View on GitHub
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.