diff --git a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls index b1790f4bc628b..81bd4d84b1059 100644 --- a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls @@ -123,6 +123,8 @@ interface ProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\ categories: [CategoryInterface] @doc(description: "The categories assigned to a product.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Categories") @cache(cacheIdentity: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\CategoriesIdentity") canonical_url: String @doc(description: "Relative canonical URL. This value is returned only if the system setting 'Use Canonical Link Meta Tag For Products' is enabled") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CanonicalUrl") media_gallery: [MediaGalleryInterface] @doc(description: "An array of Media Gallery objects.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\MediaGallery") + has_options: Boolean @doc(description: "Indicates whether additional options have been created for the product.") + required_options: Boolean @doc(description: "Indicates whether the product has required options.") } interface PhysicalProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\ProductInterfaceTypeResolverComposite") @doc(description: "PhysicalProductInterface contains attributes specific to tangible products.") { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductHasOptionsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductHasOptionsTest.php new file mode 100644 index 0000000000000..a92a2d11bd72b --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductHasOptionsTest.php @@ -0,0 +1,43 @@ +graphQlQuery($query); + + $this->assertArrayHasKey('has_options', $response['products']['items'][0]); + $this->assertArrayHasKey('required_options', $response['products']['items'][0]); + } +}