Dhruvvvv
Hey, I was in a similar situation last year! If your study permit is still valid when you leave, you might be allowed back in, but it also depends on your visa (TRV or eTA). Also, once you graduate, your student status technically ends, so re-entering just on a study permit could be tricky.
