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

Unable to query roles due to "role.channels is not iterable" #2693

Closed
jyling opened this issue Feb 22, 2024 · 1 comment
Closed

Unable to query roles due to "role.channels is not iterable" #2693

jyling opened this issue Feb 22, 2024 · 1 comment
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@jyling
Copy link
Contributor

jyling commented Feb 22, 2024

Describe the bug
Hi, Vendure developers, I recently updated my backend to the latest v2.1.7, however, I encountered a weird behaviour when querying roles from the admin-api. I keep on getting this error. I'm also able to reproduce this by running npx @vendure/create xxxx to run on a new vendure instance

role.channels is not iterable

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'http://localhost:3000/admin-api'
  2. Query roles
query roles($options: RoleListOptions) {
    roles(options: $options) {
      items {
        id
        code
        description
        permissions
        createdAt
        updatedAt
      }
    }
  }
  1. See error
{
  "errors": [
    {
      "message": "role.channels is not iterable",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "roles"
      ]
    }
  ],
  "data": null
}

Expected behavior
I expect I should be able to get the roles.

Workaround
Running the query with channels seems to solve the issue.

query roles($options: RoleListOptions) {
    roles(options: $options) {
      items {
        id
        code
        description
        permissions
        createdAt
        updatedAt
        channels { id }
      }
    }
  }

Environment (please complete the following information):

  • @vendure/core version: 2.1.7
  • Nodejs version: 18.19.0
  • Database (mysql/postgres etc): postgres 15.3

Additional context
Add any other context about the problem here.

@jyling jyling added the type: bug 🐛 Something isn't working label Feb 22, 2024
@michaelbromley
Copy link
Member

Likely related: fc5d981

@michaelbromley michaelbromley moved this to 📋 Backlog in Vendure OS Roadmap Feb 26, 2024
@michaelbromley michaelbromley moved this from 📋 Backlog to 🔖 Ready in Vendure OS Roadmap Mar 4, 2024
@michaelbromley michaelbromley moved this from 🔖 Ready to ✅ Done in Vendure OS Roadmap Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
Status: 🚀 Shipped
Development

No branches or pull requests

2 participants