vektah / gqlparser

A port of the parser from graphql-js into golang
MIT License
498 stars 123 forks source link

Bug in gqlerror.List.As() #281

Closed Metamogul closed 1 year ago

Metamogul commented 1 year ago

What happened?

When func (errs List) As(target interface{}) bool in gqlerror/error.go:100 is called, the target out argument is passed as pointer to errors.As() for each list element.

What did you expect?

To work as expected when being called from inside errors.As() and return the first instance matching the type of the target parameter, errors.As() has to be called with target, not &target.

Versions

v 2.5.9

Cause

The recent commit 450a0eed introduced this bug.