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

[GraphQL] "Cannot query field \"type\" on type \"EntryInterface\" for Craft 3.4.9 #5789

Open
cherrykoda opened this issue Mar 13, 2020 · 1 comment
Assignees

Comments

@cherrykoda
Copy link

@cherrykoda cherrykoda commented Mar 13, 2020

Description

type and typeId are listed under 'entries' in the explorer, however only typeId and typeHandle are recognized. Mismatch needs a correction.

Separate QQ - is there any way of getting the entry type's title? Or is it just ID and Handle? Didn't see anything for that.

Steps to reproduce

  1. Open the GraphQL explorer in /admin
  2. Attempt an entry query using 'type' -- example:

query articlesQuery { entries(section: "resources", orderBy: "postDate DESC") { id title postDate type } }

Result:

{
  "errors": [
    {
      "message": "Cannot query field \"type\" on type \"EntryInterface\". Did you mean \"typeId\"?",
      "category": "graphql",
      "locations": [
        {
          "line": 6,
          "column": 7
        }
      ]
    }
  ]
}

Additional info

  • Craft version: 3.4.9
  • PHP version: 7.3.14
  • Database driver & version: MySQL
  • Plugins & versions: N/A
@andris-sevcenko

This comment has been minimized.

Copy link
Member

@andris-sevcenko andris-sevcenko commented Mar 16, 2020

@cherrykoda are you sure there's a field type, though? I'm not seeing it locally.

Separate QQ - is there any way of getting the entry type's title? Or is it just ID and Handle? Didn't see anything for that.

Currently, that's not possible. GraphQL API for the moment returns elements only. Mutations will come with 3.5 and then we'll see about the other entities, the logic behind that being is that your site will be aware on some level about the site's structure, including the entry type names. It's definitely on the table, though, just not a priority at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.