Closed elliott-king closed 5 years ago
Stack trace:
error uploading image: Error: "Network error: GraphQL error: Missing credentials in config"
ApolloError webpack:///./node_modules/apollo-client/errors/ApolloError.js?:40
error webpack:///./node_modules/apollo-client/core/QueryManager.js?:217
notifySubscription webpack:///./node_modules/zen-observable/lib/Observable.js?:134
onNotify webpack:///./node_modules/zen-observable/lib/Observable.js?:165
error webpack:///./node_modules/zen-observable/lib/Observable.js?:224
notifySubscription webpack:///./node_modules/zen-observable/lib/Observable.js?:134
onNotify webpack:///./node_modules/zen-observable/lib/Observable.js?:165
error webpack:///./node_modules/zen-observable/lib/Observable.js?:224
discard webpack:///./node_modules/aws-appsync/lib/link/offline-link.js?:397
discard webpack:///./node_modules/aws-appsync/lib/store.js?:142
discard webpack:///./node_modules/aws-appsync/lib/store.js?:98
node_modules Redux
Babel 11
tryCatch
invoke
method
step
default
Promise
default
node_modules
run
notify
flush
I resolved this by not using the S3Object AppSync method.
Instead, I simply took two steps:
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help
channels or Discussions for those types of questions.
Which Category is your question related to? GraphQL AppSync, and S3 Uploads with Complex Objects.
What AWS Services are you utilizing? AWS Amplify with:
Describe the bug I am attempting to follow the add complex objects tutorial for amplify & appsync. However, I am getting an error:
Network error: GraphQL error: Missing credentials in config
.To Reproduce You may notice that I had a previous issue (#3243). The code is mostly the same, although my debugging steps are different.
Relevant section of schema.graphql:
When I
amplify push
this, it correctly creates the CreatePhotoInput in the Appsync Graphql API:Here is my auth handler:
And the bit where I actually call the mutation Note that previously, the client was instantiated in the function. It is now passed into the component as a prop. I was instantiating multiple clients at a time in my code, and I think the fix to my previous issue did not like that (probably for the best).
The
catch
catches:Error: "Network error: GraphQL error: Missing credentials in config"
NPM dependencies
Note that the
file:aws-appsync
dependency implements the fix for my previous issue.Expected behavior I expect a file to go to S3, and and corresponding entry in the DynamoDB table connected to the createPhoto mutation.
Desktop (please complete the following information):
Debugging steps I took You can see some of the initial steps I took in my previous issue. In addition, I did the following:
I removed then replaced the
auth
api
andstorage
aspects, and pushed new ones.I also updated
amplify
itself globally.If I comment out the
file
field in the mutation, it uploads to DynamoDB but not S3.I tried adding
authmode: 'AMAZON_COGNITO_USER_POOLS'
, to the mutation. No effect.(An issue in the aws-appsync-sdk-js repo)[https://github.com/awslabs/aws-mobile-appsync-sdk-js/issues/300] also mentions having different versions of
aws-sdk
. Following the advice there, I changed all sub-dependencies inpackage-lock
to2.329.0
. This also showed no change.Also possibly related to #1716 and #2706, although the former is old, and the latter is less specific.
Also from the above issue, I created a graphql query for 'whois.' The output is not quite the same as @manueliglesias, but I think it is using the Cognito auth:
I hope this is readable, y'all were super helpful last time. Thank you for your time.