Have your say in Community Polls: What was/is your greatest motivation to start your own business?
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.

Are the GraphQL API doc regarding updating/creating collections outdated?

Are the GraphQL API doc regarding updating/creating collections outdated?

brydom
Visitor
1 0 0

I believe the API docs are out of date for updating on collection creation and creating on collection update.

 

On collectionCreate under `id` it states:

Specifies the collection to update or create a new collection if absent.

 

With this input:

  input: {
    title: 'Special Snares',
    descriptionHtml: 'Test',
    id: 'gid://shopify/Collection/299687116949'
  }

I receive this response:

"userErrors":[{"field":["id"],"message":"id cannot be specified on collection creation","__typename":"UserError"}]

 

And on the other end, with `collectionUpdate`, it states:

Specifies the collection to update or create a new collection if absent.

And I receive this response with an `id` attached:

id must be specified on collectionUpdate

 

Reply 1 (1)

kevnob
Shopify Staff
11 3 3

Hi @brydom,

 

Thanks for your post and for sharing your findings! 

 

I tested this on my end as well with the same results and I have sent this to our developer documents team to clarify / enhance. 

 

Thanks again for taking the time to report it. 

To learn more visit the Shopify Help Center or the Community Blog.