Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Graphql 'sellingPlanGroupCreate' doesn't exist on type 'Mutation'

Solved

Graphql 'sellingPlanGroupCreate' doesn't exist on type 'Mutation'

Tiber
Shopify Partner
31 4 6

I am trying to create a new subscription, but am getting 'sellingPlanGroupCreate' doesn't exist on type 'Mutation'. I am using the example on Create and manage selling plans (shopify.dev). I have access to the subscription API for my app and have the scopes "write_products,write_customers,write_draft_orders,read_customer_payment_methods,write_own_subscription_contracts,read_own_subscription_contracts" set.

Below is the query I am trying.

mutation {
  sellingPlanGroupCreate(
    input: {
      name: "Subscribe and save"
      merchantCode: "subscribe-and-save"
      options: ["Delivery every"]
      position: 1
      sellingPlansToCreate: [
        {
          name: "Delivered every three weeks"
          options: "3 Week(s)"
          position: 3
          billingPolicy: { recurring: { interval: WEEK, intervalCount: 3 } }
          deliveryPolicy: { recurring: { interval: WEEK, intervalCount: 3 } }
          pricingPolicies: [
            {
              fixed: {
                adjustmentType: PERCENTAGE
                adjustmentValue: { percentage: 5.0 }
              }
            }
          ]
        }
      ]
    }
    resources: { productIds: ["gid://shopify/Product/6075617312922"], productVariantIds: [] }
  ) {
    sellingPlanGroup {
      id
    }
    userErrors {
      field
      message
    }
  }
}

 

 

 

Accepted Solution (1)

Tiber
Shopify Partner
31 4 6

This is an accepted solution.

The error was caused by not using API version 2021-01

View solution in original post

Replies 2 (2)

Tiber
Shopify Partner
31 4 6

This is an accepted solution.

The error was caused by not using API version 2021-01

arturmihno
Shopify Partner
7 1 1

The version has been changed, but still does not work. I use Shopify-CLI to create an app.