maticzav / graphql-shield

๐Ÿ›ก A GraphQL tool to ease the creation of permission layer.

Home Page:https://graphql-shield.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 add priority label once you start contributing ๐Ÿ˜„

@Bram-Zijp this often occurs due to version mismatch with graphql-middleware. I hope you've solved your problem ๐Ÿ™‚