Skip to content

Conversation

hasparus
Copy link
Contributor

@hasparus hasparus commented Sep 5, 2025

Description

@martinbonnin proposed making the "How it Works" code samples interactive on Slack.

We already had CodeMirror, and I already needed to restyle it for the docs, so it required just a new schema, some refactoring and shuffling things around.

I think the idea makes sense, and lets the user experience GraphQL immediately. Even if they're non-programmers, they can maybe get a feel how the data flows and what the experience is like.

I changed the section CTA to state "Try GraphiQL", because we're already trying it out live.

image

To-do

  • Write a small GraphQL Schema for this example
  • Double check if next/dynamic worked and we don't have CodeMirror in the main bundle
    • (I actually wrote dynamic(import instead of dynamic(() => import initially so it's good I double checked).
  • Add a test for this

* Render MiniGraphiQL with `graphiql` string in node.meta

* Don't validate in Marked: not its responsibility

* Change interactive code snippet colors

* Remove global .miniGraphiQL class

* Refactor MiniGraphiQL to separate files

* Add a TODO comment

* Run Playwright on CI

* wip

* color codemirrors properly

* Style codemirrors properly

* Upgrade pnpm from 9.15.9 to 10.15.0

* Update 2025 conference schedule and speaker details

* Improve syntax highlighting for comments and diffs

* Remove focus outline

* Extract CodeBlockLabel

* Remove unused marked dependency

* Rename `marked` to `interactive-code-block`

* Update codemirror styles

* Allow running esbuild builds

* Remove duplicate image

* Format

* Change syntax theme names to avoid a bug

* Fix heights and properly chain handlers

* Fix tests for new editor

* Run Playwright on CI

* Use the same colors for VariableEditor

* Use the same font for interactive code blocks

* Match the coloring on t.separator [,:] between Lezer and Shiki
Copy link

vercel bot commented Sep 5, 2025

@hasparus is attempting to deploy a commit to the The GraphQL Foundation Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Sep 5, 2025 β€’

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
graphql-github-io Ready Ready Preview Comment Sep 6, 2025 10:13pm

Copy link
Contributor

@martinbonnin martinbonnin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very cool 🀩

May I suggest we make it more explicit that the page is interactive with a small comment/call to action?
Screenshot 2025-09-06 at 19 08 17

@hasparus
Copy link
Contributor Author

hasparus commented Sep 6, 2025 β€’

This is very cool 🀩

May I suggest we make it more explicit that the page is interactive with a small comment/call to action? <img

@martinbonnin What do you think about adding something like this info message instead?

image

@martinbonnin
Copy link
Contributor

It wouldn't be hover, right? It'd be something else? I kind of liked that the comment was where the user would look and therefore impossible to miss but no strong opinion at this stage.

@hasparus hasparus marked this pull request as draft September 9, 2025 13:33
@hasparus
Copy link
Contributor Author

hasparus commented Sep 9, 2025

I'm changing the PR to a draft because we noticed a schema discrepancy and I need to write a small script first.

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

Successfully merging this pull request may close these issues.

2 participants