Describe the bug
When both GraphQL API (amplify add api) AND amplify.addPluggable AWSIoTProvider are present in a project, an error occurs where the PubSub subscription no longer works.
To Reproduce
Steps to reproduce the behavior:

amplify add api command then amplify push

Expected behavior
Both GraphQL and PubSub should work together. It seems that once GraphQL is added, the Amplify.addPluggable information is never passed to the AWSIoTProvider.
Screenshots
Added in-line above.
Smartphone (please complete the following information):
Additional context
Current Package.json:
{
"name": "empty-project-template",
"main": "node_modules/expo/AppEntry.js",
"private": true,
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject"
},
"dependencies": {
"aws-amplify": "^1.1.8",
"aws-amplify-react": "^2.1.2",
"aws-amplify-react-native": "^2.0.8",
"expo": "^30.0.1",
"react": "16.3.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz"
}
}
You can turn on the debug mode to provide more info for us by setting window.LOG_LEVEL = 'DEBUG'; in your app.
Also adding the entire test app code and exports.js for your perusal:


Hi @kirkryan, thanks for the detailed feedback. We will investigate why the addPluggable information is not passed to the AWSIoTProvider.
This is related to #1404, #823 and possibly #1302
Thanks, @jordanranz - I also noticed that if you run amplify remove api, it remains broken.
I've found the fix! You simply have to edit your aws-exports.js and encapsulate the graphQL entries into an API Object as shown below:
Pre-fix configuration file:

Post-fix configuration file:

Solution: Amplify client should create the GraphQL configuration entries within an API object.
Thanks to Mattia for his post here: #1302
Nice work on coming up with a fix. We should be able to apply a permanent fix by adding this to the code that generates the aws-exports config. I'll pass this solution along so we can get this solution implemented. Thank you!
Most helpful comment
Nice work on coming up with a fix. We should be able to apply a permanent fix by adding this to the code that generates the aws-exports config. I'll pass this solution along so we can get this solution implemented. Thank you!