File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
CustomerGraphQl/Model/Customer
dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/Attribute Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,12 @@ public function execute(string $formCode): ?array
4242 {
4343 $ attributes = [];
4444 foreach ($ this ->entity ->getAttributes ($ formCode ) as $ attribute ) {
45+ // region_id and country_id returns large datasets that is also not related between each other and
46+ // not filterable. DirectoryGraphQl contains queries that allow to retrieve this information in a
47+ // meaningful way
48+ if ($ attribute ->getAttributeCode () === 'region_id ' || $ attribute ->getAttributeCode () === 'country_id ' ) {
49+ continue ;
50+ }
4551 $ attributes [] = ['entity_type ' => $ this ->type , 'attribute_code ' => $ attribute ->getAttributeCode ()];
4652 }
4753 return $ attributes ;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ type Query {
1111 customAttributeMetadataV2 (attributes : [AttributeInput ! ]): AttributesMetadataOutput ! @resolver (class : " Magento\\ EavGraphQl\\ Model\\ Resolver\\ AttributesMetadata" ) @doc (description : " Retrieve EAV attributes metadata." ) @cache (cacheIdentity : " Magento\\ EavGraphQl\\ Model\\ Resolver\\ Cache\\ CustomAttributeMetadataV2Identity" )
1212 attributesForm (formCode : String ! @doc (description : " Form code." )): AttributesFormOutput !
1313 @resolver (class : " Magento\\ EavGraphQl\\ Model\\ Resolver\\ AttributesForm" )
14- @doc (description : " Retrieve EAV attributes associated to a frontend form." )
14+ @doc (description : " Retrieve EAV attributes associated to a frontend form. For region_id and country_id attributes information use DirectoryGraphQl module. " )
1515 @cache (cacheIdentity : " Magento\\ Eav\\ Model\\ Cache\\ AttributesFormIdentity" )
1616 attributesList (
1717 entityType : AttributeEntityTypeEnum ! @doc (description : " Entity type." )
Original file line number Diff line number Diff line change @@ -87,6 +87,8 @@ public function testAttributesForm(): void
8787 }
8888 $ this ->assertNotContains ($ attribute2 ->getAttributeCode (), $ item );
8989 $ this ->assertNotContains ($ attribute3 ->getAttributeCode (), $ item );
90+ $ this ->assertNotContains ('region_id ' , $ item );
91+ $ this ->assertNotContains ('country_id ' , $ item );
9092 }
9193 $ this ->fail (sprintf ("Attribute '%s' not found in query response " , $ attribute1 ->getAttributeCode ()));
9294 }
You can’t perform that action at this time.
0 commit comments