Language: TypeScript
Label: safe
CWE: CWE-400 \u2014 Uncontrolled Resource Consumption
The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.

Code:
function sameStreams(
  directives1: ReadonlyArray<DirectiveNode>,
  directives2: ReadonlyArray<DirectiveNode>,
): boolean {
  const stream1 = getStreamDirective(directives1);
  const stream2 = getStreamDirective(directives2);
  if (!stream1 && !stream2) {
    // both fields do not have streams
    return true;
  } else if (stream1 && stream2) {
    // check if both fields have equivalent streams
    return sameArguments(stream1, stream2);
  }
  // fields have a mix of stream and no stream
  return false;
}