Repository: saleor/saleor

Issue:
checkoutCreate mutation issue -   { "code": "REQUIRED",  "field": "country",  "message": "This field cannot be blank." }
### What I'm trying to achieve
try to add checkout step with createCheckout mutation.

### Steps to reproduce the problem
<!-- Adding logs from the console, as well as query/response help us fix the bug faster -->
1. use docker-platform, deploy with docker compose, delete saleor folder and replace it by saleor folder with 3.1 branch clone
2. use playgraphl to test mutation request (checkoutCreate)

### What I expected to happen
i make test on saleor demo site : https://demo.saleor.io/graphql/

```bash
mutation CheckoutCreate {
  checkoutCreate(
    input: { channel: "default-channel", email: "john@example.com", lines: [] }
  ) 
  {  errors {
        code
        field
        message
      }
    checkout {
      id
      token
      created
       
    }
  }
}

```
result on : https://demo.saleor.io/graphql/
```bash
{
  "data": {
    "checkoutCreate": {
      "errors": [],
      "checkout": {
        "id": "Q2hlY2tvdXQ6MDQ2MmQwMzQtZGJmYi00MTg1LWExZTMtMWUwYTU2YWMxYjJi",
        "token": "0462d034-dbfb-4185-a1e3-1e0a56ac1b2b",
        "created": "2021-09-17T13:17:33.994853+00:00"
      }
    }
  }
}


```

# this is fine for me but ....
When i try the samething on my local machine (deploy with docker compose)
i get this:

```bash

{
  "data": {
    "checkoutCreate": {
      "errors": [
        {
          "code": "REQUIRED",
          "field": "country",
          "message": "This field cannot be blank."
        }
      ],
      "checkout": null
    }
  }
}

```
i want to get checkoutID and token and the system ask me to add some country field.....

**System information**
<!-- Provide the version of Saleor or whether you're using it from the `master` branch. If using Saleor Dashboard or Storefront, provide their versions too. -->
Saleor version:
- [ ] dev (current master)
- [ X] 3.0
- [ ] 2.11
- [ ] 2.10

Operating system:
- [ ] Windows
- [ X] Linux
- [ ] MacOS
- [ ] Other



Discussion:
Any help ??
Please use this as a reference https://github.com/saleor/react-storefront
@epoq I'm sure you found the solution by now, but I came here with the same problem. For anyone looking for the solution in the future, the channels created by the data population script do not have a `default_country` assigned. Once I populated that field, the mutation worked as expected. 

Resolving patch:
diff --git a/saleor/channel/migrations/0001_initial.py b/saleor/channel/migrations/0001_initial.py
--- a/saleor/channel/migrations/0001_initial.py
+++ b/saleor/channel/migrations/0001_initial.py
@@ -1,5 +1,6 @@
 # Generated by Django 3.0.6 on 2020-06-16 07:54
 
+import os
 from django.conf import settings
 from django.db import migrations, models
 from django.db.models.signals import post_migrate
@@ -54,12 +55,14 @@ def create_default_channel(apps, schema_editor):
     default_currency = get_default_currency(
         Checkout, Order, Product, ShippingMethod, Voucher
     )
+    default_country = os.environ.get("DEFAULT_COUNTRY", "US")
     if default_currency:
         Channel.objects.create(
             name="Default channel",
             slug=settings.DEFAULT_CHANNEL_SLUG,
             currency_code=default_currency,
             is_active=True,
+            default_country=default_country,
         )
 
 


Test patch: