(initialCount = 0)
| 88 | } |
| 89 | |
| 90 | createMutationTracker(initialCount = 0): MutationTracker { |
| 91 | const maxCount = Number(env['MAX_BATCH_MUTATION']); |
| 92 | let mutationCount = initialCount; |
| 93 | return { |
| 94 | trackMutations(count: number) { |
| 95 | mutationCount += count; |
| 96 | |
| 97 | if (mutationCount > maxCount) { |
| 98 | throw new InvalidPayloadError({ reason: `Exceeded max batch mutation limit of ${maxCount}` }); |
| 99 | } |
| 100 | }, |
| 101 | getCount() { |
| 102 | return mutationCount; |
| 103 | }, |
| 104 | }; |
| 105 | } |
| 106 | |
| 107 | async getKeysByQuery(query: Query): Promise<PrimaryKey[]> { |
| 108 | const primaryKeyField = this.schema.collections[this.collection]!.primary; |
no outgoing calls
no test coverage detected