diff --git a/.changeset/fuzzy-beds-lick.md b/.changeset/fuzzy-beds-lick.md new file mode 100644 index 0000000000..99597b6611 --- /dev/null +++ b/.changeset/fuzzy-beds-lick.md @@ -0,0 +1,5 @@ +--- +"@bigcommerce/catalyst-core": patch +--- + +Rename some GQL query/mutations/fragments to standardized naming. diff --git a/core/app/[locale]/(default)/(auth)/change-password/_actions/change-password.ts b/core/app/[locale]/(default)/(auth)/change-password/_actions/change-password.ts index a524bf8b9e..27c71968d5 100644 --- a/core/app/[locale]/(default)/(auth)/change-password/_actions/change-password.ts +++ b/core/app/[locale]/(default)/(auth)/change-password/_actions/change-password.ts @@ -10,7 +10,7 @@ import { client } from '~/client'; import { graphql } from '~/client/graphql'; const ChangePasswordMutation = graphql(` - mutation ChangePassword($input: ResetPasswordInput!) { + mutation ChangePasswordMutation($input: ResetPasswordInput!) { customer { resetPassword(input: $input) { __typename diff --git a/core/app/[locale]/(default)/(auth)/login/forgot-password/_actions/reset-password.ts b/core/app/[locale]/(default)/(auth)/login/forgot-password/_actions/reset-password.ts index ec99bf90ae..4dc905eec3 100644 --- a/core/app/[locale]/(default)/(auth)/login/forgot-password/_actions/reset-password.ts +++ b/core/app/[locale]/(default)/(auth)/login/forgot-password/_actions/reset-password.ts @@ -10,7 +10,7 @@ import { client } from '~/client'; import { graphql } from '~/client/graphql'; const ResetPasswordMutation = graphql(` - mutation ResetPassword($input: RequestResetPasswordInput!, $reCaptcha: ReCaptchaV2Input) { + mutation ResetPasswordMutation($input: RequestResetPasswordInput!, $reCaptcha: ReCaptchaV2Input) { customer { requestResetPassword(input: $input, reCaptchaV2: $reCaptcha) { __typename diff --git a/core/app/[locale]/(default)/(auth)/register/_actions/register-customer.ts b/core/app/[locale]/(default)/(auth)/register/_actions/register-customer.ts index 6e93c2a6be..8a9f41d54c 100644 --- a/core/app/[locale]/(default)/(auth)/register/_actions/register-customer.ts +++ b/core/app/[locale]/(default)/(auth)/register/_actions/register-customer.ts @@ -14,7 +14,10 @@ import { FieldNameToFieldId } from '~/data-transformers/form-field-transformer/u import { redirect } from '~/i18n/routing'; const RegisterCustomerMutation = graphql(` - mutation RegisterCustomer($input: RegisterCustomerInput!, $reCaptchaV2: ReCaptchaV2Input) { + mutation RegisterCustomerMutation( + $input: RegisterCustomerInput! + $reCaptchaV2: ReCaptchaV2Input + ) { customer { registerCustomer(input: $input, reCaptchaV2: $reCaptchaV2) { customer { diff --git a/core/app/[locale]/(default)/account/settings/_actions/update-customer.ts b/core/app/[locale]/(default)/account/settings/_actions/update-customer.ts index 1bdec9cc85..a3b69e73ef 100644 --- a/core/app/[locale]/(default)/account/settings/_actions/update-customer.ts +++ b/core/app/[locale]/(default)/account/settings/_actions/update-customer.ts @@ -6,13 +6,12 @@ import { unstable_expireTag } from 'next/cache'; import { getTranslations } from 'next-intl/server'; import { updateAccountSchema } from '@/vibes/soul/sections/account-settings-section/schema'; +import { UpdateAccountAction } from '@/vibes/soul/sections/account-settings-section/update-account-form'; import { getSessionCustomerAccessToken } from '~/auth'; import { client } from '~/client'; import { graphql } from '~/client/graphql'; import { TAGS } from '~/client/tags'; -import { UpdateAccountAction } from '../../../../../../vibes/soul/sections/account-settings-section/update-account-form'; - const UpdateCustomerMutation = graphql(` mutation UpdateCustomerMutation($input: UpdateCustomerInput!) { customer { diff --git a/core/app/[locale]/(default)/cart/page-data.ts b/core/app/[locale]/(default)/cart/page-data.ts index f60971ebbf..02b4b00e0b 100644 --- a/core/app/[locale]/(default)/cart/page-data.ts +++ b/core/app/[locale]/(default)/cart/page-data.ts @@ -122,7 +122,7 @@ export const DigitalItemFragment = graphql(` `); const MoneyFieldsFragment = graphql(` - fragment MoneyFields on Money { + fragment MoneyFieldsFragment on Money { currencyCode value } @@ -148,18 +148,18 @@ const CartPageQuery = graphql( } checkout(entityId: $cartId) { subtotal { - ...MoneyFields + ...MoneyFieldsFragment } grandTotal { - ...MoneyFields + ...MoneyFieldsFragment } taxTotal { - ...MoneyFields + ...MoneyFieldsFragment } cart { currencyCode discountedAmount { - ...MoneyFields + ...MoneyFieldsFragment } } } diff --git a/core/app/[locale]/(default)/webpages/[id]/layout.tsx b/core/app/[locale]/(default)/webpages/[id]/layout.tsx index 83cde53716..af4ae7b1fd 100644 --- a/core/app/[locale]/(default)/webpages/[id]/layout.tsx +++ b/core/app/[locale]/(default)/webpages/[id]/layout.tsx @@ -12,7 +12,7 @@ interface Props extends React.PropsWithChildren { } const WebPageChildrenQuery = graphql(` - query WebPageChildren($id: ID!) { + query WebPageChildrenQuery($id: ID!) { node(id: $id) { ... on WebPage { children(first: 20) { diff --git a/core/app/favicon.ico/route.ts b/core/app/favicon.ico/route.ts index f79e7bf387..e3f8610c3c 100644 --- a/core/app/favicon.ico/route.ts +++ b/core/app/favicon.ico/route.ts @@ -15,7 +15,7 @@ import { graphql } from '~/client/graphql'; import { defaultLocale } from '~/i18n/routing'; const GetFaviconQuery = graphql(` - query GetFavicon { + query GetFaviconQuery { site { settings { faviconUrl diff --git a/core/app/robots.txt/route.ts b/core/app/robots.txt/route.ts index d32dc5eb34..7e4e9b178b 100644 --- a/core/app/robots.txt/route.ts +++ b/core/app/robots.txt/route.ts @@ -16,7 +16,7 @@ import { graphql } from '~/client/graphql'; import { defaultLocale } from '~/i18n/routing'; const RobotsTxtQuery = graphql(` - query RobotsTxt { + query RobotsTxtQuery { site { settings { robotsTxt diff --git a/core/auth/index.ts b/core/auth/index.ts index b5010f4b8b..fd3177691d 100644 --- a/core/auth/index.ts +++ b/core/auth/index.ts @@ -9,7 +9,7 @@ import { graphql } from '~/client/graphql'; import { getCartId } from '~/lib/cart'; const LoginMutation = graphql(` - mutation Login($email: String!, $password: String!, $cartEntityId: String) { + mutation LoginMutation($email: String!, $password: String!, $cartEntityId: String) { login(email: $email, password: $password, guestCartEntityId: $cartEntityId) { customerAccessToken { value @@ -25,7 +25,7 @@ const LoginMutation = graphql(` `); const LoginWithTokenMutation = graphql(` - mutation LoginWithCustomerLoginJwt($jwt: String!, $cartEntityId: String) { + mutation LoginWithCustomerLoginJwtMutation($jwt: String!, $cartEntityId: String) { loginWithCustomerLoginJwt(jwt: $jwt, guestCartEntityId: $cartEntityId) { customerAccessToken { value diff --git a/core/components/header/_actions/switch-currency.ts b/core/components/header/_actions/switch-currency.ts index b667d806df..62103fce39 100644 --- a/core/components/header/_actions/switch-currency.ts +++ b/core/components/header/_actions/switch-currency.ts @@ -22,7 +22,7 @@ const currencySwitchSchema = z.object({ // Note: this results in a new cart being created in the new currency, so the cart ID will change const UpdateCartCurrencyMutation = graphql(` - mutation UpdateCartCurrency($input: UpdateCartCurrencyInput!) { + mutation UpdateCartCurrencyMutation($input: UpdateCartCurrencyInput!) { cart { updateCartCurrency(input: $input) { cart { diff --git a/core/middlewares/with-routes.ts b/core/middlewares/with-routes.ts index 6cbc035c5a..86e2d020be 100644 --- a/core/middlewares/with-routes.ts +++ b/core/middlewares/with-routes.ts @@ -11,7 +11,7 @@ import { kv } from '../lib/kv'; import { type MiddlewareFactory } from './compose-middlewares'; const GetRouteQuery = graphql(` - query getRoute($path: String!) { + query GetRouteQuery($path: String!) { site { route(path: $path, redirectBehavior: FOLLOW) { redirect {