Closed ocheezyy-lw closed 1 year ago
@ocheezyy-lw, thanks for reporting. I can confirm this is an issue that currently affects renaming any of the default CRUD operations.
Probably not the response you’d want to hear, but the ability to rename default CRUD operations will be removed from the next Prisma-AppSync release.
The complexity behind the current GraphQL generator has prevented us from adding new features and resolving known issues. As a result, it's been decided to entirely rebuild the Prisma-AppSync GraphQL generator from the ground. Renaming operations is actually affecting many parts of the library and not only the GraphQL Schema output. So, to keep the scope manageable as well as enhance security, we also decided to deprecate the renaming feature.
However, this rewrite allowed us to introduce new features, such as:
@gql
directive. Right now, it is only possible to disable all queries
, mutations
or subscriptions
. Soon, you’ll be able to granularly disable get
, list
, create
, update
, etc..@auth
directive. Right now, this is limited to models.create
and update
actions on relation queries. This is similar to what's available in the Prisma Client: https://www.prisma.io/docs/concepts/components/prisma-client/relation-queries#connect-or-create-a-recordSo, to go back to your use case you’ll have two choices after the new release: 1/ use the default listWorkerIndustries
OR 2/ disable the list
operation using the new @gql(queries: { list: null })
and create a custom resolver named workerIndustries
.
The new version will be released within the next 10-15 days.
Thanks so much for getting back to me! I completely understand the change, was just a bit confused when following the docs.
I have another question that I'm not sure if it's worth making a new issue for. On this page in the docs there is no mention of AWS_LAMBDA
auth. Is that possible to use?
That's also part of the new release.
Still in testing and not documented yet - but you can install it via yarn add prisma-appsync@preview
to use /// @auth(model: [{ allow: lambda }])
.
Make sure to switch back to non-preview after the release.
Per the documentation I have added the following AST comment to a type in my schema (trying to override a query name)
After doing so I received the following error in the console on
yarn run dev
I've tried doing it on other models to see if it's something isolated to this one but it doesn't seem to be the case.
Environment info: OS: MacOS 13.6 (ARM) NodeJS: v18.12.1