-
Notifications
You must be signed in to change notification settings - Fork 153
cms block, get by identifier and #635 #669
cms block, get by identifier and #635 #669
Conversation
TestCase 1: (changes required) |
Test Case 2: (no changes are required, test coverage only) |
@naydav, I will create few issues found during testing this PR as a separate tasks. |
#671 reproducible here |
@GovindaSharma you have uncompleted tasks:
|
@@ -15,7 +15,8 @@ type Query { | |||
id: Int @doc(description: "Id of the CMS page") | |||
): CmsPage @resolver(class: "Magento\\CmsGraphQl\\Model\\Resolver\\Page") @doc(description: "The CMS page query returns information about a CMS page") @cache(cacheTag: "cms_p", cacheIdentity: "Magento\\CmsGraphQl\\Model\\Resolver\\Page\\Identity") | |||
cmsBlocks ( | |||
identifiers: [String] @doc(description: "Identifiers of the CMS blocks") | |||
identifiers: [String] @doc(description: "Identifiers of the CMS blocks"), | |||
scope_code: [String] @doc(description: "Scope Code of the CMS blocks") |
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.
Case: send
query {
storeConfig {
id
website_id
}
cmsBlocks(
identifiers: null
scope_code: null
) {
items {
content
}
}
}
and get this "message": "\"identifiers\" of CMS blocks should be specified"
send another
query {
storeConfig {
id
website_id
}
cmsBlocks(
identifiers: ""
scope_code: null
) {
items {
content
}
}
}
and get "message": "Scope Code of CMS blocks should be specified"
then send
query {
storeConfig {
id
website_id
}
cmsBlocks(
identifiers: ""
scope_code: ""
) {
items {
content
}
}
}
and get "The CMS block with the "" ID doesn't exist."
@naydav, why identifiers
is not required field. What is the point of sending empty strings. I have seen many times that sending "" or null results in error that some field is not-nullable. Maybe the better logic is to check if the property is omitted and thn address it to all
or default
equivalent in REST rather than allowing empty strings?
hi @TomashKhamlai thanks for your review.Just wanted to know only unit test i have to fix right? or is there any other thing i have to check also? |
@GovindaSharma, in GraphQL we cover with api-functional tests, but fixtures are taken from integration. To learn more check accepted/merged PRs or better visit these pages: And if you have some free time, I invite you join our conversation #635, because the issue you are trying to fix was reproducible but now it isn't. Perhaps it is still reproducible in certain cases. |
Generally, it works. You tried to implement scope selection as an input parameter, but we already use headers for defining the scope. @GovindaSharma, do you want to continue to work on this issue? I've added a comment today. Please respond to this message. We are thinking about closing this PR but your feedback is important for us. In case you are reading this message when PR is closed, don't be shy to create another PR for the same issue. Thank you for your interest. |
Agee with @TomashKhamlai. The scope should be passed as a header. |
Hi @GovindaSharma, thank you for your contribution! |
fixed issue #635 cms block, get by identifier
Description (*)
fixed issue #635 cms block, get by identifier
Fixed Issues (if relevant)
Manual testing scenarios (*)
Steps to reproduce (*)
Now the query will be
in scope_code store code need to be passed and it will fetch according to store
Contribution checklist (*)