-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
Tried adding a directive to a field
type Article {
id: ID!
authorId: ID!
authorName: String!
articleName: String!
link: String! @hasScope(scope: ["write:articles"])
review: Review
}...but it throws on oldResolve.call as it does not have a field.resolve.
graphql-auth/directives/index.js
Lines 68 to 72 in 8d47457
| field.resolve = function() { | |
| const [source, _, context, info] = arguments; | |
| let promise = oldResolve.call(field, ...arguments); | |
| const isPrimitive = !(promise instanceof Promise); |
I'm not sure what would be appropriate here (have never built a graphql server before).
Made it work by making the following additions:
const {defaultFieldResolver} = require('graphql');
// ...
let promise = oldResolve ? oldResolve.call(field, ...arguments) : defaultFieldResolver.call(field, ...arguments)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels