Homepage
Link to WPGraphQL on Github
Link to WPGraphQL on WordPress.org

graphql_post_object_mutation_update_additional_data

Run an action after the additional data has been updated. This is a great spot to hook into to update additional data related to postObjects, such as setting relationships, updating additional postmeta, or sending emails to Kevin. . . whatever you need to do with the postObject.

Params

  • $post_id (int): The ID of the postObject being mutated
  • $input (array): The input for the mutation
  • $post_type_object (WP_Post_Type): The Post Type object for the post being mutated
  • $mutation_name (string): The name of the mutation (ex: create, update, delete)
  • $context (AppContext): The AppContext passed down to all resolvers
  • $info (ResolveInfo): The ResolveInfo passed down to all resolvers
  • $default_post_status (string): The default status posts should use if an intended status wasn’t set
  • $intended_post_status (string): The intended post_status the post should have according to the mutation input

Source

File: wp-graphql/src/Data/PostObjectMutation.php

Example

Extending mutation for post