Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shopify wishlist implementation #724

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
}
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,17 @@
"dev": "turbo run dev",
"start": "turbo run start",
"types": "turbo run types",
"prettier-fix": "prettier --write ."
"prettier-fix": "prettier --write .",
"generate": "graphql-codegen --config codegen.yml"
},
"devDependencies": {
"@graphql-codegen/cli": "2.6.2",
"@graphql-codegen/introspection": "2.1.1",
"@graphql-codegen/typescript": "2.4.8",
"@graphql-codegen/typescript-document-nodes": "2.2.8",
"@graphql-codegen/typescript-graphql-files-modules": "2.1.1",
"@graphql-codegen/typescript-operations": "2.3.5",
"@types/node": "^17.0.24",
"husky": "^7.0.4",
"prettier": "^2.5.1",
"turbo": "^1.1.2"
Expand Down
6 changes: 4 additions & 2 deletions packages/commerce/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ export interface CommerceAPIConfig {
fetch<Data = any, Variables = any>(
query: string,
queryData?: CommerceAPIFetchOptions<Variables>,
fetchOptions?: FetchOptions
fetchOptions?: FetchOptions,
useAdminApi?: boolean
): Promise<GraphQLFetcherResult<Data>>
}

Expand All @@ -170,7 +171,8 @@ export type GraphQLFetcher<
> = (
query: string,
queryData?: CommerceAPIFetchOptions<Variables>,
fetchOptions?: FetchOptions
fetchOptions?: FetchOptions,
useAdminApi?: boolean
) => Promise<Data>

export interface GraphQLFetcherResult<Data = any> {
Expand Down
1 change: 1 addition & 0 deletions packages/commerce/src/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export type FetcherOptions<Body = any> = {
method?: string
variables?: any
body?: Body
useAdminApi?: boolean
}

export type HookFetcher<Data, Input = null, Result = any> = (
Expand Down
3 changes: 3 additions & 0 deletions packages/local/src/wishlist/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { default as useAddItem } from './use-add-item'
export { default as useWishlist } from './use-wishlist'
export { default as useRemoveItem } from './use-remove-item'
1 change: 1 addition & 0 deletions packages/shopify/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ COMMERCE_PROVIDER=shopify

NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN=
NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN=
SHOPIFY_ADMIN_ACCESS_TOKEN=
Loading