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

387-Test coverage of getting IDs of CMS page/blocks by GraphQL API #585

Merged
merged 15 commits into from
May 10, 2019

Conversation

atwixfirster
Copy link
Contributor

Issue: #387

Thank you!

@vpodorozh vpodorozh assigned vpodorozh and unassigned vpodorozh Apr 13, 2019
@vpodorozh vpodorozh self-requested a review April 13, 2019 09:58
Copy link
Contributor

@vpodorozh vpodorozh left a comment

Choose a reason for hiding this comment

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

@atwixfirster - thank you for your contribution!
Please review my change request - it is mostly related to backward compatibility.
Thx!

@naydav
Copy link
Contributor

naydav commented Apr 16, 2019

@galaoleksandr @atwixfirster
Looks like we don't need to expand scheme with surrogate(internal/technical) keys.

page_id for Page and block_id for Block are surrogate keys, you should use identifier key for loading of these entities.

The same situation with a Product where sku is a natural identifier but not entity_id (needed just for internal purposes)
That's why we don't provide a possibility to get Product by entity_id in GraphQL

But we still have these fields in Api
\Magento\Cms\Api\Data\BlockInterface::BLOCK_ID
\Magento\Cms\Api\Data\PageInterface::PAGE_ID

@paliarush
Please, share your opinion
Thanks

@naydav naydav added the question Further information is requested label Apr 16, 2019
@vpodorozh
Copy link
Contributor

Hi @naydav - thx for clarifications.
I want to make sure that I've understood you correctly, so we need to do the next:

  1. Do not expand type CmsBlock with block_id - identifier should be used instead;
  2. type CmsPage should be expanded only with identifier (page_id should not be added);
  3. Query interface for cmsPage should be expanded with identifier argument - to make it possible to get data via this key (but not id);
  4. Query interface for cmsPage should keep id argument to keep backwards-compatibility;

Am I right?

@naydav
Copy link
Contributor

naydav commented Apr 17, 2019

Hi @naydav - thx for clarifications.
I want to make sure that I've understood you correctly, so we need to do the next:

  1. Do not expand type CmsBlock with block_id - identifier should be used instead;
  2. type CmsPage should be expanded only with identifier (page_id should not be added);
  3. Query interface for cmsPage should be expanded with identifier argument - to make it possible to get data via this key (but not id);
  4. Query interface for cmsPage should keep id argument to keep backwards-compatibility;

Am I right?

Correct (and mark it as deprecated with a resolution like use use identifier)
Thanks

@TomashKhamlai TomashKhamlai added the QA in progress We are checking label Apr 24, 2019
Merge remote-tracking branch 'origin/2.3-develop' into 387-test-coverage-cms-page

# Conflicts:
#	app/code/Magento/CmsGraphQl/etc/schema.graphqls
@vpodorozh
Copy link
Contributor

Note, I've reported a separate issue for fixing integration tests: #654
1) Magento\GraphQlCache\Controller\Cms\CmsPageCacheTest::testToCheckCmsPageRequestCacheTags Failed asserting that two arrays are equal.

Seems that this failed test caused by changes in cache tag policy for cms page in magento core.

Copy link
Contributor

@vpodorozh vpodorozh left a comment

Choose a reason for hiding this comment

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

@atwixfirster - could you please take a look at my change request?
Thx!

app/code/Magento/CmsGraphQl/Model/Resolver/Page.php Outdated Show resolved Hide resolved
app/code/Magento/CmsGraphQl/etc/schema.graphqls Outdated Show resolved Hide resolved
app/code/Magento/CmsGraphQl/Model/Resolver/Page.php Outdated Show resolved Hide resolved
app/code/Magento/CmsGraphQl/Model/Resolver/Page.php Outdated Show resolved Hide resolved
@vpodorozh
Copy link
Contributor

I'm checking the PR

Copy link
Contributor

@vpodorozh vpodorozh left a comment

Choose a reason for hiding this comment

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

Hi, last circle of review for backward compatibility policy.
Thx!

@vpodorozh
Copy link
Contributor

@atwixfirster - I've just got insight for @naydav about backwards-compatibility policy in GraphQl project.
For graphql - only schema can be counted as a contract.

So sorry for my snobbism about backwards-compatibility policy :)

@atwixfirster
Copy link
Contributor Author

@atwixfirster - I've just got insight for @naydav about backwards-compatibility policy in GraphQl project.
For graphql - only schema can be counted as a contract.

So sorry for my snobbism about backwards-compatibility policy :)

sounds like APPROVE? 😊

Thank you for the reviewing!

@magento-engcom-team magento-engcom-team merged commit 787d31b into 2.3-develop May 10, 2019
@ghost
Copy link

ghost commented May 10, 2019

Hi @atwixfirster, 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.

5 participants