You cannot write directly to a GSI. You write to a main table which is then synced with all GSIs.
From the official docs