Skip to content

Internal server error when querying an author using nodeByUri #86

@LarsEjaas

Description

@LarsEjaas

I am trying to do a seedQuery as described here: https://faustjs.org/reference/seed-query
When I do this for a author URL with the format: blog/author/ I get a server error when the wp-graphql-polylang plugin is activated.

Steps to reproduce:

  1. Set permalink structure to: /blog/%postname%/
  2. Activate the Polylang plugin and the WPGraphQL plugin.
  3. Do the following query from within the WPGraphiQL IDE in WordPress Admin(this was simplified a lot - but enough to trigger the error):
query GET_NODE_BY_URI( $uri: String! = "") {
  ... on RootQuery {
    node: nodeByUri(uri: $uri) {
      uri
      id
    }
  }
}

Variables:
{ "uri": "blog/author/<author-name>" }

This will return the following data:

  "data": {
    "node": {
      "uri": "/blog/author/ejaasheadless/",
      "id": "dXNlcjox"
    }
  }
  1. Activate the WP GraphQL Polylang plugin and execute the query from within the WPGraphiQL IDE again. This will return the following error:
"debugMessage": "WPGraphQL\\Registry\\TypeRegistry::get_type(): Argument #1 ($type_name) must be of type string, null given, called in /var/www/html/wp-content/plugins/wp-graphql/src/Type/InterfaceType/UniformResourceIdentifiable.php on line 59",
     "message": "Internal server error",

I have tested on:

  • WordPress v. 6.3.2
  • WPGraphQL v. 1.17.0
  • Polylang v. 3.5.1
  • WP GraphQL Polylang v. 0.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions