-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Requesting price summary fragment in shipping info mutation. #2445
Changes from all commits
2141979
0b6e452
9104dbf
d901eae
a2b0cb4
96555dd
553e312
52e90f9
06608bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
import gql from 'graphql-tag'; | ||
import { PriceSummaryFragment } from '../../CartPage/PriceSummary/priceSummaryFragments'; | ||
|
||
// We disable linting for local fields because there is no way to add them to | ||
// the fetched schema. | ||
// https://github.com/apollographql/eslint-plugin-graphql/issues/99 | ||
export const AvailablePaymentMethodsFragment = gql` | ||
fragment AvailablePaymentMethodsFragment on Cart { | ||
id | ||
available_payment_methods { | ||
code | ||
title | ||
} | ||
} | ||
`; | ||
|
||
/* eslint-disable graphql/template-strings */ | ||
export const GET_PAYMENT_INFORMATION = gql` | ||
query getPaymentInformation($cartId: String!) { | ||
cart(cart_id: $cartId) @connection(key: "Cart") { | ||
id | ||
available_payment_methods { | ||
code | ||
title | ||
} | ||
selected_payment_method { | ||
code | ||
} | ||
|
@@ -29,8 +36,10 @@ export const GET_PAYMENT_INFORMATION = gql` | |
} | ||
telephone | ||
} | ||
...AvailablePaymentMethodsFragment | ||
} | ||
} | ||
${AvailablePaymentMethodsFragment} | ||
`; | ||
|
||
/* eslint-disable graphql/required-fields */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not related to this PR, but couldn't help but notice this rule get disabled, and never re-enabled. This is probably preventing any file after this from being properly linted. Consider fixing in this scope, or please create a followup task to resolve this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch Tommy. Havn't noticed that. Also looks like my linter is not working 😓 . Fixed it in 06608bf |
||
|
@@ -42,6 +51,7 @@ export const GET_PAYMENT_NONCE = gql` | |
} | ||
`; | ||
|
||
/* eslint-enable graphql/required-fields */ | ||
/* eslint-enable graphql/template-strings */ | ||
|
||
export const SET_BILLING_ADDRESS = gql` | ||
|
@@ -90,9 +100,13 @@ export const SET_BILLING_ADDRESS = gql` | |
postcode | ||
telephone | ||
} | ||
...PriceSummaryFragment | ||
...AvailablePaymentMethodsFragment | ||
} | ||
} | ||
} | ||
${PriceSummaryFragment} | ||
${AvailablePaymentMethodsFragment} | ||
`; | ||
|
||
// Sets the provided payment method object on the cart. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On line 28 in this file too, I think we intended to turn the lint rule back on.