Mono repo (lerna) MiddlewareError: Type generator exists in middleware but is missing in Schema.
Bram-Zijp opened this issue ยท comments
I am working with a mono repo using "lerna". I ended up creating my shield rules for two endpoints in one module and import this module as dependency in the endpoint projects. When I imported the the rules initialized with shield from a dependency, I would get this error: MiddlewareError: Type generator exists in middleware but is missing in Schema.
.
To solve this problem I ended up doing this:
export const permissions = (passedShield: typeof shield) =>
passedShield({
...
});
Hey @Bram-Zijp ๐,
Thank you for opening an issue. We will get back to you as soon as we can. Also, check out our Open Collective and consider contributing financially.
https://opencollective.com/graphql-shield
PS.: We offer
priority
support for all financial contributors. Don't forget to addpriority
label once you start contributing ๐
@Bram-Zijp this often occurs due to version mismatch with graphql-middleware
. I hope you've solved your problem ๐