drupal-graphql / graphql-search-api

GraphQL & Drupal Search API integration.
10 stars 22 forks source link

Index field "Content type (type)" returns index name instead node content type #18

Closed sixtyniner-official closed 5 years ago

sixtyniner-official commented 5 years ago

Not sure if it's feature or a bug, but have following scenario:

  1. I've created server for indexing Database
  2. Created index with Content Data source
  3. Content type field added.

But GraphQL response return Index name instead content type name. Check response image.

  1. Server: https://imgur.com/PiZZvMe
  2. Fields: https://imgur.com/XQlceCP
  3. Response: https://imgur.com/sUjs6bW
duartegarin commented 5 years ago

Hi @mestro67 , This is strange, I can't seem to reproduce this. Can you check your solr index (directly in the solr UI) and see what's index there? This module should be grabbing data as it appears there. If for some reason it's incorrect there, then it would be something within your Search API config (maybe a misconfigured field, where you are using the index id by mistake?) Let me know what's in the index and we can investigate a bit more. Cheers, Duarte

sixtyniner-official commented 5 years ago

Hi @duartegarin,

I do not use Solr, but Database Search (search_api_db)

dbsearch

duartegarin commented 5 years ago

Interesting. You seemed to have stumbled across a naming conflict between the field name and the index field. I'll have to work this out. Meanwhile, you can just change "type" to something else like "node_type" and it should work. Cheers, Duarte

sixtyniner-official commented 5 years ago

Thank you! Renaming default Content Type machine name "type" to eg. "content_type" is fix, or at least workaround for described problem.

duartegarin commented 5 years ago

This issue should now be fixed with PR #23