Couldn't find any info on the underscore parameter seen in the examples and is undefined when logged.
What's it for?
const resolvers = {
Query: {
hello: (_, { name }) => `Hello ${name || 'World'}`,
},
}
It's a placeholder for parent. In field-level resolvers, it contains the results of the parent resolver.
The full signature for a resolver function is (parent, args, context, info) => {}
Ah gotcha - thanks @kbrandwijk, makes sense!
Most helpful comment
It's a placeholder for
parent. In field-level resolvers, it contains the results of the parent resolver.The full signature for a resolver function is
(parent, args, context, info) => {}