Skip to content

Conversation

@nickwesselman
Copy link
Contributor

@nickwesselman nickwesselman commented Dec 5, 2025

WHY are these changes introduced?

This PR adds support for executing GraphQL operations on production stores, while maintaining safety by restricting mutations to development stores only.

WHAT is this pull request doing?

  • Adds validation to prevent mutations on non-development stores
  • Updates the executeBulkOperation and executeOperation services to accept a store object instead of just the FQDN
  • Adds a new GraphQL query for fetching stores by domain that includes store type information
  • Modifies the store context to optionally include all store types, not just development stores
  • Updates the storeByDomain method to support retrieving all store types
  • Adds tests for the new validation logic

How to test your changes?

  1. Try executing a query on a production store:

    shopify app execute --store=your-production-store.myshopify.com --query "{ shop { name } }"
    

    This should succeed.

  2. Try executing a mutation on a production store:

    shopify app execute --store=your-production-store.myshopify.com --query "mutation { productUpdate(input: {}) { product { id } } }"
    

    This should fail with an error message indicating mutations can only be executed on Dev Stores.

  3. Try executing a mutation on a development store:

    shopify app execute --store=your-dev-store.myshopify.com --query  "mutation { productUpdate(input: {}) { product { id } } }"
    

    This should succeed.

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

Copy link
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@nickwesselman nickwesselman changed the title initial implementation of allowing graphql queries on non-dev stores Add support for executing GraphQL queries on non-dev stores Dec 5, 2025
@nickwesselman nickwesselman force-pushed the allow_graphql_queries_on_prod_stores branch from 1c51daa to 7a95eed Compare December 5, 2025 19:36
Base automatically changed from shopify_app_execute to main December 5, 2025 23:19
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