Shopify / function-examples

MIT License
182 stars 52 forks source link

Field 'discountsAllocatorFunctionRegister' doesn't exist on type 'Mutation' #474

Open mahdi-akbary opened 6 months ago

mahdi-akbary commented 6 months ago

I am trying to use shopify discount allocator function from https://shopify.dev/docs/api/functions/reference/discounts-allocator and in order to do it, I have to register my function using this mutation from https://shopify.dev/docs/api/admin-graphql/unstable/mutations/discountsAllocatorFunctionRegister.

mutation discountsAllocatorFunctionRegister($functionExtensionId: String!) { discountsAllocatorFunctionRegister(functionExtensionId: $functionExtensionId) { success userErrors { field message } } }

but it gives error GraphqlQueryError: Field 'discountsAllocatorFunctionRegister' doesn't exist on type 'Mutation' and even used the shopify Graphql app too but doesn't recognize the discountsAllocatorFunctionRegister to exist on type 'Mutation'

joeainsworth commented 2 months ago

Also getting this error.

yossix commented 2 months ago

++

JasonPing6 commented 2 months ago

I think this api is just available on unstable version. But when I run it on shopify Graphql app, I get access deny issue, need scope write_discounts_allocator_functions

khairali-nine15 commented 1 month ago

++

impactcolor commented 1 week ago

It's only available for unstable version of the api. But how do we use the unstable version? this: [webhooks] api_version = "unstable"

doesn't seem to work.

mahdi-akbary commented 1 week ago

It's only available for unstable version of the api. But how do we use the unstable version? this: [webhooks] api_version = "unstable"

doesn't seem to work.

This Function API is available only in stores with the Discounts Allocator developer preview

here is the link: https://shopify.dev/docs/api/functions/reference/discounts-allocator

impactcolor commented 1 week ago

@mahdi-akbary how do you activate the Discounts Allocator developer preview? The documentation doesn't even make sense it says i'ts only available in Discounts Allocator developer view but doesn't say what that is or how to activate it

impactcolor commented 1 week ago

Ok I get it, it can't be added to an actual store only preview modes. Got it.