Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Product.contentType.id connection errors and returns null #325

Closed
TylerBarnes opened this issue Jul 25, 2020 · 1 comment
Closed

Product.contentType.id connection errors and returns null #325

TylerBarnes opened this issue Jul 25, 2020 · 1 comment
Assignees
Labels
bug Something isn't working failing type Issue concerns a failing/broken type
Milestone

Comments

@TylerBarnes
Copy link

Describe the bug
Product.contentType.id returns null along with an error.

To Reproduce
Steps to reproduce the behavior:
In a GraphQL client, make this query:

{
  products {
    nodes {
      contentType {
        node {
          name
        }
      }
    }
  }
}

The response will look like so:

{
  "errors": [
    {
      "debugMessage": "Argument 1 passed to WPGraphQL\\Connection\\ContentTypes::WPGraphQL\\Connection\\{closure}() must be an instance of WPGraphQL\\Model\\Post, instance of WPGraphQL\\WooCommerce\\Model\\Product given",
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      },
      "locations": [
        {
          "line": 4,
          "column": 7
        }
      ],
      "path": [
        "products",
        "nodes",
        0,
        "contentType"
      ]
    },
    {
      "debugMessage": "Argument 1 passed to WPGraphQL\\Connection\\ContentTypes::WPGraphQL\\Connection\\{closure}() must be an instance of WPGraphQL\\Model\\Post, instance of WPGraphQL\\WooCommerce\\Model\\Product given",
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      },
      "locations": [
        {
          "line": 4,
          "column": 7
        }
      ],
      "path": [
        "products",
        "nodes",
        1,
        "contentType"
      ]
    },
    {
      "debugMessage": "Argument 1 passed to WPGraphQL\\Connection\\ContentTypes::WPGraphQL\\Connection\\{closure}() must be an instance of WPGraphQL\\Model\\Post, instance of WPGraphQL\\WooCommerce\\Model\\Product given",
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      },
      "locations": [
        {
          "line": 4,
          "column": 7
        }
      ],
      "path": [
        "products",
        "nodes",
        2,
        "contentType"
      ]
    },
    {
      "debugMessage": "Argument 1 passed to WPGraphQL\\Connection\\ContentTypes::WPGraphQL\\Connection\\{closure}() must be an instance of WPGraphQL\\Model\\Post, instance of WPGraphQL\\WooCommerce\\Model\\Product given",
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      },
      "locations": [
        {
          "line": 4,
          "column": 7
        }
      ],
      "path": [
        "products",
        "nodes",
        3,
        "contentType"
      ]
    },
    {
      "debugMessage": "Argument 1 passed to WPGraphQL\\Connection\\ContentTypes::WPGraphQL\\Connection\\{closure}() must be an instance of WPGraphQL\\Model\\Post, instance of WPGraphQL\\WooCommerce\\Model\\Product given",
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      },
      "locations": [
        {
          "line": 4,
          "column": 7
        }
      ],
      "path": [
        "products",
        "nodes",
        4,
        "contentType"
      ]
    },
    {
      "debugMessage": "Argument 1 passed to WPGraphQL\\Connection\\ContentTypes::WPGraphQL\\Connection\\{closure}() must be an instance of WPGraphQL\\Model\\Post, instance of WPGraphQL\\WooCommerce\\Model\\Product given",
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      },
      "locations": [
        {
          "line": 4,
          "column": 7
        }
      ],
      "path": [
        "products",
        "nodes",
        5,
        "contentType"
      ]
    },
    {
      "debugMessage": "Argument 1 passed to WPGraphQL\\Connection\\ContentTypes::WPGraphQL\\Connection\\{closure}() must be an instance of WPGraphQL\\Model\\Post, instance of WPGraphQL\\WooCommerce\\Model\\Product given",
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      },
      "locations": [
        {
          "line": 4,
          "column": 7
        }
      ],
      "path": [
        "products",
        "nodes",
        6,
        "contentType"
      ]
    },
    {
      "debugMessage": "Argument 1 passed to WPGraphQL\\Connection\\ContentTypes::WPGraphQL\\Connection\\{closure}() must be an instance of WPGraphQL\\Model\\Post, instance of WPGraphQL\\WooCommerce\\Model\\Product given",
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      },
      "locations": [
        {
          "line": 4,
          "column": 7
        }
      ],
      "path": [
        "products",
        "nodes",
        7,
        "contentType"
      ]
    },
    {
      "debugMessage": "Argument 1 passed to WPGraphQL\\Connection\\ContentTypes::WPGraphQL\\Connection\\{closure}() must be an instance of WPGraphQL\\Model\\Post, instance of WPGraphQL\\WooCommerce\\Model\\Product given",
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      },
      "locations": [
        {
          "line": 4,
          "column": 7
        }
      ],
      "path": [
        "products",
        "nodes",
        8,
        "contentType"
      ]
    },
    {
      "debugMessage": "Argument 1 passed to WPGraphQL\\Connection\\ContentTypes::WPGraphQL\\Connection\\{closure}() must be an instance of WPGraphQL\\Model\\Post, instance of WPGraphQL\\WooCommerce\\Model\\Product given",
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      },
      "locations": [
        {
          "line": 4,
          "column": 7
        }
      ],
      "path": [
        "products",
        "nodes",
        9,
        "contentType"
      ]
    }
  ],
  "data": {
    "products": {
      "nodes": [
        {
          "contentType": null
        },
        {
          "contentType": null
        },
        {
          "contentType": null
        },
        {
          "contentType": null
        },
        {
          "contentType": null
        },
        {
          "contentType": null
        },
        {
          "contentType": null
        },
        {
          "contentType": null
        },
        {
          "contentType": null
        },
        {
          "contentType": null
        }
      ]
    }
  }
}

Expected behavior
This field should return a ContentType node connection.

Desktop (please complete the following information):

  • OS: Macos
  • Browser: N/A
  • Version: 0.5.1
@kidunot89
Copy link
Member

@TylerBarnes I'll make sure I have support for this in the next release.

@kidunot89 kidunot89 added this to the v0.6.0 milestone Jul 27, 2020
@kidunot89 kidunot89 self-assigned this Jul 27, 2020
@kidunot89 kidunot89 added bug Something isn't working failing type Issue concerns a failing/broken type labels Jul 27, 2020
@kidunot89 kidunot89 mentioned this issue Jul 29, 2020
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working failing type Issue concerns a failing/broken type
Projects
None yet
Development

No branches or pull requests

2 participants