graphql-go / graphql-go/graphql

Using pointers with Enum types results in nils

Open
#205 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
10.1k
Forks
845
PR merge metrics
No merged PRs in 30d

Description

This is an extension of the issue highlighted by #114, and subsequently unintentionally fixed in #199. Specifically, the use of a pointer in a response type results in no resolution when e.g. serializing an Enum type.

Example, an Enum type of:

```go
var enum = graphql.NewEnum(graphql.EnumConfig{
Name: "MyEnum",
Values: graphql.EnumValueConfigMap{
"first-enum": &graphql.EnumValueConfig{Value: 1}
}
}
````

...used with a response struct as follows:

```go
type Response struct {
MyEnum *int
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.