Skip to content

Introduce SubscriptionFutureEntry GraphQL types

Mark Chao requested to merge 338657-graphql into master

What does this MR do and why?

Part of #338657 (closed)

Introduce GraphQL types and Resolvers for the future subscriptions, which mimic the existing license types. The queries are not used yet but will be needed for frontend related work.

Note: The first commit is just a refactoring of removing now unused logic.

How to set up and validate locally

  1. Open Rails console, insert the following into application settings:
      a = ApplicationSetting.current
      a.future_subscriptions = [{
           'cloud_license_enabled' => true,
           'plan' => 'ultimate',
           'name' => 'User Example',
           'email' => 'user@example.com',
           'company' => 'Example Inc.',
           'starts_at' => '2021-12-08',
           'expires_at' => '2022-12-08',
           'users_in_license_count' => 25
    
      }]
      a.save!
  2. Log in as admin
  3. Navigate to http://localhost:3000/-/graphql-explorer
  4. Query the future subscriptions with the following:
query {
  subscriptionFutureEntries {
    nodes {
      type
      plan
      name
      email
      company
      usersInLicenseCount
      startsAt
      expiresAt
    }
  }
}

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 #338657 (closed)

Edited by Mark Chao

Merge request reports