If the relative pronoun refers to an idea or to a group
of words or to the word alles,
the relative pronoun is was
and does not require any declension.
Er
machte alles, was sie
wollten, was ein
Fehler war. = He did everything that they wanted,
which
was a mistake.