Closed Adeeltahir1995 closed 1 year ago
Hi @Adeeltahir1995
For front-end web and mobile development, we recommend using the Amplify clients which are optimized to connect to the AppSync backend. We have docs with instructions on how to connect to an AppSync API behind a custom domain.
Hello @manueliglesias
Thank you for the comment. I am using this package inside a backend
lambda. I can not use amplify since that is built for frontend.
Do you want to request a feature or report a bug?
Report a bug
What is the current behavior?
When I create AWSAppSyncClient instance using
AUTH_TYPE
asAWS_IAM
it supposed to automatically useappsync
as service name as it is defined a constant ReferenceBut instead it throws an error
TypeError: Cannot read properties of null (reading 'match')
at line while signing the request.This is happening because I have a
custom domain
on top of the appsync generated domain. Since the code is trying to parse the url to infer the service type before it actually sign it, the use of custom domain raises the exception. Whereas for the actual appsync domain url it works fine.If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
For
version 4.1.9
:AUTH_TYPE.AWS_IAM
It should throw error with following error stack:
What is the expected behavior?
The package should by default use appsync as service name and should not use the url parameter to infer the service.
Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions?
Not sure about previous versions