Browse Source

fix(core): Fix edge case in auth guard resolver detection

Michael Bromley 4 năm trước cách đây
mục cha
commit
b1903008d3
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      packages/core/src/api/middleware/auth-guard.ts

+ 2 - 2
packages/core/src/api/middleware/auth-guard.ts

@@ -156,7 +156,7 @@ export class AuthGuard implements CanActivate {
      * Query or Mutation resolver.
      */
     private isFieldResolver(info?: GraphQLResolveInfo): boolean {
-        const parentType = info?.parentType.name;
-        return parentType != null && parentType !== 'Query' && parentType !== 'Mutation';
+        const parentType = info?.parentType?.name;
+        return parentType !== 'Query' && parentType !== 'Mutation';
     }
 }