forward-apricotF
Refine2y ago
12 replies
forward-apricot

auth.ts:47 Error: expecting a value for non-nullable variable:

below is my mutation
export const CREATE_PRODUCT_MUTATION = gql mutation createProduct($image: String, $variants: [variants_insert_input!]!) { insert_products_one( object: { image: $image, variants: { data: $variants } } ) { id } } ;


I am getting the following error
auth.ts:47 Error: expecting a value for non-nullable variable: "variants": {"response":{"errors":[{"message":"expecting a value for non-nullable variable: "variants"","extensions":{"path":"$","code":"validation-failed"}}],"status":200,"headers":{}},"request":{"query":"mutation createProduct($image: String, $variants: [variants_insert_input!]!) {\n insert_products_one(object: {image: $image, variants: {data: $variants}}) {\n id\n }\n}\n","variables":{"object":{"image":"https://placehold.co/600x400","variants":[{"sku":"asf","name":"saf"}]}}}}

Error
Was this page helpful?