Compilation fails when importing "OrderByWithRelationInput" types #397
Labels
community
Something initiated by the community
help wanted
Extra attention is needed
question
Further information is requested
Describe the Bug
The
orderByNulls
feature flag was recently promoted from preview to General Availability in Prisma 4.16.0.prisma/prisma#19377
This shouldn't have impacted existing instances of TypeGraphQL-Prisma because:
However, I have experienced consistent compilation failures as a result of this feature. Consider this argument for a query:
Since this behavior is now the default, my generated resolvers (which believe that the flag is enabled) conflict with the generated Prisma client (which is still on version 4.15.0 with the feature flag off.) I was required to manually override all of the
@prisma
NPM dependencies to force them to be on version 4.15.0.The specific error:
Adding this to the bottom of my
package.json
file solved the issue:To Reproduce
OrderByWithRelation
types as part of a GraphQL resolver (such as an argument to an operation), then use that argument with the Prisma clientExpected Behavior
I expect the version of
typegraphql-prisma
to be locked to the current compatible version, and not be flexible when it comes to the version of@prisma
dependencies that it relies on.Logs
If applicable, add some console logs to help explain your problem.
You can paste the errors with stack trace that were printed when the error occurred.
Environment (please complete the following information):
typegraphql-prisma
: 0.26.0Additional Context
It would be possible to solve this error by locking all
@prisma
dependencies to the current minor version of@prisma/client
that is supported by removing the leading caret^
from these dependencies.These are the dependencies that would need to be tweaked:
typegraphql-prisma/package.json
Line 22 in c3881e1
typegraphql-prisma/package.json
Line 32 in c3881e1
typegraphql-prisma/package.json
Line 33 in c3881e1
typegraphql-prisma/package.json
Line 41 in c3881e1
I also recommend creating an
.npmrc
file in the root of the repo withsave-exact=true
as its contents to ensure that any future third-party libraries are always installed with their exact versions, and not with a flexible version.The text was updated successfully, but these errors were encountered: