My Products
Help
iizy
CONTRIBUTOR ***

The request could not be executed: get available companies

by iizy

We're not able to parse response from Graphql because the response contains the list of available companies and the following error: "Message": "The request could not be executed!"

 

The whole response looks like this:

 

{
  "ResponseHeaders": [
     //Headers
  ],
  "StatusCode": 200,
  "Data": {
    "availableCompanies": {
      "totalCount": 24,
      "pageInfo": null,
      "items": [
          //List of companies
      ]
    }
  },
  "Errors": [
    {
      "Locations": null,
      "Message": "The request could not be executed!",
      "Path": [
        "availableCompanies"
      ],
      "Extensions": null
    }
  ],
  "Extensions": {
    "vbnxt-trace-id": "000000000000000008549d4b98aaf7d7"
  }
}
 
I noticed that one company has the character: \u0026 in name like this: 
 {
          "name": "Test company \u0026 AS",
          "vismaNetCompanyId": 12345
},
 
Do you know what is the root cause? 
 
7 REPLIES 7
iizy
CONTRIBUTOR ***

by iizy

@Marius Bancila Any news?

by Marius Bancila

Is this still occurring? We deployed last week a fix for a parsing error. It's possible that we have another one. But if you still experience this (as I assume from your question), can you share another trace ID? 

by Marius Bancila

We enabled some extra logging that will hopefully catch more information about your problem. Can you run it again and give us a trace ID?

by Marius Bancila

So you actually get the list of companies, but you also get an error message, and because you have errors you consider the response as invalid. Is that correct? 

The \u0026 character is ampersand, "Test company & AS", but this should not be a problem.

iizy
CONTRIBUTOR ***

by iizy

Yes, that is correct.

by Marius Bancila

I am investigating it, but you do get data so you should be able to use that. The fact that there are error messages does not make the response invalid. That's not how GraphQL is designed. I suppose you don't get all the companies, one of them should probably missing, which is not OK, I understand, but my point is that you can get partial results and those should be, generally, treated as successfully. 

iizy
CONTRIBUTOR ***

by iizy

I don't think it is a good idea to treat response with data and errors as success.

What if we start getting another type of error and we miss this, because the system starts ignoring errors...

Please let me know if you find anything.