import all0 from "/src/fragments/guides/api-graphql/common/subscriptions-by-id.mdx";

<Fragments fragments={{all: all0}} />

```js
import { API } from 'aws-amplify';
import { onCommentByPostId } from './graphql/subscriptions';

API.graphql({
  query: onCommentByPostId,
  variables: {
    postCommentsId: "12345"
  }
})
.subscribe({
  next: data => {
    console.log('data: ', data)
  }
})
```