graphql-playground: Playground autoComplete or Type Box doesn't disappear.
This issue pertains to the following package(s):
- GraphQL Playground - Electron App
- GraphQL Playground HTML
- GraphQL Playground
- GraphQL Playground Express Middleware
- GraphQL Playground Hapi Middleware
- GraphQL Playground Koa Middleware
- GraphQL Playground Lambda Middleware
What OS and OS version are you experiencing the issue(s) on?
Windows 10 Home 22H2
What version of graphql-playground(-electron/-middleware) are you experiencing the issue(s) on?
I don’t know exactly what version is of graphql-playground. I ran this based on Nest.JS server.
"@apollo/server": "^4.10.5",
"@nestjs/apollo": "^12.2.0",
"@nestjs/graphql": "^12.2.0",
"graphql": "^16.9.0",
What is the expected behavior?
autoComplete or Type Box does disapper.
What is the actual behavior?
It doesn’t disappear.
Then, I checked developer tabs of Chrome browser, it said many many errors like following picture.
What steps may we take to reproduce the behavior?
Please provide a gif or image of the issue for a quicker response/fix.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 76
- Comments: 17
Commits related to this issue
- Fixing tooltip not disappearing by replacing a deprecated function (https://github.com/graphql/graphql-playground/issues/1429) Fixing undefined showDocFromType access when trying to click on type fro... — committed to JoaoBGusmao/graphql-playground by JoaoBGusmao 2 years ago
- fix(graphql_playground): use graphiql instead (#2446) ## Linked Issues/PRs <!-- List of related issues/PRs --> - none ## Description <!-- List of detailed changes --> The graphql-playground is... — committed to FuelLabs/fuel-core by rymnc 2 years ago
- fix(graphql_playground): use graphiql instead (#2446) ## Linked Issues/PRs <!-- List of related issues/PRs --> - none ## Description <!-- List of detailed changes --> The graphql-playground is... — committed to ykuroki711/core-fuel by ykuroki711 2 years ago
- fix: change default playground interface Previously, the default playground interface was set to `:playground` which uses graphql-playground. However, this uses a deprecated JavaScript API which mean... — committed to Gazler/ash_graphql by Gazler a year ago
- fix: change default playground interface (#319) Previously, the default playground interface was set to `:playground` which uses graphql-playground. However, this uses a deprecated JavaScript API whi... — committed to ash-project/ash_graphql by Gazler a year ago
You can add this to your custom uBlock filters as a simple workaround. Replace
localhostwith your domain if needed:A temporally solution with mutation observer, I use tampermonkey to host it.
Hi, I’ve created a simple Chrome extension that simply sets
display: noneon autocomplete tooltips. You could call it a hack, but it works for now.https://github.com/marcinlad/graphql-playground-tooltip-hide
Since this is a dead lib, I forked and fixed the autocomplete issue and also another crash when trying to click on a type definition inside the box. I wont raise a PR because it’s probably going to be a waste of time. Feel free to copy the solution from my fork: https://github.com/JoaoBGusmao/graphql-playground
To fix the box issue was just to replace the deprecated code and implement again using MutationObservers.
The issue when clicking the type was prabably around for years, prob introduced when they added the “schema” tab. Basically the click on type event handler depends on a ref to GraphDocs component, but this component is only really mounted when the doc tabs is clicked. Also the ref was not being properly set, maybe because of the way the tabs component builds the active tab component. As a workarround, calling the dispatch that activate the docs tab before using the ref worked just fine. It’s not the best code (bc I rely on a ref that is set by a function in a side effects of props changes) but it should work.
Instead of using graphql-playground which has not had a release in over 5 years, we just switched to GraphiQL. All it took for us was:
No new dependencies. Works amazing for local / dev. If you want to run it in a production environment you can use the React app. This worked for us.
This works like charm thanks
Obviously the fix by @JoaoBGusmao above is the right way to do this, but i just wanted a simpler way to hide the annoying boxes. I opted for adding some css to the page where i host the playground.
This css will simply hide the annoying helper messages after a few seconds instead of the default behavior of removing them from the DOM:
You can add this to a custom page via the instructions here: https://github.com/graphql/graphql-playground?tab=readme-ov-file#as-html-page
Have same issue, subscribed.
Hey everyone! 👋
I just published a small browser extension that might be helpful if you’re still using GraphQL Playground:
🧩 GraphQL Playground Fixer – Chrome Extension – Microsoft Edge Extension
It improves the autocomplete and suggestion functionality. hopefully making your experience smoother and less frustrating 😌✨
I also added a small IP display section 🌐, which can come in handy when adding IPs to network settings (e.g. in Azure).
Feel free to give it a try and let me know if you have any feedback or run into any issues! 🚀
I would encourage you guys to use
graphiql: trueinstead ofplayground: true.The official, modern GraphiQL, which:
Much better choice than the deprecated Playground.