saleor-dashboard icon indicating copy to clipboard operation
saleor-dashboard copied to clipboard

Unable to save Store Information due to GraphQLError

Open ex5 opened this issue 2 years ago • 17 comments

What I'm trying to achieve

I'm trying to deploy (and run locally) a production-ready saleor-dashboard.

Steps to reproduce the problem

  1. Setup tag 3.3.1 of saleor-dashboard and tag 3.3.2 of saleor
  2. Setup nginx serving results of npm run build
  3. Navigate to /site-settings -> fill in Store Information -> hit Save
  4. See error in browser console (no error popup or validation errors are visible).

What I expected to happen

Store address is saved successfully

Screenshots

2022-05-11-162328_1365x1288_scrot

Http request and response from inspector

Request:

{
  "operationName":"ShopSettingsUpdate",
  "variables": {
  "addressInput":{
    "city":"Testville",
    "companyName":"Company  B.V.",
    "country":"NL",
    "countryArea":"",
    "phone":"",
    "postalCode":"1000AA",
    "streetAddress1":"Teststreet 33",
    "streetAddress2":""
  },
  "shopSettingsInput":{
    "description":"",
    "reserveStockDurationAnonymousUser":null,
    "reserveStockDurationAuthenticatedUser":null
  },
  "isCloudInstance":false
},
"query":"mutation ShopSettingsUpdate(
  $shopSettingsInput: ShopSettingsInput!,
  $addressInput: AddressInput,
  $isCloudInstance: Boolean!) {
  shopSettingsUpdate(input: $shopSettingsInput) {
    errors {
      ...ShopError
      __typename
    }
    shop {
      ...Shop
      __typename
    }
    __typename
  }
  shopAddressUpdate(input: $addressInput) {
    errors {
      ...ShopError
      __typename
    }
    shop {
      companyAddress {
        ...Address
        __typename
      }
      __typename
    }
    __typename
  }
}

fragment ShopError on ShopError {
  code
  field
  message
  __typename
}

fragment Shop on Shop {
  companyAddress {
    ...Address
    __typename
  }
  countries {
    code
    country
    __typename
  }
  customerSetPasswordUrl
  defaultMailSenderAddress
  defaultMailSenderName
  description
  domain {
    host
    __typename
  }
  name
  reserveStockDurationAnonymousUser
  reserveStockDurationAuthenticatedUser
  limitQuantityPerCheckout
  __typename
}

fragment Address on Address {
  city
  cityArea
  companyName
  country {
    __typename
    code
    country
  }
  countryArea
  firstName
  id
  lastName
  phone
  postalCode
  streetAddress1
  streetAddress2
  __typename
}"}

Response:

{"errors": [{"message": "Variable \"$isCloudInstance\" is never used in operation \"ShopSettingsUpdate\".", "locations": [{"line": 1, "column": 98}], "extensions": {"exception": {"code": "GraphQLError"}}}], "extensions": {"cost": {"requestedQueryCost": 0, "maximumAvailable": 50000}}}

Console output

// insert console output here 
Variable "$isCloudInstance" is never used in operation "ShopSettingsUpdate".

System information

Saleor version:

  • [ ] dev (current main)
  • [x] 3.3.1
  • [ ] 3.0
  • [ ] 2.11
  • [ ] 2.10

Operating system:

  • [ ] Windows
  • [x] Linux
  • [ ] MacOS
  • [ ] Other

Browser:

  • [x] Firefox
  • [ ] Safari
  • [ ] Chrome
  • [ ] Edge
  • [ ] Other

ex5 avatar May 11 '22 14:05 ex5

Hitting the same issue with dashboard at 3.3.2 and saleor 3.3.8, as well as both saleor and dashboard at their main branch.

yurkobb avatar May 25 '22 13:05 yurkobb

+1 i am running dashboard v3.3.2, core v3.3.12

blackyzero avatar May 28 '22 14:05 blackyzero

Thx for finding an issue, I can confirm that this issue exists. It is reported in Clickup, We will fix that soon!

michalina-graczyk avatar Jun 02 '22 10:06 michalina-graczyk

The issue is fixed in 3.4.0

timuric avatar Jun 22 '22 10:06 timuric

I'm still able to reproduce the issue with dashboard v3.4.1 and core v3.4.8

ex5 avatar Jun 29 '22 08:06 ex5

Hi, thanks for reporting, we will try to fix it as soon as we can.

eCzerniak avatar Jun 29 '22 12:06 eCzerniak

Task linked: https://app.clickup.com/t/2549495/SALEOR-7517

eCzerniak avatar Jun 29 '22 12:06 eCzerniak

This is still present in 3.5.2

RyanTamulevicz avatar Aug 02 '22 18:08 RyanTamulevicz

This is still present in 3.5.0

manojLondhe avatar Aug 09 '22 14:08 manojLondhe

I can also confirm this is still present with the following pair; saleor 3.5.6 saleor-dashboard 3.5.2

umutkacar avatar Aug 10 '22 09:08 umutkacar

The fix to this was to remove the isCloudInstance. I imagine they are trying to implement that into it or I would make a PR for it.

RyanTamulevicz avatar Aug 10 '22 09:08 RyanTamulevicz

The fix to this was to remove the isCloudInstance. I imagine they are trying to implement that into it or I would make a PR for it.

Where isCloudInstance should be removed from, to fix it @RyanTamulevicz ?

umutkacar avatar Aug 10 '22 09:08 umutkacar

Remove Line 7 in src/siteSettings/mutations.ts Remove Line 2 in src/siteSettings/views/index.tsx

This should fix it @umutkacar @manojLondhe @eCzerniak @ex5 as I said, I would make a PR for this, but I believe it is something they are trying to implement.

RyanTamulevicz avatar Aug 10 '22 17:08 RyanTamulevicz

Hello @RyanTamulevicz , @umutkacar and @manojLondhe

there is a ticket in our backlog but there is no PR for it in this moment so if you could create a fix for it, it would be great.

Regards.

eCzerniak avatar Aug 11 '22 06:08 eCzerniak

@eCzerniak do you know a saleor & saleor-dashboard version pair which does not have this bug?

umutkacar avatar Aug 11 '22 10:08 umutkacar

@eCzerniak @umutkacar creating PR in a moment

RyanTamulevicz avatar Aug 11 '22 10:08 RyanTamulevicz

PR in #2228

RyanTamulevicz avatar Aug 11 '22 11:08 RyanTamulevicz