@shopify/api-codegen-preset
Version:
Preset for graphql-codegen to parse and type queries to Shopify APIs
1 lines • 3.31 kB
Source Map (JSON)
{"version":3,"file":"api-configs.mjs","sources":["../../src/helpers/api-configs.ts"],"sourcesContent":["import type {ApiType} from '../types';\n\ninterface ApiConfig {\n schema: string;\n schemaFile: string;\n typesFile: string;\n queryTypesFile: string;\n interfaceExtension: string;\n module: string;\n presetConfigs: {\n importTypes: {\n namespace: string;\n };\n };\n}\n\ntype ApiConfigs = {\n [key in ApiType]: ApiConfig;\n};\n\nexport const apiConfigs: ApiConfigs = {\n Admin: {\n schema: 'https://shopify.dev/admin-graphql-direct-proxy%%API_VERSION%%',\n schemaFile: 'admin%%API_VERSION%%.schema.json',\n typesFile: 'admin.types',\n queryTypesFile: 'admin.generated',\n interfaceExtension: `declare module '%%MODULE%%' {\\n type InputMaybe<T> = AdminTypes.InputMaybe<T>;\\n interface AdminQueries extends %%QUERY%% {}\\n interface AdminMutations extends %%MUTATION%% {}\\n}`,\n module: '@shopify/admin-api-client',\n presetConfigs: {\n importTypes: {\n namespace: 'AdminTypes',\n },\n },\n },\n Storefront: {\n schema:\n 'https://shopify.dev/storefront-graphql-direct-proxy%%API_VERSION%%',\n schemaFile: 'storefront%%API_VERSION%%.schema.json',\n typesFile: 'storefront.types',\n queryTypesFile: 'storefront.generated',\n interfaceExtension: `declare module '%%MODULE%%' {\\n type InputMaybe<T> = StorefrontTypes.InputMaybe<T>;\\n interface StorefrontQueries extends %%QUERY%% {}\\n interface StorefrontMutations extends %%MUTATION%% {}\\n}`,\n module: '@shopify/storefront-api-client',\n presetConfigs: {\n importTypes: {\n namespace: 'StorefrontTypes',\n },\n },\n },\n Customer: {\n schema:\n 'https://app.myshopify.com/services/graphql/introspection/customer?api_client_api_key=%%API_KEY%%&api_version=%%API_VERSION%%',\n schemaFile: 'customer%%API_VERSION%%.schema.json',\n typesFile: 'customer.types',\n queryTypesFile: 'customer.generated',\n interfaceExtension: `declare module '%%MODULE%%' {\\n type InputMaybe<T> = CustomerTypes.InputMaybe<T>;\\n interface CustomerQueries extends %%QUERY%% {}\\n interface CustomerMutations extends %%MUTATION%% {}\\n}`,\n module: '@shopify/customer-api-client',\n presetConfigs: {\n importTypes: {\n namespace: 'CustomerTypes',\n },\n },\n },\n};\n"],"names":[],"mappings":"AAoBO,MAAM,UAAU,GAAe;AACpC,IAAA,KAAK,EAAE;AACL,QAAA,MAAM,EAAE,+DAA+D;AACvE,QAAA,UAAU,EAAE,kCAAkC;AAC9C,QAAA,SAAS,EAAE,aAAa;AACxB,QAAA,cAAc,EAAE,iBAAiB;AACjC,QAAA,kBAAkB,EAAE,CAAA,qLAAA,CAAuL;AAC3M,QAAA,MAAM,EAAE,2BAA2B;AACnC,QAAA,aAAa,EAAE;AACb,YAAA,WAAW,EAAE;AACX,gBAAA,SAAS,EAAE,YAAY;AACxB,aAAA;AACF,SAAA;AACF,KAAA;AACD,IAAA,UAAU,EAAE;AACV,QAAA,MAAM,EACJ,oEAAoE;AACtE,QAAA,UAAU,EAAE,uCAAuC;AACnD,QAAA,SAAS,EAAE,kBAAkB;AAC7B,QAAA,cAAc,EAAE,sBAAsB;AACtC,QAAA,kBAAkB,EAAE,CAAA,oMAAA,CAAsM;AAC1N,QAAA,MAAM,EAAE,gCAAgC;AACxC,QAAA,aAAa,EAAE;AACb,YAAA,WAAW,EAAE;AACX,gBAAA,SAAS,EAAE,iBAAiB;AAC7B,aAAA;AACF,SAAA;AACF,KAAA;AACD,IAAA,QAAQ,EAAE;AACR,QAAA,MAAM,EACJ,8HAA8H;AAChI,QAAA,UAAU,EAAE,qCAAqC;AACjD,QAAA,SAAS,EAAE,gBAAgB;AAC3B,QAAA,cAAc,EAAE,oBAAoB;AACpC,QAAA,kBAAkB,EAAE,CAAA,8LAAA,CAAgM;AACpN,QAAA,MAAM,EAAE,8BAA8B;AACtC,QAAA,aAAa,EAAE;AACb,YAAA,WAAW,EAAE;AACX,gBAAA,SAAS,EAAE,eAAe;AAC3B,aAAA;AACF,SAAA;AACF,KAAA;;;;;"}