Allow filtering store list by store type - #8472
Open
amcaplan wants to merge 1 commit into
Open
Conversation
amcaplan
force-pushed
the
allow-filtering-store-list-on-store-type
branch
2 times, most recently
from
September 3, 2026 21:15
3f0b0df to
c728496
Compare
Adds `store list --type <dev|production|client_transfer|collaborator>`, using the public store-type handles the listing already reports in its Type column and JSON output, so the filter and the data share one vocabulary. The filter is applied server-side via BP's `STORE_TYPE` shop filter rather than on the returned rows. That matters for correctness, not just ergonomics: the listing is capped at 250 stores, so filtering afterwards would report "no production stores" for an organization whose matches all sit past the cap. `dev` maps to BP's `development_superset` alias, which covers both `development` (legacy partner dev stores) and `app_development` (what `store create dev` makes), keeping `--type dev` a single query. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Assisted-By: devx/84554425-7df7-4dd7-8f8e-fa9581e69cdf
amcaplan
force-pushed
the
allow-filtering-store-list-on-store-type
branch
from
September 3, 2026 21:18
c728496 to
95e7f8d
Compare
amcaplan
marked this pull request as ready for review
September 3, 2026 21:18
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The filter is applied server-side as intended, the new flag is validated, output/JSON behavior is covered by tests, and regenerated artifacts are consistent with the change.
Pull request overview
Adds a server-side --type filter to shopify store list, using the same public store-type handles already shown in the Type column / --json, and threads that filter through query → service result → text/JSON output.
Changes:
- Introduces a stable store-type filter vocabulary (
dev|production|client_transfer|collaborator) and maps it to BPSTORE_TYPEfilter values. - Updates the BP stores query to accept a
filtersvariable and appliesSTORE_STATUS=activeplus optionalSTORE_TYPE. - Updates output (headline, empty state, truncation warning, and JSON) to reflect the active filter, with tests and regenerated docs/artifacts.
File summaries
| File | Description |
|---|---|
| packages/store/src/cli/services/store/store-type.ts | Defines accepted --type handles and maps them to BP STORE_TYPE filter values. |
| packages/store/src/cli/services/store/store-type.test.ts | Adds coverage for handle normalization and filter-value mapping. |
| packages/store/src/cli/services/store/list/types.ts | Extends result shape to optionally echo back the active store-type filter. |
| packages/store/src/cli/services/store/list/result.ts | Names the active filter in text output and includes it in JSON output when present. |
| packages/store/src/cli/services/store/list/result.test.ts | Tests headline/empty/truncation wording and JSON inclusion of storeType. |
| packages/store/src/cli/services/store/list/bp-source.ts | Applies server-side BP shop filters, including optional STORE_TYPE. |
| packages/store/src/cli/services/store/list/bp-source.test.ts | Verifies BP request variables include the correct filter list (with and without --type). |
| packages/store/src/cli/services/store/list.ts | Plumbs storeType option into BP source and echoes it back in the result. |
| packages/store/src/cli/services/store/list.test.ts | Tests passing/omitting storeType through the list service. |
| packages/store/src/cli/commands/store/list.ts | Adds --type flag (validated against accepted handles) and passes it to listStores. |
| packages/store/src/cli/commands/store/list.test.ts | Tests CLI flag wiring and expected flag options list. |
| packages/store/src/cli/api/graphql/business-platform-organizations/queries/list_accessible_shops.graphql | Moves filters from inline literal to a $filters query variable. |
| packages/store/src/cli/api/graphql/business-platform-organizations/generated/types.d.ts | Regenerates BP GraphQL types to include shop filter input types/enums. |
| packages/store/src/cli/api/graphql/business-platform-organizations/generated/list_accessible_shops.ts | Regenerates typed document node + variables for $filters. |
| packages/cli/README.md | Regenerates CLI help docs to include --type. |
| packages/cli/oclif.manifest.json | Regenerates oclif manifest with the new flag metadata. |
| docs-shopify.dev/generated/generated_docs_data_v2.json | Regenerates shopify.dev docs data to include --type. |
| .changeset/store-list-filter-by-store-type.md | Adds a changeset for the new user-facing flag. |
Review details
- Files reviewed: 15/18 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Values are the public store-type handles the listing already reports in its
Typecolumn and in--json, so the filter and the data share one vocabulary and a value read out of--jsoncan be passed straight back in.Why server-side
The filter goes to Business Platform's
STORE_TYPEshop filter rather than being applied to the returned rows. That's a correctness fix, not just ergonomics: the listing is capped at 250 stores, so grouping client-side would report "no production stores" for an organization whose matches all sit past the cap.filtersmoved from a literal in the query document to a[ShopFilterInput!]variable to make that possible; theSTORE_STATUS = activefilter is unchanged.Output
Filtered listings name the filter in prose, since the 250-cap applies to the filtered set:
Listing dev stores./No client transfer stores found.Showing the 250 most recent production stores in Acme. More stores exist.--jsongains astoreTypefield when filtered.Notes for review
list/bp-source.ts,list/result.ts, and the store-type vocabulary inservices/store/store-type.ts.--type dev --type productionwould need N queries or client-side merging, which reintroduces the cap problem.🤖 Generated with Claude Code