How do I make a function that accepts numVertices and numEdges then ALWAYS generates a connected graph?
I don't know about existing libraries but this is a solution from scratch. Suppose you have n nodes and m edges. To generate a simple (no duplicate edge), connected graph, m, n must satisfy this condition: 
n - 1 <= m <= n * (n - 1) / 2
Process (nodes are indexed from 0 to n - 1):

Generate a spanning tree to make sure the graph is connected. There are many ways (for example, Prufer sequence), but here is a simple way:

for i = 1 to n - 1:
     add_edge(i, randint(0, i - 1))

To make it look more random, you can shuffle the order of nodes first.

Add more edges until you have m edges.

while there are less than m edges:
     a, b = randint(0, n - 1), randint(0, n - 1)
     if (a != b and edge(a, b) has not existed):
        add_edge(a, b)

Note: randint(a, b) = a random integer in range [a, b].
The codes look simple but work very fast in practice. You can calculate expected number of iterations to see why.
I want to generate a connected, undirected graph that contains n vertices and m edges. In particular, I want to generate a graph with nodes that contain exactly one of each integer from 0 to n - 1.
I've looked somewhat deeply on this site and could not find what I was looking for. I will appreciate any help offered. Thanks!