-
-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,7 @@ function generateFieldMiddlewareFromRule( | |
const res = await rule.resolve(parent, args, ctx, info, options) | ||
|
||
if (res === true) { | ||
return resolve(parent, args, ctx, info) | ||
return await resolve(parent, args, ctx, info) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
angeloashmore
Author
Contributor
|
||
} else if (res === false) { | ||
return options.fallbackError | ||
} else { | ||
|
I don't think this is what you want to do here, but not completely sure.
I think by changing this, if the resolver throws an error, shield will now intercept it.
My code that I'm test looks like:
The code above was previously not intercepted by shield. Note that the login field is not even present in shields permissions.
My tests has now started to throw:
The test:
From what I understand is "Not Authorised!" a shiled thing.