Skip to content

Commit 6d9be4e

Browse files
committed
cleaned up fixme comments where they were nelorger relevent
1 parent 9320314 commit 6d9be4e

File tree

5 files changed

+9
-12
lines changed

5 files changed

+9
-12
lines changed

src/analysis/ASTParser.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,12 @@ class ASTParser {
165165
// If the TypeCondition is omitted, an inline fragment is considered to be of the same type as the enclosing context
166166
const namedType = typeCondition ? typeCondition.name.value.toLowerCase() : parentName;
167167

168-
// TODO: Handle directives like @include
168+
// TODO: Handle directives like @include and @skip
169169
// subtract 1 before, and add one after, entering the fragment selection to negate the additional level of depth added
170170
this.depth -= 1;
171171
complexity += this.selectionSetNode(node.selectionSet, namedType);
172172
this.depth += 1;
173173
} else {
174-
// FIXME: Consider removing this check. SelectionNodes cannot have any other kind in the current spec.
175174
throw new Error(`ERROR: ASTParser.selectionNode: node type not supported`);
176175
}
177176

@@ -239,12 +238,12 @@ class ASTParser {
239238
complexity: fragmentComplexity,
240239
depth: this.maxDepth - 1, // subtract one from the calculated depth of the fragment to correct for the additional depth the fragment ads to the query when used
241240
};
242-
} else {
243-
// TODO: Verify that are no other type definition nodes that need to be handled (see ast.d.ts in 'graphql')
244-
// Other types include TypeSystemDefinitionNode (Schema, Type, Directvie) and
245-
// TypeSystemExtensionNode(Schema, Type);
246-
throw new Error(`ERROR: ASTParser.definitionNode: ${node.kind} type not supported`);
247-
}
241+
} // else {
242+
// // TODO: Verify that are no other type definition nodes that need to be handled (see ast.d.ts in 'graphql')
243+
// // Other types include TypeSystemDefinitionNode (Schema, Type, Directvie) and
244+
// // TypeSystemExtensionNode(Schema, Type);
245+
// throw new Error(`ERROR: ASTParser.definitionNode: ${node.kind} type not supported`);
246+
// }
248247
return complexity;
249248
}
250249

src/analysis/buildTypeWeights.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ function parseObjectFields(
190190
}
191191
}
192192
} else {
193-
// ? what else can get through here
193+
// FIXME what else can get through here
194194
throw new Error(`ERROR: buildTypeWeight: Unsupported field type: ${fieldType}`);
195195
}
196196
});

src/middleware/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import ASTParser from '../analysis/ASTParser';
2121
* , "depthLimit: number" will block queries with deeper nesting than the specified depth. Will not block queries by depth by default
2222
* @returns {RequestHandler} express middleware that computes the complexity of req.query and calls the next middleware
2323
* if the query is allowed or sends a 429 status if the request is blocked
24-
* FIXME: How about the specific GraphQLError?
2524
* @throws Error
2625
*/
2726
export default function expressGraphQLRateLimiter(

src/rateLimiters/tokenBucket.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class TokenBucket implements RateLimiter {
111111
timestamp: number
112112
): number => {
113113
const timeSinceLastQueryInSeconds: number = Math.floor(
114-
(timestamp - bucket.timestamp) / 1000 // 1000 ms in a second // FIXME: magic number if specifying custom timeframe
114+
(timestamp - bucket.timestamp) / 1000 // 1000 ms in a second
115115
);
116116
const tokensToAdd = timeSinceLastQueryInSeconds * this.refillRate;
117117
const updatedTokenCount = bucket.tokens + tokensToAdd;

src/utils/redis.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const clients: Redis[] = [];
88
*/
99
export function connect(options: RedisOptions): Redis {
1010
// TODO: Figure out what other options we should set (timeouts, etc)
11-
// TODO: pass on connection error
1211
try {
1312
const client: Redis = new Redis(options); // Default port is 6379 automatically
1413
clients.push(client);

0 commit comments

Comments
 (0)