Skip to content

Commit

Permalink
Properly infer the enum values from GraphQL SDL
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib committed Oct 22, 2020
1 parent cb93922 commit 27c0fac
Showing 1 changed file with 6 additions and 5 deletions.
Expand Up @@ -56,13 +56,14 @@ internal sealed class EnumTypeFactory
foreach (EnumValueDefinitionNode value in values)
{
IEnumValueDescriptor valueDescriptor =
typeDescriptor.Value(value.Name.Value)
.Description(value.Description?.Value);
typeDescriptor
.Value(value.Name.Value)
.Description(value.Description?.Value)
.Name(value.Name.Value);

string deprecactionReason = value.DeprecationReason();
if (!string.IsNullOrEmpty(deprecactionReason))
if (value.DeprecationReason() is { Length: > 0 } s)
{
valueDescriptor.Deprecated(deprecactionReason);
valueDescriptor.Deprecated(s);
}

foreach (DirectiveNode directive in value.Directives)
Expand Down

0 comments on commit 27c0fac

Please sign in to comment.