Browse Source

scoper on find query.by default adds limit 100

Ivan Asmer 4 years ago
parent
commit
00e1e1d8ec
1 changed files with 1 additions and 0 deletions
  1. 1 0
      expand.js

+ 1 - 0
expand.js

@@ -4,6 +4,7 @@ const bound       = 100;
 function mmExpandSchema(gqlSchema, defaultQueryFields, defaultMutationFields, scoper){
     function scoperTest(query,cursorCalls={limit:[limitValue=100]}) {
         console.log(limitValue, cursorCalls)
+        if (!Number.isNumber(limitValue) || limitValue <= 0 || limitValue > 100) cursorCalls.limit[0] = 100;
         return [query, cursorCalls]
     }
     scoper=scoper || scoperTest