question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Type generator exists in middleware but is missing in Schema.

See original GitHub issue

Hi,

since the graphql-middleware update to 6.1.2 I get the following error: MiddlewareError: Type generator exists in middleware but is missing in Schema. I do use graphql-shield v 7.5.0

CleanShot 2021-08-18 at 14 02 27@2x

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:15
  • Comments:22 (3 by maintainers)

github_iconTop GitHub Comments

21reactions
XTVBcommented, Jun 29, 2022

isMiddlewareGenerator is incorrectly returning false for graphql-shield permissions, which causes this error to occur in the validation.

If you replace applyMiddleware(schema, permissions) with applyMiddleware(schema, permissions.generate(schema)) then it will work correctly with the latest version of graphql-middleware, without needing to downgrade.

5reactions
NoisyFlowerscommented, Sep 16, 2021

I’ve been trying different versions of graphql-middleware and am seeing the same as @todda00: the problem starts with 6.1.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

graphql-shield - Bountysource
Aliasing not working with graphql-shield permissions middleware and ... MiddlewareError: Type generator exists in middleware but is missing in Schema. $ 0.
Read more >
graphql-shield as 'makeProcessSchemaPlugin' in Postgraphile
The type of middleware postgraphile expects is a little different from graphql-middleware. Instead of downloading graphql-middleware and ...
Read more >
Shield - GraphQL Code Generator
Shield generates GraphQL Middleware layer from your rules. ... You can apply your rule across entire schema, Type scoped, or field specific.
Read more >
type-graphql/Lobby - Gitter
But when I run the same query in the playground I get an empty array ... using graphql-code-generator, it fails with 404 error,...
Read more >
Subscriptions in Apollo Server - Apollo GraphQL Docs
Your schema's Subscription type defines top-level fields that clients can ... you must first swap to using the expressMiddleware function (or any other ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found