CreateMediaInput isn't a defined type

New Member
1 0 0



I'm fairly new to the Shopify API and GraphQL, so do excuse my noobness. I'm trying to post the following 'test' GraphQL mutation to the Admin API (content type application/json):


	"query": "mutation createProductMedia(  $id: ID!  $media: [CreateMediaInput!]!) {  productCreateMedia(productId: $id, media: $media) {    product {      id    }  }}",
	"operationName": "createProductMedia",
	"variables": {
		"id": "gid://shopify/Product/5577068413085",
		"media": [
				"alt": "text",
				"originalSource": "",
				"mediaContentType": "EXTERNAL_VIDEO"



However, I keep getting an error back in the response saying 'CreateMediaInput isn't a defined input type (on $media)', despite the docs ( saying otherwise. Even when I replace the query with the sample one given in the mentioned docs the same error is thrown. Is there anything I'm doing wrong here?

Shopify Staff
Shopify Staff
534 105 103

You should be utilizing the graphql admin api vs. the Storefront API. Make sure you have your endpoints and auth correct. 

Vix | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit or the Shopify Web Design and Development Blog