client
variable.id
in Kana for both Objects.
id
of both:
Create Users
Create Packages
We will work on the assumption that you have pulled the following user and have all the following details to hand:
id
for the plan
in the details we have provided. We’re therefore going to need to fetch the id
of the plan the user is subscribing to from Kana.
plans
hash) so we can filter by this when when iterating over the returned plans.
We also need to ensure that the id
of the plan is captured in an array as an integer. This is what the subscribe mutation requires.
The following should do the trick:
id
is inserted into the given array.id
of the user and the id
of the plan are now accessible. We’re ready to send the request to subscribe the user to the plan.
We do this through the subscribe mutation. This requires two arguments:
userId
argument to be a String - as this matches the id
on the User object. If any other field type is used, an error will occur telling you we can’t accept any field type except String.id
of the plan now in an array as fetched from the previous step.
We’ll define these as variables to send alongside the query:
name
of the plan (which helps in confirming it’s correct)
isAddon
boolean
features
associated to the plans - with their name
, type
and limit