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

I'm unable to update a metafield of type file list #316

Open
mihaiav opened this issue Dec 30, 2024 · 0 comments
Open

I'm unable to update a metafield of type file list #316

mihaiav opened this issue Dec 30, 2024 · 0 comments

Comments

@mihaiav
Copy link

mihaiav commented Dec 30, 2024

I have a product with a custom metafield of type list of files .
I've tried the following to pass information (some images):

        shop.Metafield{
			Key:       key,
			Namespace: ns,
			Value:    `["gid://shopify/ProductImage/66131787907409"]`,
			Type: shop.MetafieldType("list.file_reference"),
		}

I get the error
metafields.value: must be a file reference string.

For debugging purposes I also tried only one value/string

           shop.Metafield{
			Key:       key,
			Namespace: ns,
			Value:    `"gid://shopify/ProductImage/66131787907409"`,
			Type: shop.MetafieldType("list.file_reference"),
		}

I get the error: metafields.value: must be an array.

Also tried:

              shop.Metafield{
			Key:       key,
			Namespace: ns,
			Value:    []string{"gid://shopify/ProductImage/66131787907409"},
			Type: shop.MetafieldType("list.file_reference"),
		}

I get error value: expected Array to be a String

Any idea how am I supposed to pass a list of files (images) ? This drives me absolutely crazy! I've spent 4 hours trying to fix this...

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