What's your biggest current challenge? Have your say in Community Polls along the right column.
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 Admin Api Return Errors For Fields That Exist On Resource As Per Documentation

Solved

GraphQL Admin Api Return Errors For Fields That Exist On Resource As Per Documentation

sanketJ
Shopify Partner
18 0 1

I am using shopify graphQL admin api and I get errors like [field] doesn't exist on type [resource] though they exist according to graphQL admin api documentation as you can see below 

 

sanketJ_0-1646721940148.png

and errors as well

 

sanketJ_1-1646721953582.png

Any insights would  be appreciated

 

Accepted Solution (1)

c10s
Shopify Partner
67 12 27

This is an accepted solution.

Images are paginated so you need to do it like this: (you can change 10 to whatever you want)

mutation productCreate($input: ProductInput!) {
  productCreate(input: $input) {
    product {
      id
      images(first: 10) {
        edges {
          node {
            id
          }
        }
      }
    }
    shop {
      id
    }
    userErrors {
      field
      message
    }
  }
}

 

View solution in original post

Reply 1 (1)

c10s
Shopify Partner
67 12 27

This is an accepted solution.

Images are paginated so you need to do it like this: (you can change 10 to whatever you want)

mutation productCreate($input: ProductInput!) {
  productCreate(input: $input) {
    product {
      id
      images(first: 10) {
        edges {
          node {
            id
          }
        }
      }
    }
    shop {
      id
    }
    userErrors {
      field
      message
    }
  }
}