In a medium saucepan, combine the raspberries, water, lemon juice, and sugar. Bring to a gentle simmer over medium heat, stirring occasionally, until the berries have softened and the sugar has dissolved, about 10 minutes.
For a seedless sauce, press the mixture through a fine-mesh sieve, then return the sauce to the saucepan. If you don't mind the seeds, skip this step.
Whisk together the cornstarch and cold water until smooth. Slowly whisk the slurry into the raspberry sauce.
Cook over medium heat, whisking constantly, for 3–5 minutes, or until the sauce has thickened.
If you'd like a thicker filling, prepare an additional slurry and add it a little at a time, allowing the sauce to come back to a simmer before adding more. The sauce will continue to thicken as it cools.
Cool completely before using as a filling, or refrigerate in an airtight container for up to 1 week.