My grandmother had dementia for a couple of years before she passed away and it was heartbreaking to watch her mentally decline when she had been so active and lively previously. I commend you for looking to spend time with your grandmother when she can't respond to you.
When my grandmother grew older, but still could communicate, she expressed frustration at not being able to continue her hobbies. She loved to garden, sew, bake, and read her bible. As time went on, she took great delight in doing her hobbies "through" me, where I would sew/bake and she would give me instruction, and later just enjoy watching me.
She took great delight in watching me do things that she used to enjoy doing herself. I used these things to remain connected to her even when she couldn't communicate with me and when she wasn't living with us anymore. I'd visit her and take things with me to show her. My latest sewing project, a flower I picked in the garden, some cookies I baked that were her recipe. Even though she couldn't see, she would hold the things close to see them better and feel the texture of the material in her fingers, she'd smile at the bright colors of the flowers or fabric I'd chosen. Since she couldn't speak, or even hear, well I tried to use her other senses too.
So even if you can't communicate with her, find out what she liked before. What were her hobbies? What did she do with her time? What was her favourite colour? Speak to your family members and ask them about who she is, and then see if you can take her something related to those things. A bright flower from the garden, a book with big pictures of her favourite hobby. Choose big, bright, happy, tactile objects that she can recognise, that remind her of what she used to do, and talk to her about them.
I look back with such happy memories with my grandmother and I so commend you on taking the time to spend time with yours even though this relationship can feel very one-sided. I'm very glad I spent time with mine when I had the chance.