Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing GraphQL Product fields #7

Open
themreza opened this issue Oct 1, 2022 · 0 comments
Open

Missing GraphQL Product fields #7

themreza opened this issue Oct 1, 2022 · 0 comments

Comments

@themreza
Copy link

themreza commented Oct 1, 2022

The latest version of the storefront integration throws the following GraphQL error when searching for a product:

 WARN   [GraphQL error]: Message: Cannot query field 'imageFilename' on type 'Product'., Location: line: 32 | column: 7).join(' '), Path: null                                                                                22:24:31
 WARN   [GraphQL error]: Message: Cannot query field 'jsonLd' on type 'Product'., Location: line: 35 | column: 7).join(' '), Path: null                                                                                       22:24:31
 WARN  [Network error]: ServerError: Response not successful: Received status code 400                     

The error suggests that fields imageFilename and jsonLd are missing on the Product type.

Adding the fields in https://github.com/odoogap/vuestorefront/blob/14.0/graphql_vuestorefront/schemas/objects.py#L267 fixes the issue:

json_ld = graphene.String()
image_filename = graphene.String()

I'm not sure about the actual usage of these fields, and it's still throwing the following warnings due to the fields not being defined:

 WARN   [GraphQL error]: Message: 'product.template' object has no attribute 'image_filename', Location: line: 32 | column: 7).join(' '), Path: products,products,11,imageFilename                                            22:31:18
 WARN   [GraphQL error]: Message: 'product.template' object has no attribute 'json_ld', Location: line: 35 | column: 7).join(' '), Path: products,products,0,jsonLd       

The demo website does have the correct fields:
image

The code seems to be on the 15.0 branch, but not on 14.0: https://github.com/odoogap/vuestorefront/blob/15.0/graphql_vuestorefront/schemas/objects.py#L305

The same file has multiple differences between 14.0 and 15.0. Please double check the codebase. https://www.diffchecker.com/ByCexBxC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant