Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

GraphQl-309: [Checkout] Checkout Agreements #504

Merged

Conversation

VitaliyBoyko
Copy link
Contributor

@VitaliyBoyko VitaliyBoyko commented Mar 20, 2019

Description (*)

Added coverage for checkout agreements.

#309 Checkout Agreement coverage

Sample query:

{
  checkoutAgreements {
    agreement_id
    name
    content
    content_height
    checkbox_text
    is_html
  }
}

Vitaliy Boyko added 2 commits March 21, 2019 09:30
…rage' of github.com:magento/graphql-ce into graphQl-309-checkout-agreement-coverage
@naydav
Copy link
Contributor

naydav commented Mar 30, 2019

@galaoleksandr Pls, test this PR
Thanks

app/code/Magento/CheckoutAgreementsGraphQl/etc/module.xml Outdated Show resolved Hide resolved
# See COPYING.txt for license details.

type Query {
checkoutAgreements: [CheckoutAgreement] @resolver(class: "Magento\\CheckoutAgreementsGraphQl\\Model\\Resolver\\CheckoutAgreements") @doc(description: "The Checkout Agreements query returns information about a Checkout Agreements")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Checkout Agreements query returns information about a Checkout Agreements :)

*/
public function getData(): array
{
$this->searchCriteriaBuilder->addFilter(AgreementInterface::IS_ACTIVE, true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add support of store (with tests coverage)

Also, looks using the collection (which we can consider as query API)

$agreements = $this->agreementCollectionFactory->create();
$agreements->addStoreFilter($this->_storeManager->getStore()->getId()); // TODO: store should be get from query context
 $agreements->addFieldToFilter('is_active', 1);

@naydav naydav changed the title graphQl-309: added agreement coverage GraphQl-309: [Checkout] Checkout Agreements May 2, 2019
@magento-engcom-team magento-engcom-team merged commit 4d7be93 into 2.3-develop May 10, 2019
@ghost
Copy link

ghost commented May 10, 2019

Hi @VitaliyBoyko, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants