import gql from 'graphql-tag';

import { errorFragment } from '../fragments/error';
import { usageFragment } from '../fragments/usagepack';

export const ADD_SERVICEPACK = gql`
  mutation addServicepack($input: ServicepackInput!, $subscriptionId: ID) {
    addServicepack(input: $input, subscriptionId: $subscriptionId) {
      user {
        ...UsageFragment
      }
      error {
        ...ErrorFragment
      }
    }
  }
  ${errorFragment}
  ${usageFragment}
`;

export const REMOVE_SERVICEPACK = gql`
  mutation removeServicepack($input: ServicepackInput!, $subscriptionId: ID) {
    removeServicepack(input: $input, subscriptionId: $subscriptionId) {
      user {
        ...UsageFragment
      }
      error {
        ...ErrorFragment
      }
    }
  }
  ${errorFragment}
  ${usageFragment}
`;
