Skip to content

Add new GraphQL query getAddOnPurchases

This is part of #468438.

What does this MR do and why?

This MR adds a new GraphQL query/resolver which will eventually replace ee/app/graphql/resolvers/gitlab_subscriptions/add_on_purchase_resolver.rb. The idea is to return multiple active add-on purchase records for the namespace/instance instead of just one per request. The changes here will be used by !160561 (merged) which implements the actual consumption of this query's results.

In order to do this iteratively, this MR will only introduce the new resolver without referencing it. Later on, we can retire the obsolete query and resolver.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

N/A

How to set up and validate locally

Given the code here is not gonna be actively used until !160561 (merged), a green test suite is sufficient.

Or, alternatively:

  1. Start GDK
  2. Visit http://gdk.test:3000/-/graphql-explorer

For SM:

query getAddOnPurchases {
  addOnPurchases {
    id
    name
    assignedQuantity
    purchasedQuantity
  }
}

For GitLab.com:

query getAddOnPurchases {
  addOnPurchases(namespaceId: "gid://gitlab/Namespace/$ID") {
    id
    name
    assignedQuantity
    purchasedQuantity
  }
}
Edited by Paulo Barros

Merge request reports

Loading