Different user behavior of js

Hi! We use your wonderful platform for internal admin tools, and in one case, we're experiencing strange behavior that we can't seem to fix.

There's a JS code that determines what's selected in the UI and makes a GraphQL request to our backend, and everything was working fine for a while. Recently, one of our users started encountering an error, which is shown in the screenshot:


However, another user has everything working fine, and the same form with the same data works correctly

How can we fix our form's functionality? It seems like the problem is on the platform's side, as the error indicates that something is missing in the Additional Scope, but you can see in the log that the necessary identifier for the request is there, and moreover, everything works for another user.

I tried to use local storage


but user have same problem

Now it is not working for all users. Here code js:

function setUserId(userId){
  localStorage.setValue('CurrentParams', {
    userId : userId,
  })
}


function addToBlackList() {
  if (ClientType.value === 'Individual') {
    getUserID.trigger({
      additionalScope:{
            email:ClientEmail.value.toLowerCase()
          },
      onSuccess: function(getUserIDResponse) {
        const userId = getUserIDResponse;
        setUserId(userId)
        
        
        add2BlackList.trigger({
          onSuccess: function() {
            isBannedQuestion.trigger(); 
          },
          onFailure: function(error) {
            console.error("AddToBlackList Individual Error :", error);
          }
        });
      },
      onFailure: function(error) {
        console.error("getUserID Error:", error);
      }
    });
  } else if (ClientType.value === 'Business') {
    let companyId = CompanySelect.value;
    console.log("Email:", ClientEmail.value);
console.log("Company ID:", CompanySelect.value);
  
   setUserId(companyId)
    console.log(localStorage.values)
    
    add2BlackList.trigger({
      onSuccess: function() {
        isBannedQuestion.trigger(); 
      },
      onFailure: function(error) {
        console.error("AddToBlackList Business Error:", error);
      }
    });
  }
}

addToBlackList();

When I click on button, always get error, but don't understand why:

And I don't see error in request

Hello, the problem seems to be in add2BlackList query since it is throwing its onFailure error message ("AddToBlackList Bussines Error:")

can you run add2BlackList separately and see if the error remains?

I think not, because when the problem is in the request, the request itself highlights the error, but in this case I don’t see an incoming request on our backend, and the retool doesn’t highlight anything


Hello, i think the problem is because GraphQL doesn't support additionalScopes (I don't see any additionalScopes field in it)

I guess you will need to use variables instead if there isn't another workaround

JS Query does have an additionalScopes field where you define them
image

I have different queries graphQL where additional scope is working fine. But your variant is working or is it temporal solve, and after some time is will broke =(