graphql-go / graphql-go/graphql

iterables not working

Open
#366 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
10.1k
Forks
845
PR merge metrics
No merged PRs in 30d

Description

I am receiving this error when trying to get an array from a graphql query:
"User Error: expected iterable, but did not find one for field RootQuery.blogpostsBetween."
which is odd, since it has worked perfectly fine just a few weeks ago having my Field configured like this:

"blogpostsBetween": &graphql.Field{
Type: graphql.NewList(blogpostType),
Resolve: func(p graphql.ResolveParams) (interface{}, error) {
// ... some more code ...
// what I return here was placed to demonstrate the error.
return [5]Blogpost{}, err
},
Args: graphql.FieldConfigArgument{
"from": &graphql.ArgumentConfig{
Type: graphql.String,
},
"to": &graphql.ArgumentConfig{
Type: graphql.String,
},
},
},

I am really confused on why this is not working anymore, because as I said, I'm quite sure I have not changed anything. But I'd be happy to be wrong.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.