We've all seen 'em. Are they doable? Doing it with Babel gives you a "temporal dead zone" & the type is undefined.
const PersonType = new GraphQLObjectType({
name: "Person",
friends: {
type: new GraphQLList(PersonType),
resolve: () { ... },
}
});
You can wrap the fields in a function, which should help:
const PersonType = new GraphQLObjectType({
name: "Person",
fields: () => ({
friends: {
type: new GraphQLList(PersonType),
resolve() { ... },
},
}),
});
Whoa, say WHAT!? That's useful!
I'll re-open if that doesn't work.
Thanks!
Most helpful comment
You can wrap the
fieldsin a function, which should help: