Types of property 'middlewares' are incompatible.
See original GitHub issueBug report
- [Yes] I have checked other issues to make sure this is not a duplicate.
Describe the bug
When using the most current versions of the graphql-yoga
and graphl-shield
libraries, trying to add shield({ ... })
to the middlewares
option of the server creates this error:
(it keeps going for quite a while, just didn’t want to copy and paste five dozen lines)
To Reproduce
Copy and paste the Graphql Yoga example file. No changes are necessary for the error to pop up.
Additional context
graphql-yoga
version: 1.16.2
graphql-shield
version: 3.2.2
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:18
Top Results From Across the Web
Types of property 'middlewares' are incompatible. #151 - GitHub
This error occurs due to duplicated graphql-middleware package. graphql-yoga is already packed with the latest graphql-middleware version ...
Read more >Types being coerced to "any" and "Two different types with this ...
Two different types with this name exist, but they are unrelated. Types of property 'error' are incompatible. Type 'ValidationError' is not ...
Read more >How to extend the Express Request object in TypeScript
Let's learn how to extend the Request type in TypeScript to make its instances store custom data you can use at the controller...
Read more >18 Defining and Using a Job Incompatibility
This chapter describes how to use an Oracle Enterprise Scheduler job incompatibility, with which you can specify job requests that cannot run together....
Read more >Type Phantoms and Safe APIs - /dev/solita
One way to create a type-safe API is to generate code from metadata. ... Declaring undefined properties helps with type inference: path: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As you say i updated graphql-yoga and now i’m getting:
my updated package.json
if i install it i get
If i remove graphql-shield from middlewares all is working. Looks like some packages is conflict. But which. Removing ‘graphql-middleware-forward-binding’ from middlewares it is don’t cause any effect
Also then i
yarn install
i get some warnings:GOTCHA! Using
graphql": "^0.13.2
don’t cause any error. And looks like i don’t need this package, so i remove that and everything work. Don’t know why i installed it, but it is he who conflicts.That totally did the trick, @maticzav 💛 Thanks a bunches!! Can’t wait to try and test it out ✨