Overview
  • Namespace
  • Class

Namespaces

  • WPGraphQL
    • Data
    • Type
      • Avatar
      • Comment
        • Connection
      • CommentAuthor
      • EditLock
      • Enum
      • MediaItem
        • Mutation
      • Plugin
        • Connection
      • PostObject
        • Connection
        • Mutation
      • PostType
      • Setting
      • Taxonomy
      • TermObject
        • Connection
        • Mutation
      • Theme
        • Connection
      • Union
      • User
        • Connection
        • Mutation
    • Utils

Classes

  • PostObjectQuery
  • PostObjectType

Class PostObjectType

Class PostObjectType

This sets up the base PostObjectType. Custom Post Types that are set to "show_in_graphql" automatically use the PostObjectType and inherit the fields that are defined here. The fields get passed through a filter unique to each type, so each post_type can modify it's type schema via field filters.

NOTE: In some cases the shape of a Custom Post Type's schema is so drastically different from the standard PostObjectType shape it might make more sense for the custom post type to register a different type altogether instead of utilizing the PostObjectType.

GraphQL\Type\Definition\ObjectType
Extended by WPGraphQL\Type\WPObjectType
Extended by WPGraphQL\Type\PostObject\PostObjectType
Namespace: WPGraphQL\Type\PostObject
Package: WPGraphQL\Type
Since: 0.0.5
Located at Type/PostObject/PostObjectType.php

Methods summary

public
# __construct( string $post_type )

PostObjectType constructor.

PostObjectType constructor.

Parameters

$post_type
The post_type name

Since

0.0.5

Overrides

WPGraphQL\Type\WPObjectType::__construct
public static mixed
# post_object_format_arg( )

Define the args to be used by post object fields.

Define the args to be used by post object fields.

Returns

mixed

Methods inherited from WPGraphQL\Type\WPObjectType

node_interface(), prepare_fields()

API documentation generated by ApiGen