graphql-go / relay

A Go/Golang library to help construct a graphql-go server supporting react-relay.
MIT License
424 stars 58 forks source link

"starwars" example currently broken #28

Open dsoprea opened 8 years ago

dsoprea commented 8 years ago

I have a handler PR that's failing in Travis because of the starwars example. It looks like the signature of the type-resolver function (ResolveTypeFn) changed here.

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 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.

amkoehler commented 8 years ago

29 fixed this for me. Has not been merged yet.

dsoprea commented 8 years ago

29 is a duplicate of #27. There's a few of us sitting on #27.

amkoehler commented 8 years ago

That's a more complete solution too. Thanks for the heads up.

dsoprea commented 8 years ago

In the obscure case of them actually progressing, it can't hurt to emphasize a specific bug.