Open10
shopify アプリの Tips
Q: graphqlのサンプルを叩きたい
以下のリンクからgraphqlのアプリをstore に install する。
Q shopify serve で ngrokのtunnel error がでる
以下のようなエラーパターン
A
shopify tunnel stop
で一回 ngrok のtunnel を kill する必要がある。
以下のようなMakefile で make start でうまくいく
SHOPIFYCMD=shopify
SHOPIFY_TUNNEL_STOP=$(SHOPIFYCMD) tunnel stop
SHOPIFY_SERVE=$(SHOPIFYCMD) serve
start: stop serve
stop:
$(SHOPIFY_TUNNEL_STOP)
serve:
$(SHOPIFY_SERVE)
日本語のハンズオン。React じゃない素のhtmlとjs なので、そのままは使えないがshopifyのapp まわりのエコシステムを理解するのに便利
YouTubeのvideoIDが不正ですsample コード集
shopifyの注文の発送処理について
2020年時点のAPI
2019年時点のAPI
ShopifyでBilling Graphql APIを使う
-
大きく、OnetimeとSubscriptionがある。
-
今回はSubscriptionを使いたいので、SubscriptionをBillingAPIで調べる。
-
全体像がかかれているのは以下
https://shopify.dev/tutorials/bill-for-your-app-using-graphql-admin-api -
Anuual Subscriptionを作成するサンプルコードが以下に示されているので、参考にすれば 30days も行けそう。
- testの仕方は以下にかかれている。test flagをつけばテストできるっぽい。
- Subscription系のよく使うGraphqlAPIのサンプルは以下にたくさんのっている。
- 上記含め多くの情報は、Charge for your app のセクションに主なものはまとまっている。
https://shopify.dev/tutorials
ShopifyのAppのserver.js を ts化したもの
ShopifyAppをts化する手順
# appをcreate
$ shopify create node --name=y-shipping-app
# typescriptをいれる
$ npm install --save-dev typescript ts-node @types/node @types/react @types/react-dom @types/koa @types/koa-session @types/koa-router @types/js-cookie\n
# packageを最新化
$ ncu -u
参考
以下のエラー解決
AppBridgeError: APP::ERROR::INVALID_CONFIG: host must be provided
appSubscriptionCreate の mutationが以下のエラーがでて使えない場合はアカウントがadministratorかを確認すると良いかも。
Error: Internal error. Looks like something went wrong on our end.
Request ID: 2d2eb4f4-4fbe-43c4-a6d2-14c991f649fd (include this in support requests).
開発ストアの移管