Skip to content

v6: Show operation pill on History rows#4316

Merged
trevor-scheer merged 6 commits into
graphiql-6from
trevor/history-method-pill
May 20, 2026
Merged

v6: Show operation pill on History rows#4316
trevor-scheer merged 6 commits into
graphiql-6from
trevor/history-method-pill

Conversation

@trevor-scheer
Copy link
Copy Markdown
Contributor

@trevor-scheer trevor-scheer commented May 20, 2026

Summary

  • Show a MethodPill (QRY/MUT/SUB) per History row in place of the green status dot.
  • QueryStoreItem gains an optional operation field, populated at write time from the parsed query.
  • The Clear button drops the green-on-success state; rows disappearing is the feedback.

Test plan

  • Open the History panel, run a query/mutation/subscription, and confirm each row shows the right pill.
  • Click "Clear"; rows are removed without any color flash on the button.
  • Open Storybook under "Plugins/History"; check the updated Mixed story.

Refs: #4219

Renders `ERR` for items where the operation type isn't known.
`QueryStoreItem` gains an optional `operation` field, populated at
write time from the parsed query. The history row uses `MethodPill`
to surface it; legacy entries render `ERR`. The clear button drops
the `success`/`error` state machine; rows disappearing is the feedback.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 20, 2026

🦋 Changeset detected

Latest commit: 3e7afb6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@graphiql/plugin-history Patch
@graphiql/toolkit Patch
graphiql Patch
@graphiql/react Patch
@graphiql/plugin-code-exporter Patch
@graphiql/plugin-doc-explorer Patch
@graphiql/plugin-explorer Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Items only enter history if their query parses; an `operation` is always
captured at write time. The only way `item.operation` is missing is
legacy localStorage entries, which now render without a pill (they age
out as history rotates).
Single source of truth in toolkit (where it backs `QueryStoreItem.operation`);
`MethodPill` imports and re-exports it.
@trevor-scheer trevor-scheer marked this pull request as ready for review May 20, 2026 22:53
@trevor-scheer trevor-scheer enabled auto-merge (squash) May 20, 2026 22:53
@trevor-scheer trevor-scheer merged commit eb46e2f into graphiql-6 May 20, 2026
11 of 12 checks passed
@trevor-scheer trevor-scheer deleted the trevor/history-method-pill branch May 20, 2026 22:55
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.

1 participant