Shopify
ãã¤ã¦ã¯ããã¡ãã®è¨äºãåèã«ã¡ã¿ãã£ã¼ã«ããåå¾ãã¦ãã¾ãããwww.shopify.com ã¡ã¿ãã£ã¼ã«ãåå¾ä¾ { products(first: 10) { edges { node { metafields(first:10) { edges { node { key value } } } } } } } blog.kimizuka.orgåèã«ããè¨äºãæ¸ãâ¦
ãã¨ã®çºç«¯ github.comREADME ã®è¨è¼ã«å¾ã£ã¦ã import Client from 'shopify-buy'; // Initializing a client to return content in the store's primary language const client = Client.buildClient({ domain: 'your-shop-name.myshopify.com', storefronâ¦
github.comãããããGraphiQLå´ã®åé¡ã®ãããªã®ã§ãããShopify GraphiQL Appã«ã¨ã©ã¼ã¨ãªããããªã¯ã¨ãªãæ¸ãè¾¼ãã§ãã¾ãã¨ãã¨ã©ã¼ã§ç»é¢ã表示ãããªããªãã¾ããããã ããªãã¾ã ããããååã®ã¯ã¨ãªãlocalStorageã«ä¿æãã¦åæå¤ã«ä½¿ããã¨ããâ¦
éå»ã«ãååä¸è¦§ãããã°è¨äºä¸è¦§ãåå¾ãããã¨ããã£ãã®ã§ãããGraphQLã®æ¸ãæ¹ã調ã¹ãªããããããªãã®ãåå¾ãã¦ã¿ãã®ã§æ¸ãæ¹ãã¡ã¢ãã¦ããã¾ããblog.kimizuka.org blog.kimizuka.org ååä¸è¦§åå¾ã®æ¸ãæ¹ä¾ { products(first: 10) { edges { nâ¦
å æ¥ãèªåã§APIãç¨æãã¦Shopifyã®ããã°è¨äºä¸è¦§ãåå¾ãã¾ããããååãååä¸è¦§ãåå¾ããéã«GraphQLã®ä½¿ããããå¦ãã ã®ã§ãGraphQLã§æ¸ãæãã¦ã¿ã¾ããblog.kimizuka.org blog.kimizuka.org æé ãã©ã¤ãã¼ãã¢ããªãç¨æãã¦ãã¹ãã¢ããã³ãAPâ¦
ååã¯ãjs-buy-sdkï¼shopify-buyï¼ã使ã£ã¦ååä¸è¦§ãåå¾ãã¾ããããä»åã¯GraphQLã§åå¾ãã¾ãã æ¹æ³ã¯ããããããã®ã§ãããGraphQLãæ±ããããããããã«Apollo Clientã使ã£ã¦å®è£ ãã¾ãããblog.kimizuka.orgå人çã«ã¯çµæãåãã§ããã°ä½¿ãæ £â¦
æé ãã©ã¤ãã¼ãã¢ããªãç¨æãã¦ãã¹ãã¢ããã³ãAPIã®ã¢ã¯ã»ã¹ãã¼ã¯ã³ãåå¾ãã help.shopify.comãã¡ãã®æé ã«å¾ã£ã¦ã ãã©ã¤ãã¼ãã¢ããªãç¨æãã ã¹ãã¢ããã³ãAPIãæå¹ã«ãã ååãããªã¨ã¼ã·ã§ã³ãã³ã¬ã¯ã·ã§ã³ãèªã¿è¾¼ãã®æ¨©éãä»ä¸ããâ¦
ãªã«ãæ ¹æ¬çãªã¨ãããééãã¦ããæ°ããã¦ãªããªãã®ã§ãããå¼·å¼ãªææ³ã§Shopifyã®ããã°è¨äºä¸è¦§ãåå¾ã§ããã®ã§ã¡ã¢ãæ®ãã¦ããã¾ãã çµè« src/pages/api/getArticles.js import axios from 'axios'; export default async function getArticleListâ¦