aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.44k stars 2.13k forks source link

feat(api-graphql): return entire payload in callback #13980

Closed iartemiev closed 2 weeks ago

iartemiev commented 2 weeks ago

Description of changes

Given the following incoming subscription message

{
  "id":"ca7ba14c-e71a-45bf-b121-47a578b7c162",
  "type":"data",
  "event":"{\"some\":\"data\"}"
}

Old

channel.subscribe({
  next: (data) => console.log(data);
/*
{ some: "data" }
*/
})

New

channel.subscribe({
  next: (data) => console.log(data);
/*
{
  id: "ca7ba14c-e71a-45bf-b121-47a578b7c162",
  type: "data",
  event: { some: "data" }
}
*/
})

Description of how you validated changes

Checklist