1.0.0-rc.7
🌟 Support Prisma-AppSync by Starring Our Repo!
Highlights
Local Dev Server Transitioned to Amplify AppSync Simulator
🚨 Breaking Change: Please Read the Following Carefully Before Upgrading.
The previous version of our Prisma-AppSync local development server relied on GraphQL Yoga, complemented by several custom functions to mimic AWS Lambda and AppSync's internal behaviors. This was an effective approach initially but began to cause issues as Prisma-AppSync was used for more complex use cases.
To resolve these issues and simplify maintenance, we've opted to replace our bespoke implementation with Amplify AppSync Simulator. Amplify AppSync Simulator is an integral package within the AWS Amplify CLI and aims to accurately simulate the experience of using AppSync locally.
This migration brings numerous advantages to using the local development server:
- Enables the use of Codegen Issue #137
- Supports using GraphQL Fragments Issue #112
- Accommodates Authentication and Authorization modes provided by AWS AppSync, including Cognito User Pools.
- Enables Subscription support, using a local WebSocket server.
For users already using the Prisma-AppSync local development server who wish to migrate, follow these steps:
- Substitute your local
server.ts
file with the newer version found atpackages/boilerplate/server.ts
. - Install the new required dependency using
yarn add js-yaml -D
. - Modify the CLI command to initiate the local development server within your
package.json
file (by default, this is thedev
script). - Here are the corresponding before and after scripts:
# before
npx vite-node ./server.ts --watch --
--handler handler.ts
--schema prisma/generated/prisma-appsync/schema.gql
--port 4000
--watchers '[{"watch":["**/*.prisma","*.prisma"],"exec":"npx prisma generate && touch ./server.ts"}]'
--headers '{"x-fingerprint":"123456"}' # removed
# after
npx vite-node ./server.ts --watch --
--handler handler.ts
--schema prisma/generated/prisma-appsync/schema.gql
--resolvers prisma/generated/prisma-appsync/resolvers.yaml # added
--port 4000
--wsPort 4001 # added
--watchers '[{"watch":["**/*.prisma","*.prisma"],"exec":"npx prisma generate && touch ./server.ts"}]'
Upgraded to Prisma 5.1.1+
🚨 Breaking Change: Please Read the Following Carefully Before Upgrading.
Prisma-AppSync internals were updated to support Prisma 5.1.1. One potentially breaking change is that the extendedWhereUnique
preview feature was promoted to general availability. So newly generated WhereUniqueInput
schema types exposes all fields on the model, not just unique fields.
Updated Minimum NodeJS Version Requirement
🚨 Breaking Change: Please Read the Following Carefully Before Upgrading.
The compilation target of Prisma-AppSync was updated from Node.js 14 to Node.js 16. Please ensure you have the minimum required Node.js version (Node.js 16) enabled on your local environment and deployed Lambda function.
Updated CDK Boilerplate
The provided CDK Boilerplate has been updated to use the latest depdencies and recommended CDK packages. In addition, the default Lambda function version has been updated to use Node 18.X.
Fixes and improvements
- GraphQL Schema adjusted to make some array elements and responses non-nullable.
- Schema generation issue when using Prisma @@id attributes
Sponsors
Reconnect with home cooking |
Credits
Sylvain 🐙 💻 🤔 📖 | Tom 💻 🤔 | Bell 💻 🤔 | Max Konin 💻 |
Github sponsors
Enjoy using Prisma-AppSync? Please consider 💛 Github sponsors.