Skip to content

Add query param to remove deprecated GraphQL schema items

What does this MR do and why?

Allows to pass the remove_deprecated=true query parameter to GraphQL API requests to remove all deprecated schema items for the respective request. This can be useful to check existing GraphQL calls against the schema without any deprecated fields.

Screenshots or screen recordings

N/A

How to set up and validate locally

  1. Create a GraphQL query with some deprecated fields, arguments or enum values, e.g.
    {
      users(first: 5) {
        edges {
          node {
            id
            email
            publicEmail
          }
        }
      }
    }
    email is a deprecated field here
  2. Run this query against the GraphQL API: POST http://localhost:3000/api/graphql -> Should work without issues
  3. Run this query again using the remove_depreacted=true query parameter: POST http://localhost:3000/api/graphql?remove_deprecated=true -> Should fail because email is no longer an existing field

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #353642 (closed)

Merge request reports