Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data/schema.go:44: cannot use func literal #5

Open
johanoskarsson opened this issue Oct 27, 2016 · 2 comments
Open

data/schema.go:44: cannot use func literal #5

johanoskarsson opened this issue Oct 27, 2016 · 2 comments

Comments

@johanoskarsson
Copy link

Attempted to follow the instructions but I get the following error. I assume something changed in graphql-go?

$ go get -v
github.com/graphql-go/handler (download)
github.com/graphql-go/handler
github.com/sogko/golang-relay-starter-kit/data

github.com/sogko/golang-relay-starter-kit/data

data/schema.go:44: cannot use func literal (type func(interface {}, graphql.ResolveInfo) *graphql.Object) as type graphql.ResolveTypeFn in field value

@lei314121077
Copy link

I have also encountered the same problem

@lei314121077
Copy link

I solved the problem,this is my code.
TypeResolve: func(p graphql.ResolveTypeParams) *graphql.Object {
switch p.Value.(type) {
case *User:
return userType
case *Widget:
return widgetType
}
return nil
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants