Prerequisites
To integrate with AWS Cognito, you will need the following environment variables in the root of your project.
COGNITO_ENDPOINT=
COGNITO_USER_POOL_ID=
AWS_REGION=
Create the Cognito User Entity
Use the createAwsCognitoUserProvider
to add a CognitoUser
entity to Graphweaver.
in backend/index.ts
import Graphweaver from '@exogee/graphweaver-server';
import { createAwsCognitoUserProvider } from '@exogee/graphweaver-aws-cognito';
createAwsCognitoUserProvider({
userPoolId: process.env.COGNITO_USER_POOL_ID,
region: process.env.AWS_REGION,
endpoint: process.env.COGNITO_ENDPOINT,
});
export const graphweaver = new Graphweaver();
export const handler = graphweaver.handler();