title: encoding and decoding base64.in aws appsync resolver
body: <p>I have a resolver that receives an argument &quot;nextToken&quot; ($ctx.args.nextToken) which will be in base64 string.  In the request mapping template, I need to convert nextToken from base64 string into ascii string.  I know that Appsync has $util.base64Decode(String) : byte[] but this function gives back byte[] but I want back an ascii string.</p>
  <p>In addition, I will need to create base64 string from ascii string in the response mapping template.  Again Appsync provides a function $util.base64Encode( byte[] ) : String but I don't know how to change my ascii string into byte[].</p>
  <p>Anybody has any idea how to handle both situations.  Thanks in advance.</p>