graphql / graphql-playground

🎮 GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration)
MIT License
8.73k stars 731 forks source link

Update Prettier version to allow 'interfaces to implement other interfaces' #1415

Open joaohaas opened 1 year ago

joaohaas commented 1 year ago

This issue pertains to the following package(s):

What OS and OS version are you experiencing the issue(s) on?

MacOS and Linux

What version of graphql-playground(-electron/-middleware) are you experiencing the issue(s) on?

Not really sure, it's from an internal forked version, but it should happen in all versions.

What is the expected behavior?

Given you have an interface that implements another interface (interface A implements B), the Schema tab should not break.

What is the actual behavior?

Currently trying to access the Schema tab on the side bar breaks the app. I managed to trace the issue to the prettify function in utils.ts, which in turn calls Prettier. Checking Prettier's changelog, this 'feature' was only implemented in version 2.1: https://prettier.io/blog/2020/08/24/2.1.0.html#allow-interfaces-to-implement-other-interfaces-8007httpsgithubcomprettierprettierpull8007-by-fiskerhttpsgithubcomfisker

Changing the version to 2.1.2 fixed the issue for me, but maybe it could be upgraded further.

What steps may we take to reproduce the behavior?

Implement an interface to another interface and try to access the Schema tab on the sidel.

joaohaas commented 1 year ago

Sorry for the edits, I think I ended up pressing some shortcut that posted the issue before I filled all the data.