Skip to content

Add post type / taxonomy args for defining the GraphQL model #2466

@justlevine

Description

@justlevine

What problem does this address?

There are numerous cases where a custom post type / taxonomy needs to use a custom model. Currently implementing a custom model is a complicated and imperfect process, as the model is usually hard-coded into the data loader and connection resolver. This requires devs to extend/replace those classes in addition to all the resolve callbacks that use them.

What is your proposed solution?

Continuing the work done in #2399 , a custom property should be added to WP_Post_Type and WP_Taxonomy that allows a user to set a custom model.

This model should then be used by the various DataLoader/ConnectionResolvers, falling back to the defaults when none is set.

What alternatives have you considered?

No response

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: discussionRequires a discussion to proceedscope: apiIssues related to access functions, actions, and filterstype: enhancementImprovements to existing functionality

    Type

    No type

    Projects

    Status

    💬 In Discussion

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions