User's Restrictions
Update a user's food restrictions (food preferences).
Last updated
Update a user's food restrictions (food preferences).
Last updated
Use the profileRestrictionsUpdate
mutation to update a user's food restrictions.
A list of all the available food restrictions can be retrieved using the Restrictions query.
Vegan and vegetarian are very common use cases, for those, please set the following restrictions:
For vegetarian, activate the R Animal Origin (non-vegetarian) restriction. Id: UmVzdHJpY3Rpb246ZDY3NTA1MTktZTE4Zi00NWRkLTgxZWYtODAyNzk0MzYyZWRl
For vegan, activate the R Animal Origin (all) restriction, Id: UmVzdHJpY3Rpb246YzhmODQwMmMtYzEyNi00OWM3LWEyMzEtNWNmNjI0ZDlmNTlj
The following example adds two restrictions to the current user's profile:
Note that the replace argument is not defined; therefore, those will be the only two restrictions set to the current user's profile.
Validate that the restrictions are successfully updated using the My Profile query to obtain a list of restrictions currently set to the user's profile.
In the following example, the replace argument is set as False:
Use the My Profile query to obtain a list of restrictions currently set to the user's profile. See that the new restriction has been added to the list of user's restrictions:
Arguments
Type
Description
restrictions
[ID]
Array of restrictions ID's
Argument
Type
Description
replace
Boolean
If true, the profile restrictions are set to only the IDs sent in the mutation. If false, the restrictions received are added to the current ones. If this argument is not sent, by default its value will be set to True.