-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroles_list.patch
24 lines (22 loc) · 1005 Bytes
/
roles_list.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
diff --git a/packages/graphql/src/translate/create-auth-and-params.ts b/packages/graphql/src/translate/create-auth-and-params.ts
index 592272c60..14aec1b8d 100644
--- a/packages/graphql/src/translate/create-auth-and-params.ts
+++ b/packages/graphql/src/translate/create-auth-and-params.ts
@@ -503,7 +503,18 @@ function createAuthField({
}
const isNotNull = Cypher.isNotNull(fieldPropertyRef);
- const equalsToParam = Cypher.eq(fieldPropertyRef, param);
+ // const equalsToParam = Cypher.eq(fieldPropertyRef, param);
+
+
+ const equalsToParam = Cypher.in(fieldPropertyRef, param);
+
+ const roleVar = new Cypher.Variable();
+ const rolesList = new Cypher.Literal(param.value);
+ const roleInParamPredicate = isValueInListCypher(roleVar, fieldPropertyRef);
+ const rolesInListComprehension = Cypher.any(roleVar, rolesList, roleInParamPredicate);
+
+ return Cypher.and(isNotNull, rolesInListComprehension);
+
return Cypher.and(isNotNull, equalsToParam);
}