pwa-studio icon indicating copy to clipboard operation
pwa-studio copied to clipboard

ProductAttributeMetadata is not declared in GraphQL schema In detail page

Open dilipjha100 opened this issue 2 years ago • 2 comments

{"errors":[{"debugMessage":"Config element "ProductAttributeMetadata" is not declared in GraphQL schema","message":"Internal server error","extensions":{"category":"internal"},"trace":[{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/magento/framework/GraphQl/Schema/Type/TypeRegistry.php","line":68,"call":"Magento\Framework\GraphQl\Config::getConfigElement('ProductAttributeMetadata')"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/magento/framework/GraphQl/Schema/SchemaGenerator.php","line":60,"call":"Magento\Framework\GraphQl\Schema\Type\TypeRegistry::get('ProductAttributeMetadata')"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/webonyx/graphql-php/src/Type/Schema.php","line":350,"call":"Magento\Framework\GraphQl\Schema\SchemaGenerator::Magento\Framework\GraphQl\Schema\{closure}('ProductAttributeMetadata')"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/webonyx/graphql-php/src/Type/Schema.php","line":326,"call":"GraphQL\Type\Schema::loadType('ProductAttributeMetadata')"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/webonyx/graphql-php/src/Utils/AST.php","line":580,"call":"GraphQL\Type\Schema::getType('ProductAttributeMetadata')"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/webonyx/graphql-php/src/Utils/TypeInfo.php","line":436,"call":"GraphQL\Utils\AST::typeFromAST(instance of Magento\Framework\GraphQl\Schema, instance of GraphQL\Language\AST\NamedTypeNode)"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/webonyx/graphql-php/src/Utils/TypeInfo.php","line":314,"call":"GraphQL\Utils\TypeInfo::typeFromAST(instance of Magento\Framework\GraphQl\Schema, instance of GraphQL\Language\AST\NamedTypeNode)"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/webonyx/graphql-php/src/Language/Visitor.php","line":466,"call":"GraphQL\Utils\TypeInfo::enter(instance of GraphQL\Language\AST\InlineFragmentNode)"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/webonyx/graphql-php/src/Language/Visitor.php","line":277,"call":"GraphQL\Language\Visitor::GraphQL\Language\{closure}(instance of GraphQL\Language\AST\InlineFragmentNode, 8, instance of GraphQL\Language\AST\NodeList(10), array(9), array(8))"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/webonyx/graphql-php/src/Validator/ValidationContext.php","line":121,"call":"GraphQL\Language\Visitor::visit(instance of GraphQL\Language\AST\FragmentDefinitionNode, array(2))"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/webonyx/graphql-php/src/Validator/ValidationContext.php","line":85,"call":"GraphQL\Validator\ValidationContext::getVariableUsages(instance of GraphQL\Language\AST\FragmentDefinitionNode)"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/webonyx/graphql-php/src/Validator/Rules/NoUndefinedVariables.php","line":30,"call":"GraphQL\Validator\ValidationContext::getRecursiveVariableUsages(instance of GraphQL\Language\AST\OperationDefinitionNode)"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/webonyx/graphql-php/src/Language/Visitor.php","line":439,"call":"GraphQL\Validator\Rules\NoUndefinedVariables::GraphQL\Validator\Rules\{closure}(instance of GraphQL\Language\AST\OperationDefinitionNode, 0, instance of GraphQL\Language\AST\NodeList(2), array(2), array(1))"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/webonyx/graphql-php/src/Language/Visitor.php","line":486,"call":"GraphQL\Language\Visitor::GraphQL\Language\{closure}(instance of GraphQL\Language\AST\OperationDefinitionNode, 0, instance of GraphQL\Language\AST\NodeList(2), array(2), array(1))"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/webonyx/graphql-php/src/Language/Visitor.php","line":277,"call":"GraphQL\Language\Visitor::GraphQL\Language\{closure}(instance of GraphQL\Language\AST\OperationDefinitionNode, 0, instance of GraphQL\Language\AST\NodeList(2), array(2), array(1))"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/webonyx/graphql-php/src/Validator/DocumentValidator.php","line":224,"call":"GraphQL\Language\Visitor::visit(instance of GraphQL\Language\AST\DocumentNode, array(2))"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/webonyx/graphql-php/src/Validator/DocumentValidator.php","line":116,"call":"GraphQL\Validator\DocumentValidator::visitUsingRules(instance of Magento\Framework\GraphQl\Schema, instance of GraphQL\Utils\TypeInfo, instance of GraphQL\Language\AST\DocumentNode, array(29))"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/webonyx/graphql-php/src/GraphQL.php","line":153,"call":"GraphQL\Validator\DocumentValidator::validate(instance of Magento\Framework\GraphQl\Schema, instance of GraphQL\Language\AST\DocumentNode, array(29))"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/webonyx/graphql-php/src/GraphQL.php","line":94,"call":"GraphQL\GraphQL::promiseToExecute(instance of GraphQL\Executor\Promise\Adapter\SyncPromiseAdapter, instance of Magento\Framework\GraphQl\Schema, 'query getProductDetailForProductPage($urlKey:String!){products(filter:{url_key:{eq:$urlKey}}){items{id uid ...ProductDetailsFragment __typename}__typename}}fragment ProductDetailsFragment on ProductInterface{__typename categories{uid breadcrumbs{category_uid __typename}__typename}description{html __typename}short_description{html __typename}id uid media_gallery_entries{uid label position disabled file __typename}meta_description name price{regularPrice{amount{currency value __typename}__typename}__typename}price_range{maximum_price{final_price{currency value __typename}discount{amount_off __typename}__typename}__typename}sku small_image{url __typename}stock_status url_key custom_attributes{selected_attribute_options{attribute_option{uid label is_default __typename}__typename}entered_attribute_value{value __typename}attribute_metadata{uid code label attribute_labels{store_code label __typename}data_type is_system entity_type ui_input{ui_input_type is_html_allowed __typename}...on ProductAttributeMetadata{used_in_components __typename}__typename}__typename}...on ConfigurableProduct{configurable_options{attribute_code attribute_id uid label values{uid default_label label store_label use_default_value value_index swatch_data{...on ImageSwatchData{thumbnail __typename}value __typename}__typename}__typename}variants{attributes{code value_index __typename}product{uid media_gallery_entries{uid disabled file label position __typename}sku stock_status price{regularPrice{amount{currency value __typename}__typename}__typename}price_range{maximum_price{final_price{currency value __typename}discount{amount_off __typename}__typename}__typename}custom_attributes{selected_attribute_options{attribute_option{uid label is_default __typename}__typename}entered_attribute_value{value __typename}attribute_metadata{uid code label attribute_labels{store_code label __typename}data_type is_system entity_type ui_input{ui_input_type is_html_allowed __typename}...on ProductAttributeMetadata{used_in_components __typename}__typename}__typename}__typename}__typename}__typename}}', null, instance of Magento\GraphQl\Model\Query\Context, array(1), null, null, null)"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/magento/framework/GraphQl/Query/QueryProcessor.php","line":83,"call":"GraphQL\GraphQL::executeQuery(instance of Magento\Framework\GraphQl\Schema, 'query getProductDetailForProductPage($urlKey:String!){products(filter:{url_key:{eq:$urlKey}}){items{id uid ...ProductDetailsFragment __typename}__typename}}fragment ProductDetailsFragment on ProductInterface{__typename categories{uid breadcrumbs{category_uid __typename}__typename}description{html __typename}short_description{html __typename}id uid media_gallery_entries{uid label position disabled file __typename}meta_description name price{regularPrice{amount{currency value __typename}__typename}__typename}price_range{maximum_price{final_price{currency value __typename}discount{amount_off __typename}__typename}__typename}sku small_image{url __typename}stock_status url_key custom_attributes{selected_attribute_options{attribute_option{uid label is_default __typename}__typename}entered_attribute_value{value __typename}attribute_metadata{uid code label attribute_labels{store_code label __typename}data_type is_system entity_type ui_input{ui_input_type is_html_allowed __typename}...on ProductAttributeMetadata{used_in_components __typename}__typename}__typename}...on ConfigurableProduct{configurable_options{attribute_code attribute_id uid label values{uid default_label label store_label use_default_value value_index swatch_data{...on ImageSwatchData{thumbnail __typename}value __typename}__typename}__typename}variants{attributes{code value_index __typename}product{uid media_gallery_entries{uid disabled file label position __typename}sku stock_status price{regularPrice{amount{currency value __typename}__typename}__typename}price_range{maximum_price{final_price{currency value __typename}discount{amount_off __typename}__typename}__typename}custom_attributes{selected_attribute_options{attribute_option{uid label is_default __typename}__typename}entered_attribute_value{value __typename}attribute_metadata{uid code label attribute_labels{store_code label __typename}data_type is_system entity_type ui_input{ui_input_type is_html_allowed __typename}...on ProductAttributeMetadata{used_in_components __typename}__typename}__typename}__typename}__typename}__typename}}', null, instance of Magento\GraphQl\Model\Query\Context, array(1), null)"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/magento/module-graph-ql/Controller/GraphQl.php","line":195,"call":"Magento\Framework\GraphQl\Query\QueryProcessor::process(instance of Magento\Framework\GraphQl\Schema, 'query getProductDetailForProductPage($urlKey:String!){products(filter:{url_key:{eq:$urlKey}}){items{id uid ...ProductDetailsFragment __typename}__typename}}fragment ProductDetailsFragment on ProductInterface{__typename categories{uid breadcrumbs{category_uid __typename}__typename}description{html __typename}short_description{html __typename}id uid media_gallery_entries{uid label position disabled file __typename}meta_description name price{regularPrice{amount{currency value __typename}__typename}__typename}price_range{maximum_price{final_price{currency value __typename}discount{amount_off __typename}__typename}__typename}sku small_image{url __typename}stock_status url_key custom_attributes{selected_attribute_options{attribute_option{uid label is_default __typename}__typename}entered_attribute_value{value __typename}attribute_metadata{uid code label attribute_labels{store_code label __typename}data_type is_system entity_type ui_input{ui_input_type is_html_allowed __typename}...on ProductAttributeMetadata{used_in_components __typename}__typename}__typename}...on ConfigurableProduct{configurable_options{attribute_code attribute_id uid label values{uid default_label label store_label use_default_value value_index swatch_data{...on ImageSwatchData{thumbnail __typename}value __typename}__typename}__typename}variants{attributes{code value_index __typename}product{uid media_gallery_entries{uid disabled file label position __typename}sku stock_status price{regularPrice{amount{currency value __typename}__typename}__typename}price_range{maximum_price{final_price{currency value __typename}discount{amount_off __typename}__typename}__typename}custom_attributes{selected_attribute_options{attribute_option{uid label is_default __typename}__typename}entered_attribute_value{value __typename}attribute_metadata{uid code label attribute_labels{store_code label __typename}data_type is_system entity_type ui_input{ui_input_type is_html_allowed __typename}...on ProductAttributeMetadata{used_in_components __typename}__typename}__typename}__typename}__typename}__typename}}', instance of Magento\GraphQl\Model\Query\Context, array(1))"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/magento/framework/Interception/Interceptor.php","line":58,"call":"Magento\GraphQl\Controller\GraphQl::dispatch(instance of Magento\Framework\App\Request\Http)"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/magento/framework/Interception/Interceptor.php","line":138,"call":"Magento\GraphQl\Controller\GraphQl\Interceptor::___callParent('dispatch', array(1))"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php","line":75,"call":"Magento\GraphQl\Controller\GraphQl\Interceptor::Magento\Framework\Interception\{closure}(instance of Magento\Framework\App\Request\Http)"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/magento/framework/Interception/Interceptor.php","line":135,"call":"Magento\PageCache\Model\App\FrontController\BuiltinPlugin::aroundDispatch(instance of Magento\GraphQl\Controller\GraphQl\Interceptor, instance of Closure, instance of Magento\Framework\App\Request\Http)"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/magento/framework/Interception/Interceptor.php","line":153,"call":"Magento\GraphQl\Controller\GraphQl\Interceptor::Magento\Framework\Interception\{closure}(instance of Magento\Framework\App\Request\Http)"},{"file":"/srv/users/axmagento/apps/axmagento/public/generated/code/Magento/GraphQl/Controller/GraphQl/Interceptor.php","line":23,"call":"Magento\GraphQl\Controller\GraphQl\Interceptor::___callPlugins('dispatch', array(1), array(2))"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/magento/framework/App/Http.php","line":116,"call":"Magento\GraphQl\Controller\GraphQl\Interceptor::dispatch(instance of Magento\Framework\App\Request\Http)"},{"file":"/srv/users/axmagento/apps/axmagento/public/vendor/magento/framework/App/Bootstrap.php","line":264,"call":"Magento\Framework\App\Http::launch()"},{"file":"/srv/users/axmagento/apps/axmagento/public/pub/index.php","line":30,"call":"Magento\Framework\App\Bootstrap::run(instance of Magento\Framework\App\Http\Interceptor)"}]}]}

dilipjha100 avatar Jul 29 '22 13:07 dilipjha100

Hi @dilipjha100. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information.

Add a comment to assign the issue: @magento I am working on this


m2-assistant[bot] avatar Jul 29 '22 13:07 m2-assistant[bot]

Hi @dilipjha100 Thank you for the feedback. Please provide additional details for your issue: Steps to reproduce, and version matrix where this can be reproduced.

anthoula avatar Aug 02 '22 14:08 anthoula

Hi, I am having the same issue. What module should be declaring ProductAttributeMetadata in the graphql schema? From what I saw here it is PWA specific https://devdocs.magento.com/guides/v2.4/graphql/interfaces/attribute-metadata.html

I cannot find any references to it in my vendor/magento code and the only reference to it in pwa-studio code is in the ProductDetailsFragment

lilbumblebear avatar Sep 21 '22 17:09 lilbumblebear

Ok, what fixed this for me was checking my composer.json in my magento (php) code. I had to make sure: "magento/pwa": "^0.1.0"

I had it set to ^0.0.1 previously

Hope this helps!

lilbumblebear avatar Sep 22 '22 13:09 lilbumblebear

Please enable flowing modules from magento root:

php bin/magento module:enable --clear-static-content Magento_EavGraphQlAux Magento_CatalogGraphQlAux Magento_PageBuilderPwa Magento_ReCaptchaGraphQlPwa Magento_ReCaptchaPwa Magento_SalesGraphQlAux Magento_UrlRewriteGraphQlPwa Magento_WeeeGraphQlAux

It will solve the issue.

khasruch avatar Sep 19 '23 09:09 khasruch