From a384532119f1dc8d9f4a81faa8c9932956cf8b0a Mon Sep 17 00:00:00 2001 From: Patrick McLain Date: Thu, 11 Jul 2019 22:47:49 -0400 Subject: [PATCH 1/3] Reference for checkoutAgreement GraphQl query Fixes magento/graphql-ce#767 --- .../graphql/reference/checkout-aggreements.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 guides/v2.3/graphql/reference/checkout-aggreements.md diff --git a/guides/v2.3/graphql/reference/checkout-aggreements.md b/guides/v2.3/graphql/reference/checkout-aggreements.md new file mode 100644 index 00000000000..efaa105da37 --- /dev/null +++ b/guides/v2.3/graphql/reference/checkout-aggreements.md @@ -0,0 +1,71 @@ +--- +group: graphql +title: Directory endpoint +contributor_name: Something Digital +contributor_link: https://www.somethingdigital.com/ +--- + +To retrieve enabled checkout agreements. The query will always return an empty array when +`checkout/options/enable_agreements` is disabled. + +### CheckoutAgreement attributes {#countryAttributes} + +The `CheckoutAgreement` object provides the following attributes: + +Attribute | Data type | Description +--- | --- | --- +`agreement_id` | Integer | Checkout Agreement identifier +`name` | String | Checkout Agreement name +`content` | String | Checkout Agreement plaintext or HTML content +`content_height` | String | CSS height of Checkout Agreement +`checkbox_text` | String | Checkout Agreement checkbox label +`is_html` | Boolean | Is Checkout Agreement content in HTML format +`mode` | [CheckoutAgreementMode](#checkoutAgreementMode) | An array of regions within a particular country + +### CheckoutAgreementMode enumerable {#checkoutAgreementMode} +- AUTO +- MANUAL + +#### Syntax + +`{checkoutAgreements {CheckoutAgreement}}` + +### Example usage + +The following query returns enabled checkout agreements. + +**Request** + +```text +{ + checkoutAgreements { + agreement_id + checkbox_text + content + content_height + is_html + mode + name + } +} +``` + +**Response** + +```json +{ + "data": { + "checkoutAgreements": [ + { + "agreement_id": 1, + "checkbox_text": "I agree to the terms of sale", + "content": "

Agreement Contents

\r\n

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

