Extends graphql-request to sign requests for AWS AppSync GraphQL APIs using IAM authorization. Version 5.0.1 supports Node.js >=18 and graphql 14–16. It wraps the familiar graphql-request client interface, automatically computing the AWS Signature Version 4 signature for every request. Unlike alternative approaches that require manual signing or using the AWS Amplify client, this library provides a drop-in solution for existing graphql-request users. Release cadence is irregular; breaking changes may accompany upstream graphql-request releases.
npm install graphql-request-appsync-iamNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a signed GraphQL client for AWS AppSync with IAM auth and performs a query.
Update to Node.js >=18 and use ESM imports (import syntax or dynamic import()).
Update graphql to 14 - 16 range. If upgrading from v4, ensure graphql version compatibility.
Pass awsCredentials and awsRegion explicitly to getGraphQLClient() to avoid reliance on global AWS configuration.
Do not pass fetch in the options object. The library uses its own signed fetch implementation.
Change to import { getGraphQLClient } from 'graphql-request-appsync-iam' or use dynamic import().Ensure you use the client returned by getGraphQLClient() and call request method as client.request(query, variables).
Verify the awsRegion matches your AppSync API's region and that awsCredentials have correct accessKeyId, secretAccessKey, and sessionToken if using temporary credentials.