I'm new to aws amplify. I have setup an app using amplify and I have an API that is returning records using GraphQl. I have created a subscription that is supposed to be triggered when creating a new blog entry. The entries are being created. In the documentation https://aws-amplify.github.io/docs/js/api the code samples suggest that I can use the following to subscribe to a mutation. I keep getting an error stating that error TS2339: Property 'subscribe' does not exist on type '{}'. It's coming from the assignment of client. I'm not sure why its saying this and I was hoping that you would be able to help me with this error.
import { onCreateBlog } from './graphql/subscriptions';
//GraphQl subscription
export const onCreateBlog = `subscription OnCreateBlog {
onCreateBlog {
id
name
posts {
items {
id
title
}
nextToken
}
}
}
`;
//ngInit function with an async method
ngOnInit() {
(async () => {
let client = Amplify.configure(awsmobile); // error from here
let subscription = client.subscribe(graphqlOperation(subscriptions.onCreateBlog)).subscribe({
next: data => {
console.log(data);
},
error: error => {
console.warn(error);
}
});
})();
}