Closed supernova-at closed 4 years ago
Executing against a Magento 2.3.3 backend from a GraphiQL playground instance.
Run the following query that uses a fragment:
fragment ProductDetails on ProductInterface { id name } query productDetail($urlKey: String) { products(filter: { url_key: { eq: $urlKey } }) { items { ... ProductDetails } } }
With the following variables1:
{ "urlKey": "jillian-top" }
1 My instance has the Venia sample data installed, so this urlKey is a valid product. Any product urlKey should do here.
urlKey
I expected to see
{ "data": { "products": { "items": [ { "id": 1093, "name": "Jillian Top" } ] } } }
Instead I got
{ "data": { "products": { "items": [ { "id": 1093, "name": null } ] } } }
As you can see from the following screenshots, the problem is isolated to using fragments:
fragment
These should return the exact same response.
This may be related to https://github.com/magento/graphql-ce/issues/147, but that issue states
Additionally, similar basic fragments will resolve in the products schema.
But this issue shows that not to be the case.
Preconditions (*)
Executing against a Magento 2.3.3 backend from a GraphiQL playground instance.
Steps to reproduce (*)
Run the following query that uses a fragment:
With the following variables1:
1 My instance has the Venia sample data installed, so this
urlKey
is a valid product. Any producturlKey
should do here.Expected result (*)
I expected to see
Actual result (*)
Instead I got
Additional Notes
As you can see from the following screenshots, the problem is isolated to using
fragment
s:Inlining Fields
Using a Fragment
These should return the exact same response.
Related Issues
This may be related to https://github.com/magento/graphql-ce/issues/147, but that issue states
But this issue shows that not to be the case.