import gql from 'graphql-tag';

import { errorFragment } from '../fragments/error';
import { profileFragment } from '../fragments/profile';

export const CHANGE_RATEPLAN = gql`
  mutation changeRateplan($input: ChangeRateplanInput!, $subscriptionId: ID) {
    changeRateplan(input: $input, subscriptionId: $subscriptionId) {
      subscription {
        ...ProfileFragment
      }
      error {
        ...ErrorFragment
      }
    }
  }
  ${errorFragment}
  ${profileFragment}
`;

export const CHANGE_SUBSCRIPTION_RATEPLAN = gql`
  mutation changeSubscriptionRateplan($input: ChangeRateplanInput!, $subscriptionId: ID) {
    changeSubscriptionRateplan(input: $input, subscriptionId: $subscriptionId) {
      subscription {
        ...ProfileFragment
      }
      error {
        ...ErrorFragment
      }
    }
  }
  ${errorFragment}
  ${profileFragment}
`;
