Heat your oven to 200°C/Fan 180°C/Gas 6. Halve the pattipan squash and chop into 2cm-thick chunks (you can eat the skin, so no need to peel). Tumble the squash onto a baking tray. Drizzle over 1 tbsp olive oil and a pinch of salt and pepper. Slide into the oven and roast for 30 mins till golden and softened. Toss halfway through.
While the squash roasts, finely slice the sun dried tomatoes. Pop them in a jug. Crumble in the stock cube. Pour in 500ml boiling water, stir and set aside to let the tomatoes to soften.
Peel and finely chop the onion. Peel and crush 1 garlic clove. Roughly chop half the heirloom tomatoes. Heat a large pan for 2 mins. Drizzle in ½ tbsp olive oil. Add the onion, season with salt and pepper and cook for 5 mins, stirring, till softened. Add the garlic and chopped tomatoes. Cook for 3 mins till the tomatoes have broken down a little.
Tip the risotto rice into the pan and stir. Pour in the sun dried tomatoes and stock. Stir, turn the heat to low and pop on a lid. Very gently cook for 20 mins, till the water has been absorbed and the rice is tender. Stir every now and then, adding a little more water if necessary.
While the risotto is cooking, make the walnut pesto. Set a dry frying pan on the heat. Add the walnut halves and toast for 2-3 mins till slightly darkened and fragrant Tip onto a chopping board and cool for a few mins, then finely chop them.
Pull the leaves from the thyme stalks. Peel and grate the remaining garlic clove. Zest the lemon and squeeze the juice. Add everything to a bowl with ½ tbsp olive oil and some seasoning. You can also pop everything into a food processor, if you have one, and pulse for a smoother pesto.
Halve or quarter the remaining heirloom tomatoes, depending on size. Chop the spinach.
Remove the squash from the oven. Taste the risotto. The rice should be soft with a slight bite. Season, if you think it needs it. Tip in most of the squash and all the spinach. Add the butter. Stir and pop on the lid for 1 min, to wilt the spinach.
Spoon the risotto into warm bowls. Top with the remaining squash, the heirloom tomatoes and a spoonful of the walnut pesto. Cut the lemon half into wedges and squeeze over to taste. Serve straight away.