UNPKG

@cafeasp/n8n-nodes-shopify-graphql

Version:
61 lines (60 loc) 2.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ShopifyGraphQlApi = void 0; class ShopifyGraphQlApi { constructor() { this.name = 'shopifyGraphQlApi'; this.displayName = 'Shopify GraphQL API'; this.documentationUrl = 'https://shopify.dev/docs/api/admin-graphql'; this.properties = [ { displayName: 'Shop Name', name: 'shopName', type: 'string', default: '', placeholder: 'your-store-name', description: 'The name of your Shopify store (the part before .myshopify.com)', required: true, }, { displayName: 'Access Token', name: 'accessToken', type: 'string', typeOptions: { password: true, }, default: '', description: 'Admin API access token for your Shopify store', required: true, }, { displayName: 'API Version', name: 'apiVersion', type: 'string', default: '2024-10', description: 'Shopify API version (e.g., 2024-10)', required: true, }, ]; this.authenticate = { type: 'generic', properties: { headers: { 'X-Shopify-Access-Token': '={{$credentials.accessToken}}', 'Content-Type': 'application/json', }, }, }; this.test = { request: { baseURL: '=https://{{$credentials.shopName}}.myshopify.com/admin/api/{{$credentials.apiVersion}}/graphql.json', url: '', method: 'POST', body: { query: '{ shop { name } }', }, }, }; } } exports.ShopifyGraphQlApi = ShopifyGraphQlApi;