MCPcopy Index your code
hub / github.com/Shopify/function-examples

github.com/Shopify/function-examples @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
318 symbols 522 edges 206 files 6 documented · 2%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Function Examples

This is the home of all the public examples of Shopify Functions. It's used by the CLI when running yarn shopify app generate extension. Feel free to look around! Do not edit these files directly.

Local Development

Expand Liquid Templates

If you wish to run the samples directly from this repository, you must first expand any .liquid templates with the following command.

yarn
yarn expand-liquid
# optionally provide the language flavor
yarn expand-liquid vanilla-js
yarn expand-liquid typescript

Run Tests

# JavaScript
yarn test-js
# TypeScript
yarn test-ts
# Rust
cargo test

Lint

# currently only applies to Rust
cargo fmt
cargo clippy -- -D warnings

Extension points exported contracts — how you extend this code

LoaderData (Interface)
(no doc)
sample-apps/delivery-customizations/app/routes/app.delivery-customization.$functionId.$id.tsx
ActionData (Interface)
(no doc)
sample-apps/delivery-customizations/app/routes/app.delivery-customization.$functionId.$id.tsx
DeliveryCustomizationData (Interface)
(no doc)
sample-apps/delivery-customizations/app/routes/app.delivery-customization.$functionId.$id.tsx
LoginErrorMessage (Interface)
(no doc)
sample-apps/delivery-customizations/app/routes/auth.login/error.server.tsx

Core symbols most depended-on inside this repo

getProjects
called by 11
.graphqlrc.cjs
create
called by 5
sample-apps/bundles-cart-transform/web/app/controllers/products_controller.rb
run
called by 4
sample-apps/payment-customizations/extensions/payment-customization-js/src/run.js
run
called by 4
sample-apps/optional-add-ons-cart-transform/extensions/optional-add-ons-js/src/run.js
run
called by 4
sample-apps/bundles-price-per-component/extensions/price-per-component-js/src/run.js
run
called by 3
sample-apps/update-line-item/extensions/update-line-item-js/src/run.js
run
called by 3
sample-apps/delivery-customizations/extensions/delivery-customization-js/src/run.js
directoryNames
called by 3
util/expand-liquid.js

Shape

Function 227
Class 52
Method 35
Interface 4

Languages

TypeScript42%
Rust41%
Ruby18%

Modules by API surface

sample-apps/bundles-cart-transform/extensions/cart-merge-expand_rust/src/run.rs15 symbols
checkout/rust/cart-transform/bundles/src/run.rs14 symbols
order-routing/rust/pickup-point-delivery-option-generators/default/src/run.rs10 symbols
sample-apps/delivery-customizations/app/routes/app.delivery-customization.$functionId.$id.tsx8 symbols
sample-apps/payment-customizations/extensions/payment-customization-rust/src/run.rs7 symbols
sample-apps/discounts/extensions/product-discount-rust/src/run.rs7 symbols
sample-apps/payment-customizations/app/routes/app.payment-customization.$functionId.$id.jsx6 symbols
sample-apps/delivery-customizations/extensions/delivery-customization-rust/src/run.rs6 symbols
util/expand-liquid.js5 symbols
sample-apps/payment-customizations/app/routes/app._index.jsx5 symbols
sample-apps/discounts/app/routes/app.jsx5 symbols
sample-apps/delivery-customizations/app/routes/app._index.tsx5 symbols

For agents

$ claude mcp add function-examples \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact