Title: Unknown object type
Last modified: March 25, 2020

---

# Unknown object type

 *  Resolved [Austin](https://wordpress.org/support/users/austyfrosty/)
 * (@austyfrosty)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/unknown-object-type/)
 * Checking out this plugin, and have noticed that if using the `_fields` filter
   parameter the object type could get set as unknown.
 * To test this: visit `wp-json/wp/v2/posts/?_fields=title`. Since it’s filtering
   the endpoint to only return the title field, there isn’t a `type` to get the 
   object type of ‘post’. I think some additional info is needed to determine the
   current object type.
 * _Assuming that it’s necessary to invalidate cache based on a object when those
   objects get updated.._

Viewing 1 replies (of 1 total)

 *  Plugin Author [Richard Korthuis](https://wordpress.org/support/users/rockfire/)
 * (@rockfire)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/unknown-object-type/#post-12582824)
 * Hi [@austyfrosty](https://wordpress.org/support/users/austyfrosty/)
 * Thank you for using our plugin!
 * Yes the object type is needed to correctly invalidate caches when those objects
   get updated. Our plugin needs at least the fields `id` and `type` to correctly
   identify the object type (and `taxonomy` in case of a taxonomy endpoint). So 
   if you would change your call to `wp-json/wp/v2/posts/?_fields=title,id,type`
   it would work perfectly.
 * If you really don’t want to add the necessary fields, you can always add your
   own logic to determine the correct object type, by using a filter. See [our FAQ](https://wordpress.org/plugins/wp-rest-cache/#on%20the%20cache%20overview%20page%20i%20see%20the%20object%20type%20is%20%E2%80%98unknown%E2%80%99.%20can%20i%20help%20the%20wp%20rest%20cache%20plugin%20to%20detect%20the%20object%20type%20correctly%3F)
   on how to do it.

Viewing 1 replies (of 1 total)

The topic ‘Unknown object type’ is closed to new replies.

 * ![](https://ps.w.org/wp-rest-cache/assets/icon-256x256.png?rev=3328849)
 * [WP REST Cache](https://wordpress.org/plugins/wp-rest-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-rest-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-rest-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-rest-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-rest-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-rest-cache/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Richard Korthuis](https://wordpress.org/support/users/rockfire/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/unknown-object-type/#post-12582824)
 * Status: resolved