wrapFieldsWithMiddleware should recursively search ofType.
if i have something like this:
search: [Document]!
or this:
search: [[[[[Document!]]]]]!
Resolvers will not attach to fields below that point.
Here's the fix (for the wrapFieldsWithMiddleware function):
if (!!field && typeof field == 'object') {
field.resolve = resolveMiddlewareWrapper(field.resolve, field.directives);
var child = field.type
while (child.ofType) child = child.ofType
if (child._fields) wrapFieldsWithMiddleware(child._fields)
}
wrapFieldsWithMiddleware
should recursively searchofType
. if i have something like this:or this:
Resolvers will not attach to fields below that point.
Here's the fix (for the
wrapFieldsWithMiddleware
function):