graphql-go / graphql-go/relay

"starwars" example currently broken

Open
#28 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
423
Forks
54
PR merge metrics
No merged PRs in 30d

Description

I have a _handler_ PR that's failing in Travis because of the _starwars_ example. It looks like the [signature](https://github.com/graphql-go/relay/blob/master/examples/starwars/schema.go#L121) of the type-resolver function (_ResolveTypeFn_) changed [here](https://github.com/graphql-go/graphql/commit/1e33c35ba9684a3ca02bf0de8b24688636cd3295#diff-69bc5d6dcb9b6d3b947f0118b7180038R713).

The signature of _ResolveTypeFn_ is now "(p ResolveTypeParams) *Object" but the function is currently defined as:

```
},
TypeResolve: func(value interface{}, info graphql.ResolveInfo) *graphql.Object {
// based on the type of the value, return GraphQLObjectType
switch value.(type) {
case *Faction:
```

As a result, the [test](https://travis-ci.org/graphql-go/handler/builds/155928361#L194) is currently showing:

```
$ $HOME/gopath/bin/goveralls -service=travis-ci
exit status 2: # github.com/graphql-go/relay/examples/starwars
../relay/examples/starwars/schema.go:129: cannot use func literal (type func(interface {}, graphql.ResolveInfo) *graphql.Object) as type graphql.ResolveTypeFn in field value
FAIL github.com/graphql-go/handler [build failed]
```

I'm not in a place that I can currently fix it. I also risk destabilizing the example because I believe you can now get the content of the old `value` argument from the new `p` (_ResolveTypeParams_) argument but I am new to GraphQL and don't know that I can effectively test it before committing.

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.