GraphQl Questionaires response 400 error

Hi,

We utilize GraphQL to retrieve questionnaires from the server in our application. Everything functions smoothly on our “Main server” with version 22.6.09. However, after updating our “Test server” to version 23.9.02, it is not functioning as expected.

Here is my code:

 var builder = new HeadquartersQueryQueryBuilder().WithQuestionnaires(
     new IPagedConnectionOfQuestionnaireQueryBuilder()
         .WithNodes(new QuestionnaireQueryBuilder().WithAllFields())
         .WithFilteredCount().WithTotalCount(), take: 100, workspace: GetWS);

 var result = await clientWS.GraphQl.ExecuteAsync<GraphQlResponse>(builder);

Error message:

{“errors”:[{“message”:“None of the \u0060Accept\u0060 header values is supported.”,“extensions”:{“code”:“HC0063”}}]}

Can you help me with this?

Thank you.
Martin

Hi Martin,

I can confirm this error, as it popped up from time to time when running different tests for the susographql R package i am currently in the progress of finalizing. I didn’t have time to look into it in detail yet. Nevertheless in my case it seems the error was a transient one (though with error code 400, therefore the execution was terminated). Trying the call again usually resulted in a successful execution.

Interestingly, this is exactly something that is generally not recommended upon getting a 400, see: 400 Bad Request - HTTP | MDN

Hi Sergiy,

You are of course correct. This additional information was thought to bring the Survey Solutions team closer to the problem, such that the problem with the API in this version can be identified quicker. It was in no way a suggestion for a workaround. Thanks for clarifying this.

In my case the error came only up occasionally and not permanently, similar to the 500 response I get sometimes from the REST API. And given that i have just had another successful execution of the same graphql query, this error seems to be also more of that category.

I also did not pay much attention to it, as i attributed it initially more to a connectivity problem on my side, however given that other users face the same problem, it may be more severe.

In my case doesnt help it, I got always error code 400.

If you have access to an R environment, you could try with this function here:

install.packages("susographql")
library("susographql")

suso_gql_questionnaires(endpoint = ep, 
                        user = usr,
                        password = pass, 
                        workspace = ws, 
                        take = 100)

This should resemble your query. Just tested it with my PDS, running on 23.09.2 (build 35210), and it worked fine.

For details see here. Would be curious to see if that works. In my case the error pops only up very rarely.

Thank you for your suggestion but I need to establish a connection via a C# application, as the R environment is not suitable for this purpose.

It appears to be a separate issue from what you experienced, as I consistently receive an error message in the new version, as mentioned earlier.

Hello,

I would like to ask about fixing this bug in the GraphQL and if you plan to fix it in the near future.
We are interested in upgrading to a newer version of Survey Solution, but other parts of the system depend on the GraphQL, so we cannot update to a newer version there.

Thank you.

We use GraphQl via C# .net for various purposes (retrieving questionnaires and interviews and many different kinds of information about them). We get the error 400 result on every one of the requests. The requests are numerous and our application is based on them. What shall we do? Use the other way to ask - http (e.g. something like RestRequest request = new RestRequest($“{GetWS}/api/v1/supervisors/{supervisorId}/interviewers”)
.AddParameter(“limit”, 100)
.AddParameter(“offset”, 1);
RestResponse response = restClient.Get(request); )? Is there a perfect match in what the two ways can do? Or should we downgrade the server to a previous version where GraphQl worked?
Thank you in advance for your help.