", + "content_height": "22px", + "is_html": true, + "mode": "AUTO", + "name": "My Agreement" + } + ] + } +} +``` From dbd8ee2ced219112516709d2564a31238e4b2051 Mon Sep 17 00:00:00 2001 From: Patrick McLain Date: Mon, 22 Jul 2019 17:43:30 -0400 Subject: [PATCH 2/3] Requested revisions --- .../graphql/reference/checkout-aggreements.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/guides/v2.3/graphql/reference/checkout-aggreements.md b/guides/v2.3/graphql/reference/checkout-aggreements.md index efaa105da37..63874628e62 100644 --- a/guides/v2.3/graphql/reference/checkout-aggreements.md +++ b/guides/v2.3/graphql/reference/checkout-aggreements.md @@ -1,36 +1,32 @@ --- group: graphql -title: Directory endpoint +title: checkoutAgreements query contributor_name: Something Digital contributor_link: https://www.somethingdigital.com/ --- -To retrieve enabled checkout agreements. The query will always return an empty array when -`checkout/options/enable_agreements` is disabled. +The `checkoutAgreements` query retrieves checkout agreements. The query will always return an empty array when the +**Enable Terms and Conditions** option is set to **No**. (The config path is `checkout/options/enable_agreements`.) -### CheckoutAgreement attributes {#countryAttributes} +### CheckoutAgreement attributes {#checkoutAgreementAttributes} The `CheckoutAgreement` object provides the following attributes: Attribute | Data type | Description --- | --- | --- -`agreement_id` | Integer | Checkout Agreement identifier -`name` | String | Checkout Agreement name -`content` | String | Checkout Agreement plaintext or HTML content +`agreement_id` | Integer! | Checkout Agreement identifier +`checkbox_text` | String! | Label of the Checkout Agreement checkbox +`content` | String! | The content of the Checkout Agreement. The value can be in plain text or in HTML `content_height` | String | CSS height of Checkout Agreement -`checkbox_text` | String | Checkout Agreement checkbox label -`is_html` | Boolean | Is Checkout Agreement content in HTML format -`mode` | [CheckoutAgreementMode](#checkoutAgreementMode) | An array of regions within a particular country +`is_html` | Boolean! | Is Checkout Agreement content in HTML format +`mode` | String! | Indicates whether terms and conditions are applied manually (`MANUAL`) or automatically (`AUTO`) +`name` | String! | Checkout Agreement name -### CheckoutAgreementMode enumerable {#checkoutAgreementMode} -- AUTO -- MANUAL - -#### Syntax +## Syntax `{checkoutAgreements {CheckoutAgreement}}` -### Example usage +## Example usage The following query returns enabled checkout agreements. @@ -69,3 +65,7 @@ The following query returns enabled checkout agreements. } } ``` + +## Output attributes + +The `CheckoutAgreements` object contains an array of [`CheckoutAgreement`](#checkoutAgreementAttributes) objects. From 1f140d90a359d81f298b07397a9793ec1b37c87a Mon Sep 17 00:00:00 2001 From: Patrick McLain Date: Tue, 23 Jul 2019 20:51:49 -0400 Subject: [PATCH 3/3] Move output attributes to end of document --- .../graphql/reference/checkout-aggreements.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/guides/v2.3/graphql/reference/checkout-aggreements.md b/guides/v2.3/graphql/reference/checkout-aggreements.md index 63874628e62..932c1893f00 100644 --- a/guides/v2.3/graphql/reference/checkout-aggreements.md +++ b/guides/v2.3/graphql/reference/checkout-aggreements.md @@ -8,20 +8,6 @@ contributor_link: https://www.somethingdigital.com/ The `checkoutAgreements` query retrieves checkout agreements. The query will always return an empty array when the **Enable Terms and Conditions** option is set to **No**. (The config path is `checkout/options/enable_agreements`.) -### CheckoutAgreement attributes {#checkoutAgreementAttributes} - -The `CheckoutAgreement` object provides the following attributes: - -Attribute | Data type | Description ---- | --- | --- -`agreement_id` | Integer! | Checkout Agreement identifier -`checkbox_text` | String! | Label of the Checkout Agreement checkbox -`content` | String! | The content of the Checkout Agreement. The value can be in plain text or in HTML -`content_height` | String | CSS height of Checkout Agreement -`is_html` | Boolean! | Is Checkout Agreement content in HTML format -`mode` | String! | Indicates whether terms and conditions are applied manually (`MANUAL`) or automatically (`AUTO`) -`name` | String! | Checkout Agreement name - ## Syntax `{checkoutAgreements {CheckoutAgreement}}` @@ -69,3 +55,17 @@ The following query returns enabled checkout agreements. ## Output attributes The `CheckoutAgreements` object contains an array of [`CheckoutAgreement`](#checkoutAgreementAttributes) objects. + +### CheckoutAgreement attributes {#checkoutAgreementAttributes} + +The `CheckoutAgreement` object provides the following attributes: + +Attribute | Data type | Description +--- | --- | --- +`agreement_id` | Integer! | Checkout Agreement identifier +`checkbox_text` | String! | Label of the Checkout Agreement checkbox +`content` | String! | The content of the Checkout Agreement. The value can be in plain text or in HTML +`content_height` | String | CSS height of Checkout Agreement +`is_html` | Boolean! | Is Checkout Agreement content in HTML format +`mode` | String! | Indicates whether terms and conditions are applied manually (`MANUAL`) or automatically (`AUTO`) +`name` | String! | Checkout Agreement name