Open nexterot opened 5 years ago
This was not obvious at all, and I too just spent several hours searching for a solution. Turns out, if you want to use your type with an Interface, you need to tell the schema about it in the SchemaConfig.Types
. So in your case, I think you'd need to change your schema definition to:
Schema, err = graphql.NewSchema(graphql.SchemaConfig{
Query: queryType,
Types: []graphql.Type[sectionType],
})
I don't know why, but that solved my problem perfectly.
Have same problem here, dont know how to solve. Had try @ki4jnq solution, but dont work on me.
Hello. I created a simple example according to testutil/testutil.go. But when running my example, I get constant error. Stuck for many hours trying to find out what's wrong with my piece of code.
main.go:
query:
error:
Any tips appreciated!