Record usage of deprecated GraphQL schema and surface to user

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem

The discovery of deprecation is currently limited to manual verification, documentation, and deprecation announcements.

GitLab already internally identifies the use of deprecated fields and arguments.

We can better surface this information to users of our GraphQL API.

Relates to: #353008 (closed).

Proposal

  • Record when deprecated schema is used in GraphQL
  • Use the query fingerprint to identify unique queries.
    • Where a fingerprinted query has already been recorded, update the last_seen_at timestamp and increment count of the existing record
    • Specific schema that is deprecated is recorded.
  • Associated with a PAT, project and group tokens
  • Surface the use of deprecated schema in UI
    • Either in PAT, Project and Group token areas or new area
  • Retain data for a period of time as we expect a lot of data

Example of what user might see:

Query Deprecated schema 14d count Last used Token
{ ... } Type.deprecatedField, Type.field.deprecatedArg 5,000 5m ago Link to token

We can correlate the schema with deprecation milestones.

Extensions

  • Alerts, notifications, or emails
  • For distributed apps, add the ability to register an app. When App ID is passed to requests we would have the records associated with the app rather than token. So the owner of the app, and not the users who use the app, are alerted to deprecated schema
Edited by 🤖 GitLab Bot 🤖