GraphQL API request Permissions issue

I have…

I’m submitting a…

  • [x] Regression (a behavior that stopped working in a new release)
  • [ ] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

We recently upgraded from Squidex 6.4.0 to 7.3.0 and now the GraphQL endpoint is returning errors when not using the GraphQl Editor that is in the Frontend.

After digging into it, comparing the network tab vs testing in Postman, I was able to get the query to work when using the same token as the Squidex-frontend, but not when using a token for any of the client id’s, I tried all the permission levels, I also tried using the clientid/secret for my own username.

I created a brand new app with one schema with just a string and a bool to see if there was a problem with our schemas and I still got the same error.

The error I get when trying to execute a query is always something like this:

{
       "errors": [
           {
               "message": "Error trying to resolve field 'queryTestingContents'.",
               "locations": [
                   {
                       "line": 1,
                       "column": 10
                   }
               ],
               "path": [
                   "queryTestingContents"
               ],
               "extensions": {
                   "code": "OPERATION_CANCELED",
                   "codes": [
                       "OPERATION_CANCELED"
                   ]
               }
           }
       ],
       "data": {
           "queryTestingContents": null
       },
       "extensions": {
           "tracing": {
               "version": 1,
               "startTime": "2023-01-30T09:03:36.0132021Z",
               "endTime": "2023-01-30T09:03:41.027298Z",
               "duration": 5014096000,
               "parsing": {
                   "startOffset": 3100,
                   "duration": 28299
               },
               "validation": {
                   "startOffset": 32099,
                   "duration": 196200
               },
               "execution": {
                   "resolvers": []
               }
           }
       }
   }

Expected behavior

I expect to see my full json response as on the squidex FE
Example:

{
  "data": {
    "queryTestingContents": [
      {
        "id": "b636c9e2-345c-4bfa-a142-123062f8924f"
      }
    ]
  },
  "extensions": {
    "tracing": {
      "version": 1,
      "startTime": "2023-01-30T09:33:29.4709523Z",
      "endTime": "2023-01-30T09:33:29.48789Z",
      "duration": 16937800,
      "parsing": {
        "startOffset": 2500,
        "duration": 54800
      },
      "validation": {
        "startOffset": 58100,
        "duration": 196700
      },
      "execution": {
        "resolvers": []
      }
    }
  }
}

Minimal reproduction of the problem

Created new application with one schema

Created GraphQL query on FE which works as expected

Duplicate query in Postman using network tab using the FE token and then it works:

But now if I use any client token I get an error
image

Please can you point out what might be going wrong here.

Environment

App Name: test

  • [ ] Self hosted with docker
  • [ ] Self hosted with IIS
  • [x] Self hosted with other version
  • [ ] Cloud version

Version: 7.3.0

Browser:

  • [x] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

Others:

Thanks a lot for your good bug report. This is not a permission issue. The error code indicates that there is a timeout. I started to introduce more timeout configurations over the time to ensure that your endpoints are stable. If you experience this problem, then your queries are really, really slow. Check your MongoDB setup.

You can also increase timeouts via settings, especially this one: https://github.com/Squidex/squidex/blob/master/backend/src/Squidex/appsettings.json#L263

But I would just search for “timeout” in this file.