Skip to content

Commit 5af6854

Browse files
committed
fix: query complexite for employee entity
1 parent 8d2b674 commit 5af6854

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

examples/northwind/models/employee.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ EmployeeTC.getResolver('pagination').extensions = {
7272
complexity: ({ args, childComplexity }) => childComplexity * (args.perPage || 20),
7373
};
7474
EmployeeTC.getResolver('findMany').extensions = {
75-
complexity: ({ args, childComplexity }) => childComplexity * (args.limit || 1000),
75+
complexity: ({ args, childComplexity }) => childComplexity * 100,
7676
};
7777

7878
const findManyResolver = EmployeeTC.getResolver('findMany').addFilterArg({
@@ -101,6 +101,9 @@ EmployeeTC.addRelation('chief', {
101101
sort: null,
102102
},
103103
projection: { reportsTo: true },
104+
extensions: {
105+
complexity: 1,
106+
},
104107
});
105108

106109
EmployeeTC.addRelation('subordinates', {
@@ -109,6 +112,9 @@ EmployeeTC.addRelation('subordinates', {
109112
filter: (source) => ({ reportsTo: source.employeeID }),
110113
},
111114
projection: { employeeID: true },
115+
extensions: {
116+
complexity: 1,
117+
},
112118
});
113119

114120
EmployeeTC.addRelation('orderConnection', {

0 commit comments

Comments
 (0)