• Alberto Garcia

    (@albertokatiuskas)


    Hi,

    I’m in a local dev environment with a WP installation in Local App and a fresh install Faust app following the instructions on https://faustjs.org/tutorial/get-started-with-faust. Now is working fine and I’m getting the content of header and footer menus but sometimes when I run dev command throw this error:

    error - Unable to find a GraphQL endpoint at https://localhost:10008/index.php?graphql
    error - WPGraphQL may not be active, or your WordPress site is unavailable.

    WP works fine at any moment and the GraphQL endpoint in both cases, when it works and when it doesn’t, throw the same json object:

    {
      "errors": [
        {
          "message": "GraphQL Request must include at least one of those two parameters: \"query\" or \"queryId\"",
          "extensions": {
            "category": "request"
          }
        }
      ],
      "extensions": {
        "debug": [
          {
            "type": "DEBUG_LOGS_INACTIVE",
            "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."
          }
        ]
      }
    }

    This is my .env content:

    # Your WordPress site URL
    NEXT_PUBLIC_WORDPRESS_URL=https://localhost:10008
    
    # Plugin secret found in WordPress Settings->Faust
    FAUST_SECRET_KEY=95001384-41f7-440b-bac5-f84674efe3e4

    When error appears I change the WP url, run dev command, get the error again, get back the good one url again and the error disappear:

    ready - started server on 0.0.0.0:3000, url: https://localhost:3000
    info  - Loaded env from /Volumes/Projects/test/faust-app/.env.local
    event - compiled client and server successfully in 479 ms (851 modules)

    I know it is an odd issue hard to replicate, but I think you should know about it. Am I missing something?

    I would like to use this stack in production, but I’m not sure with this odd error, can I?

    Thanks so much anyway for your work, keep going! ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Theo

    (@thdespou)

    Hey @albertokatiuskas. The faust cli package does a health check into your WordPress intance by performing a HTTP POST request to the graphQL endpoint.

    https://github.com/wpengine/faustjs/blob/canary/packages/faustwp-cli/src/healthCheck/verifyGraphQLEndpoint.ts#L14

    If that request fails then it will bail out from continuing the build process.

    Not sure why your endpoint is not reachable by HTTP that’s why we stop in that step since there is no point trying to query an unreachable endpoint.

    Could you verify that your graphql endpoint is reachable?

    Plugin Contributor Theo

    (@thdespou)

    Also the error that you mention:

    errors": [
        {
          "message": "GraphQL Request must include at least one of those two parameters: \"query\" or \"queryId\"",
          "extensions": {
            "category": "request"
          }
        }
      ],

    This means that the graphQL POST body in null and does not contain any queries. Are you providing at least a valid Page.query parameter in your templates?

    Thread Starter Alberto Garcia

    (@albertokatiuskas)

    Thank you Theo and sorry for the delay in responding, I went on holidays. The endpoint was accesible and the query of front-page in @faustwp/getting-started-example was present, the primary and the footer menus was displayed. This happened randomly when I just installed and ran this boilerplate out of the box.

    But now I’m back and I’ve settled up again from the beginning and it’s been running the project for a couple of days, working on it and it works as expected. I don’t know what could have caused that random error, I suspect some CORS misconfiguration, or maybe we both needed some holidays.

    Thank you again for your kind response and sorry for bother you with this weird issue.

    Cheers!

    Plugin Contributor Theo

    (@thdespou)

    No problem. We are also reachable on Discord for any other queries.

    https://discord.com/channels/836253505944813629/877940107016019998

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Random endpoint connection error’ is closed to new replies.