Bug in Shopify GraphQL API on draftOrderInvoiceSend mutation

Solved
Lull
Excursionist
29 1 5

Hi,

 

Sending an invoice on a draft order via the GraphQL with only id as input c.f. the documentation that states that only the id is mandatory, gives an error message:

Request:

mutation draftOrderInvoiceSend {
  draftOrderInvoiceSend(id: "gid://shopify/DraftOrder/530989678727") {
    draftOrder {
      id
    }
    userErrors {
      field
      message
    }
  }
}

Response:

{
  "errors": [
    {
      "message": "Internal error. Looks like something went wrong on our end.\nRequest ID: a2bfd968-ae99-45c1-a1bf-1a6054922ed0 (include this in support requests).",
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "requestId": "a2bfd968-ae99-45c1-a1bf-1a6054922ed0"
      }
    }
  ]
}

If I include the email parameter in the request, and whatever parameter on the email object, it works, e.g.:

mutation draftOrderInvoiceSend {
  draftOrderInvoiceSend(id: "gid://shopify/DraftOrder/530989678727", email: {customMessage: ""}) {
    draftOrder {
      id
    }
    userErrors {
      field
      message
    }
  }
}

Response:

{
  "data": {
    "draftOrderInvoiceSend": {
      "draftOrder": {
        "id": "gid://shopify/DraftOrder/530989678727"
      },
      "userErrors": []
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 10,
      "actualQueryCost": 10,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 990,
        "restoreRate": 50
      }
    }
  }
}

Thanks,

-Louise

 

Accepted Solution (1)

Accepted Solutions
SBD_
Shopify Staff
1097 147 209

This is an accepted solution.

Hey @Lull,

 

This one has been resolved.

Scott | 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 Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 5 (5)
SBD_
Shopify Staff
1097 147 209

Hey @Lull,

 

Thanks for reporting this, I'm able to replicate. Raising internally.

Scott | 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 Shopify.dev or the Shopify Web Design and Development Blog

Lull
Excursionist
29 1 5
SBD_
Shopify Staff
1097 147 209

This is an accepted solution.

Hey @Lull,

 

This one has been resolved.

Scott | 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 Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Louise_Elmose_H
Shopify Partner
78 2 16
Hi Scotty,

Sounds great, thanks.

-Louise
kindle_bit
Tourist
13 0 2

Hello please share code how can disable Sending an invoice on a draft order via the GraphQL.