Improve GraphQL explorer
What does this MR do and why?
Adds a new custom implementation of GraphiQL, which can be activated using the new_graphql_explorer
feature flag.
The new implementation uses the latest version of GraphiQL which includes a completely new UI. Also, some customizations were added:
- Default Query was changed to include link to GitLab GraphQL docs and an example query
- GitLab logo was added
- Implementation for GraphQL subscriptions was added
Some further customizations and improvements could be done in the future:
- Use a custom GraphiQL plugin to display an introduction text, getting started guide, links to documentations and a list of example queries.
- Add authentication and authorization
- Customize colors to align with GitLab's design
- Allow to pass queries via search params, e.g. to create "Open Query in GraphQL Explorer" links in the documentation
Screenshots or screen recordings
How to set up and validate locally
- Enable feature flag ins
rails console
Feature.enable(:new_graphql_explorer)
- Visit graphql-explorer
http://127.0.0.1:3000/-/graphql-explorer
- Run GraphQL queries, mutations and subscriptions
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Based on !61040 (closed)
Related to #325945
Edited by Fabian Schneider