Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agree on graphQL playground #357

Open
3 of 4 tasks
LukSteib opened this issue Apr 3, 2023 · 4 comments
Open
3 of 4 tasks

Agree on graphQL playground #357

LukSteib opened this issue Apr 3, 2023 · 4 comments

Comments

@LukSteib
Copy link

LukSteib commented Apr 3, 2023

Goal

Agree on the graphQL playground we will use to embed in UI

Context

The Switchboard API should come with a playground and interface that allows for easy usage. Reference project used appollo studio. However we want to provide a self hostable and open source solution.

Tasks

  • List criteria
  • Benchmark currently used playground against criteria
  • (optional) propose alternative contenders
  • Get feedback from SES based on staging deployment (depends on Setup staging switchboard#30)
@LukSteib
Copy link
Author

LukSteib commented Apr 3, 2023

Criteria for playground

  • self hostable and open source
  • Export to JSON (file)
  • Export to CSV
  • Tabular view of the return value
  • Creating queries and mutations by clicking on fields
  • Creating filters by clicking on fields
  • Changelog

@valiafetisov
Copy link

Before we proceed researching other explorers, I would thoroughly checked if Apollo Explorer might actually suit our needs.

It seems that Apollo Explorer is open-source, MIT-licensed frontend-only part of the closed-source Apollo Studio cloud service. According to the docs, the Explorer can be embedded into other websites, but the misleading (and also annoying) part of the embed is the header with logo + login button on top (which suggests and advertises that you need to have Apollo Studio account in order to use it). Therefore, before proceeding to research other options:

  • Investigate if @apollo/explorer can be embedded into our website
  • Investigate if the header with logo and login button can be removed via plugin settings or via a fork
  • Confirm that the embed does not need to depend on the Apollo Studio and does not send any requests to their servers
  • Investigate if the functionality outlined above is still available

@valiafetisov
Copy link

valiafetisov commented Apr 5, 2023

Apollo Explorer

Despite the @apollo/explorer package being MIT-licensed, all it does is: verifies configuration parameters and creates iframe that points to their server:

Screenshot 2023-04-05 at 11 00 35

The iframe contains apollo logo, header with login button and cookies consent (and tries to send all kinds of tracking requests):

Screenshot 2023-04-05 at 11 17 45

Conclusion

We can't use Apollo Explorer due to its centralisation. I wouldn't even consider it as a centralised backstop as it interferes with our UI (via misleading login button). Users who prefer to use Apollo (or any other private/desktop-based explorer) would still able to use it via their deployed version, since we plan to keep graphql schema introspection enabled in production.

Takeaways

@valiafetisov
Copy link

Currently used explorer is Graphql Playground from the original graphql organisation. It's build on top of the GraphiQL explorer (so it has even less features). Other open-source alternatives include:

  • graphql-explorer (more like a simple UI over queries and mutations derived from introspection)
    • I think something similar but with better UX (for non-technical people) can be easily build using introspection query
  • altair – another competing IDE
Criteria Apollo Explorer Graphql Playground GraphiQL Altair
self hostable and open source No Yes, MIT Yes, MIT Yes, MIT
Export to JSON (file) Yes No No No
Export to CSV Yes No No No
Tabular view of the return value Yes No No No
Creating queries and mutations by clicking on fields Yes No, but autocompleted No Possible via clicking on "ADD QUERY" button in the docs
Creating filters by clicking on fields Yes No No No
Changelog Yes No No No

Conclusion

We can switch to Altair since it seems to have a little bit better UX, but will first need to figure out how to disable accounts feature. Otherwise, current Graphql Playground seems to be a solid choice from the existing options

@CallmeT-ty CallmeT-ty transferred this issue from powerhouse-inc/switchboard Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants