subscribeMutationsGenerator = (collection) => {

   // generic mutation function calling the performSubscriptionAction
   const genericMutationFunction = (collectionName, action) => {
     // return the method code
     return function(root, { documentId }, context) {
       
       // extract the current user & the relevant collection from the graphql server context
       const { currentUser, [Utils.capitalize(collectionName)]: collection } = context;
       
       // permission check
       if (!Users.canDo(context.currentUser, `${collectionName}.${action}`)) {
         throw new Error(Utils.encodeIntlError({id: 'app.noPermission'}));
       }
       
       // do the actual subscription action
       return performSubscriptionAction(action, collection, documentId, currentUser);
     };
   };

   const collectionName = collection._name;
   
   // add mutations to the schema
   addGraphQLMutation(`${collectionName}Subscribe(documentId: String): User`),
   addGraphQLMutation(`${collectionName}Unsubscribe(documentId: String): User`);
   
   // create an object of the shape expected by mutations resolvers
   addGraphQLResolvers({
     Mutation: {
       [`${collectionName}Subscribe`]: genericMutationFunction(collectionName, 'subscribe'),
       [`${collectionName}Unsubscribe`]: genericMutationFunction(collectionName, 'unsubscribe'),
     },
   });
   
   
 }
@summary Generate mutations 'collection.subscribe' & 'collection.unsubscribe' automatically
@params {Array[Collections]} collections