I am trying to test Vendure and this Qwik starter template for a replacement shop site for our business.
Everything is looking clean, however I am trying to test a custom field (in this case a boolean allowCustomText) on the product entity.
Everything looks good on the Vendure side as far as I can see, however I cannot get the storefront to obtain the custom field.
I have tried adding customFields to the providers/shop/products/products.ts file. The build step generates fine, however trying to view a product triggers the error Field "customFields" of type "ProductCustomFields" must have a selection of subfields. Did you mean "customFields { ... }"?.
Changing it to the following
customFields {
allowCustomText
}
does not allow the storefront to build - the generate GraphQL documents step gives the error Error 0: Field "customFields" must not have a selection since type "JSON" has no subfields..
Looking at the schema and documentation at http://localhost:3000/shop-api shows in the docs tab the following info for the products->customFields entry:
type ProductCustomFields {
allowsCustomText: Boolean
}
But the src/generated/schema.graphql file shows
type ProductCustomFields {
printfulProductId: String
}
and src/generated/schema-shop.graphql shows
type Product implements Node {
[...]
customFields: JSON
}
Is this a case of the graphql files not generating correctly (a caching issue perhaps) or am I missing something?
I am trying to test Vendure and this Qwik starter template for a replacement shop site for our business.
Everything is looking clean, however I am trying to test a custom field (in this case a boolean
allowCustomText
) on the product entity.Everything looks good on the Vendure side as far as I can see, however I cannot get the storefront to obtain the custom field.
I have tried adding
customFields
to theproviders/shop/products/products.ts
file. The build step generates fine, however trying to view a product triggers the errorField "customFields" of type "ProductCustomFields" must have a selection of subfields. Did you mean "customFields { ... }"?
.Changing it to the following
does not allow the storefront to build - the generate GraphQL documents step gives the error
Error 0: Field "customFields" must not have a selection since type "JSON" has no subfields.
.Looking at the schema and documentation at
http://localhost:3000/shop-api
shows in the docs tab the following info for the products->customFields entry:But the
src/generated/schema.graphql
file showsand
src/generated/schema-shop.graphql
showsIs this a case of the graphql files not generating correctly (a caching issue perhaps) or am I missing something?
Thanks (sorry for the long post)