diff --git a/lib/bigcommerce/api/catalog/handlers/get-products.ts b/lib/bigcommerce/api/catalog/handlers/get-products.ts index c8dfd8ce3..b05548e40 100644 --- a/lib/bigcommerce/api/catalog/handlers/get-products.ts +++ b/lib/bigcommerce/api/catalog/handlers/get-products.ts @@ -49,6 +49,7 @@ const getProducts: ProductsHandlers['getProducts'] = async ({ // We want the GraphQL version of each product const graphqlData = await getAllProducts({ variables: { first: LIMIT, entityIds }, + config, }) // Put the products in an object that we can use to get them by id const productsById = graphqlData.products.reduce<{ diff --git a/lib/bigcommerce/api/customers/handlers/create-customer.ts b/lib/bigcommerce/api/customers/handlers/create-customer.ts index d0993a62e..a666467ab 100644 --- a/lib/bigcommerce/api/customers/handlers/create-customer.ts +++ b/lib/bigcommerce/api/customers/handlers/create-customer.ts @@ -1,5 +1,6 @@ import { BigcommerceApiError } from '../../utils/errors' -import { CustomersHandlers } from '..' +import login from '../../operations/login' +import type { CustomersHandlers } from '..' const createCustomer: CustomersHandlers['createCustomer'] = async ({ res, @@ -54,6 +55,12 @@ const createCustomer: CustomersHandlers['createCustomer'] = async ({ throw error } + console.log('DATA', result.data) + + const loginData = await login({ variables: { email, password }, config }) + + console.log('LOGIN DATA', loginData) + res.status(200).json({ data: result.data ?? null }) } diff --git a/lib/bigcommerce/schema.d.ts b/lib/bigcommerce/schema.d.ts index e9141337b..eae1c8187 100644 --- a/lib/bigcommerce/schema.d.ts +++ b/lib/bigcommerce/schema.d.ts @@ -1926,3 +1926,12 @@ export type GetSiteInfoQuery = { __typename?: 'Query' } & { } } } + +export type LoginMutationVariables = Exact<{ + email: Scalars['String'] + password: Scalars['String'] +}> + +export type LoginMutation = { __typename?: 'Mutation' } & { + login: { __typename?: 'LoginResult' } & Pick +}