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
42
42
{
43
43
$ attributes = [];
44
44
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
+ }
45
51
$ attributes [] = ['entity_type ' => $ this ->type , 'attribute_code ' => $ attribute ->getAttributeCode ()];
46
52
}
47
53
return $ attributes ;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ type Query {
11
11
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" )
12
12
attributesForm (formCode : String ! @doc (description : " Form code." )): AttributesFormOutput !
13
13
@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. " )
15
15
@cache (cacheIdentity : " Magento\\ Eav\\ Model\\ Cache\\ AttributesFormIdentity" )
16
16
attributesList (
17
17
entityType : AttributeEntityTypeEnum ! @doc (description : " Entity type." )
Original file line number Diff line number Diff line change @@ -87,6 +87,8 @@ public function testAttributesForm(): void
87
87
}
88
88
$ this ->assertNotContains ($ attribute2 ->getAttributeCode (), $ item );
89
89
$ this ->assertNotContains ($ attribute3 ->getAttributeCode (), $ item );
90
+ $ this ->assertNotContains ('region_id ' , $ item );
91
+ $ this ->assertNotContains ('country_id ' , $ item );
90
92
}
91
93
$ this ->fail (sprintf ("Attribute '%s' not found in query response " , $ attribute1 ->getAttributeCode ()));
92
94
}
You can’t perform that action at this time.
0 commit comments