wp-graphql / wp-graphql-woocommerce

Add WooCommerce support and functionality to your WPGraphQL server
https://woographql.com
GNU General Public License v3.0
644 stars 131 forks source link

Internal server error with latest WordPress 6.3, Woocommerce 8.0.1 and PHP7.4 #782

Closed alexkey89 closed 1 year ago

alexkey89 commented 1 year ago

Isn't PHP7.4 supported?

Download latest WordPress 6.3 and WooCommerce 8.0.1, the PHP version of server is 7.4. Go to graphqiQL and the spinner will keep spinning, Opening the console you will see internal server error. That wasn't the issue with the v12-13 versions.

kidunot89 commented 1 year ago

@alexkey89 What's your WooGraphQL version

alexkey89 commented 1 year ago

@alexkey89 What's your WooGraphQL version @kidunot89 WooGraphQL is 0.15 & WPGraphQL is 1.14.10

kidunot89 commented 1 year ago

Any other WPGraphQL extensions?

kidunot89 commented 1 year ago

And is debug mode on?

alexkey89 commented 1 year ago

And is debug mode on?

@kidunot89 Yes debug mode is on and i have the following extensions:

WPGraphQL WPGraphQL CORS Select WPGraphQL for Advanced Custom Fields WPGraphQL for Rank Math SEO WPGraphQL JWT Authentication WPGraphQL WooCommerce (WooGraphQL)

ps: even if i deactivate all of them except WPGraphQL and WPGraphQL WooCommerce issue persists.

kidunot89 commented 1 year ago

@alexkey89 Is your setup a Bedrock or Composer setup?

alexkey89 commented 1 year ago

@alexkey89 Is your setup a Bedrock or Composer setup?

@kidunot89 no

kidunot89 commented 1 year ago

If you go directly to the endpoint at /graphql do you get an error message?

alexkey89 commented 1 year ago

If you go directly to the endpoint at /graphql do you get an error message?

@kidunot89 When I try to POST a graphql request or if i simply POST without any variables via postman, i get internal server error issue. When i go to /graphql i get this error: {"errors":[{"message":"GraphQL Request must include at least one of those two parameters: \"query\" or \"queryId\""

kidunot89 commented 1 year ago

Is this a live server with some kind of caching in place or your local environment?

alexkey89 commented 1 year ago

Is this a live server with some kind of caching in place or your local environment?

@kidunot89 It's on a live server. older versions of woographql do not have this issue. Just to help a bit that's the full error when i go to that page /graphql:

ps: I already defined GraphQL JWT Auth secret. same issue.

{
  "errors": [
    {
      "message": "GraphQL Request must include at least one of those two parameters: \"query\" or \"queryId\"",
      "extensions": {
        "category": "request"
      }
    }
  ],
  "extensions": {
    "debug": [
      {
        "type": "GRAPHQL_DEBUG",
        "message": "You must define the GraphQL JWT Auth secret to use the WPGraphQL JWT Authentication plugin.",
        "stack": [
          "/plugins/wp-graphql-jwt-authentication-0.6.0/wp-graphql-jwt-authentication.php:195",
          "/public_html/wp-includes/class-wp-hook.php:310",
          "/public_html/wp-includes/class-wp-hook.php:334",
          "/public_html/wp-includes/plugin.php:517",
          "/public_html/wp-content/plugins/wp-graphql/src/Request.php:146",
          "/public_html/wp-content/plugins/wp-graphql/src/Router.php:479",
          "/public_html/wp-content/plugins/wp-graphql/src/Router.php:275",
          "/public_html/wp-includes/class-wp-hook.php:310",
          "/public_html/wp-includes/class-wp-hook.php:334",
          "/public_html/wp-includes/plugin.php:565",
          "/public_html/wp-includes/class-wp.php:398",
          "/public_html/wp-includes/class-wp.php:779",
          "/public_html/wp-includes/functions.php:1335",
          "/public_html/wp-blog-header.php:16",
          "/public_html/index.php:17"
        ]
      }
    ],
    "queryAnalyzer": {
      "keys": "",
      "keysLength": 0,
      "keysCount": 0,
      "skippedKeys": "",
      "skippedKeysSize": 0,
      "skippedKeysCount": 0,
      "skippedTypes": []
    }
  }
}
kidunot89 commented 1 year ago

How are you defining the salt and where in your application? Putting the constant in your wp-config.php or somewhere close to is my recommended approach.

define( 'GRAPHQL_JWT_AUTH_SECRET_KEY', 'your-secret-token' );
kidunot89 commented 1 year ago

You need to update WPGraphQL JWT Auth. You're on v0.6.0, it's using a out of date version of PHP-JWT

alexkey89 commented 1 year ago

You need to update WPGraphQL JWT Auth. You're on v0.6.0, it's using a out of date version of PHP-JWT

@kidunot89 nope, same issue, updated it but issue persists... the jwt error might have dissappeared but the internal server error remains.. and spinner still spinning

kidunot89 commented 1 year ago

And going to the /graphql simply gives you the missing query message?

Here's an idea. Try going to the WooGraphQL settings tab and click the Save Changes button

alexkey89 commented 1 year ago

And going to the /graphql simply gives you the missing query message?

@kidunot89 yes it gives me this:

{
  "errors": [
    {
      "message": "GraphQL Request must include at least one of those two parameters: \"query\" or \"queryId\"",
      "extensions": {
        "category": "request"
      }
    }
  ],
  "extensions": {
    "debug": [],
    "queryAnalyzer": {
      "keys": "",
      "keysLength": 0,
      "keysCount": 0,
      "skippedKeys": "",
      "skippedKeysSize": 0,
      "skippedKeysCount": 0,
      "skippedTypes": []
    }
  }
}
alexkey89 commented 1 year ago

And going to the /graphql simply gives you the missing query message?

Here's an idea. Try going to the WooGraphQL settings tab and click the Save Changes button

@kidunot89 tried clicking save, same issue...

alexkey89 commented 1 year ago

And going to the /graphql simply gives you the missing query message? Here's an idea. Try going to the WooGraphQL settings tab and click the Save Changes button

@kidunot89 tried clicking save, same issue...

Just to help a bit more.. I tried doing request with postman on the posts and it worked, but when i tried to request products it gave me the server issue...

This worked on postman:

query POST {
  posts(first: 10) {
    nodes {
      title
    }
  }
}

This DID NOT work on postman:

query WHATEVER {
  products(first: 10) {
    nodes {
      name
    }
  }
}
alexkey89 commented 1 year ago

And going to the /graphql simply gives you the missing query message?

Here's an idea. Try going to the WooGraphQL settings tab and click the Save Changes button

@kidunot89 Found the Issue!!! There'a conflict with WooGraphQL 0.15 & WPGraphQL for Advanced Custom Fields 0.6.1! When I deactivated it, it worked! Surprisingly older versions of WooGraphQL did not have this. Is this something you can fix asap please? I cannot update the plugins and the site I have without being sure that everything will work smoothly.

NEW UPDATE: Figured out there's a beta version 2.0.0-beta4.0.0 (https://github.com/wp-graphql/wpgraphql-acf/releases/tag/v2.0.0-beta.4.0.0), i installed that and it worked. Hopefully stable version will be published soon..

kidunot89 commented 1 year ago

Then I guess we can consider this issue resolve 😄