Objective
Give the legacy GraphQL KeyPair type an honest field for the owner's email and deprecate user_id, before BA-7206 changes what the column behind it holds.
Background
BA-7206 consolidates the two owner columns on keypairs into one named user_id holding users.uuid. Its acceptance criteria say "No API field changes — KeyPairNode.user_id and the v2 DTO already carry the uuid." That is true of the v2 stack, and false of the legacy graphene type.
gql_legacy/keypair.py declares user_id = graphene.String() and KeyPair.from_row fills it straight from row.user_id — the String(256) column holding the user's email. The uuid is exposed separately as user = graphene.UUID(). So the legacy type already carries both values, under names that read backwards.
When BA-7206 repoints the column, KeyPair.user_id silently changes from an email address to a uuid. No deprecation, no replacement, no release where a client can see both.
The value is also stale by construction — nothing keeps keypairs.user_id in step with users.email — while the legacy keypair queries already join users and select users.email, so the correct value is in hand.
Acceptance Criteria
- Legacy GraphQL
KeyPair gains user_email, sourced from the joined users.email rather than the keypairs copy, with an "Added in" description.
KeyPair.user_id is deprecated with a reason naming user_email for the email and user for the owner's uuid.
- The GraphQL schema dumps are regenerated.
- No behaviour change for existing clients:
user_id keeps returning what it returns today.
Notes
- Lands before BA-7206, which is then free to repoint the column.
- Same shape as the marker's API pairing: ship the replacement, deprecate the old field, change the schema in a later release.
- Roughly 30 lines plus the regenerated dumps.
Objective
Give the legacy GraphQL
KeyPairtype an honest field for the owner's email and deprecateuser_id, before BA-7206 changes what the column behind it holds.Background
BA-7206 consolidates the two owner columns on
keypairsinto one nameduser_idholdingusers.uuid. Its acceptance criteria say "No API field changes — KeyPairNode.user_id and the v2 DTO already carry the uuid." That is true of the v2 stack, and false of the legacy graphene type.gql_legacy/keypair.pydeclaresuser_id = graphene.String()andKeyPair.from_rowfills it straight fromrow.user_id— theString(256)column holding the user's email. The uuid is exposed separately asuser = graphene.UUID(). So the legacy type already carries both values, under names that read backwards.When BA-7206 repoints the column,
KeyPair.user_idsilently changes from an email address to a uuid. No deprecation, no replacement, no release where a client can see both.The value is also stale by construction — nothing keeps
keypairs.user_idin step withusers.email— while the legacy keypair queries already joinusersand selectusers.email, so the correct value is in hand.Acceptance Criteria
KeyPairgainsuser_email, sourced from the joinedusers.emailrather than thekeypairscopy, with an "Added in" description.KeyPair.user_idis deprecated with a reason naminguser_emailfor the email anduserfor the owner's uuid.user_idkeeps returning what it returns today.Notes