code: function createNonRecoverableUserError(
    message: string,
    locations?: ?$ReadOnlyArray<Location>,
    nodes?: ?$ReadOnlyArray<ASTNode>,
  ): NonRecoverableUserError {
    let messageWithLocations = message;
    if (locations != null) {
      const printedLocations = printLocations(locations);
      messageWithLocations =
        printedLocations.length === 0
          ? message
          : [message, ...printedLocations].join('\n\n') + '\n';
    }
    const error = new GraphQLError(messageWithLocations, nodes ?? []);
    return new Error(error.message);
  }
docs: Similar to createUserError but for errors that are *not* recoverable:
  the compiler should not continue to process other inputs because their
  validity can't be determined.