Closed bsr203 closed 8 years ago
:+1: for this. After working with graphql-go for the last few weeks, I feel this is something that's quite necessary.
Because we are switching on resolvedID.Type
and resolvedID.ID
and using that to fetch the model, if the model fails to fetch, we need to return an error instead.
@sogko Any comments on this one?
@F21 Thanks for bringing this up. Actually this does make sense, since we already have a way to return error within graphql-go
.
I'll go ahead and submit a PR soon.
Thanks!
Currently, there is no way to return an error from
idFetcher
function.error
return type of the resolve methos is not used https://github.com/graphql-go/relay/blob/master/node.go#L56We should be changing the type from
so we can return the error from IDFetcher by just returning
https://github.com/graphql-go/relay/blob/master/node.go#L64 could be just