GraphQL AppSubscriptionLineItem isn't a valid input type

codefrog0
New Member
1 0 0

Hello, 

I am running into an GraphQL issue. Can someone let me know how do I pass "AppSubscriptionLineItem!" as a variable in GraphQL? 

When the following query runs: 

 

 

 const query = JSON.stringify({
      query: `mutation appSubscriptionCreate($name: String!, $plan: AppSubscriptionLineItem!){
              appSubscriptionCreate(
                name: $name
                returnUrl: "${process.env.HOST}"
                test: true
                lineItems: $plan
              ){
                userErrors {
                  field
                  message
                }
                confirmationUrl
                appSubscription {
                  id
                  lineItems {
                    id
                    plan {
                      pricingDetails {
                        __typename
                      }
                    }
                  }
                }
              }
            }`,
      variables: {
        name: "Test",
        plan: {
          appRecurringPricingDetails: {
            price: { amount: 90.0, currencyCode: "USD" },
          },
        },
      },
    });

 

 

It throws this error message: 

 

{ errors:
   [ { message:
        'AppSubscriptionLineItem isn\'t a valid input type (on $plan)',
       locations: [Array],
       path: [Array],
       extensions: [Object] },
     { message:
        'Type mismatch on variable $plan and argument lineItems (AppSubscriptionLineItem! / [AppSubscriptionLineItemInput!]!)',
       locations: [Array],
       path: [Array],
       extensions: [Object] } ] }

 

How do I pass plan variable correct to GraphQL?

I'd appreciate it if someone could help me. 

Greetings

0 Likes