thunder
thunder copied to clipboard
graphql.HTTPHandler leaks unwanted fields
When using Pagination, the graphql.HTTPHandler() leaks an additional "__key: ..." field on the resulting edges which is not wanted.
Current quickfix: use diff.StripKey(value) on the resulting value...
func (h *httpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
writeResponse := func(value interface{}, err error) {
response := httpResponse{}
if err != nil {
response.Errors = []string{err.Error()}
} else {
response.Data = diff.StripKey(value)
}
...
Not sure if this is the best solution, but for the moment it suffices.
Any help on a permanent fix would be greatly appreciated.
Many thanks for putting together this package.
Cheers
cc/ @berfarah