Run an action after the response has been filtered, as the response is being returned. This is a good place for debug tools to hook in to log things, etc. Params $filtered_response (array): The filtered response for the GraphQL request $response (array): The response for your GraphQL request $schema (WPGraphQL\WPSchema): The schema object for the …
Post Type Archives: Actions
graphql_execute
Run an action. This is a good place for debug tools to hook in to log things, etc. Params $response (array): The response for your GraphQL request $schema (WPGraphQL\WPSchema): The schema object for the root request $operation (string): The name of the operation $query (string): The query that GraphQL executed $variables (array|null): Variables passed to …
init_graphql_request
Action that executes when a GraphQL Request begins. This is a great place for plugins to hook in and modify things that should only occur in the context of a GraphQL Request. The base class hooks into this action to kick off the schema creation, types are not set up until this action has run. …
graphql_insert_post_object
Fires after a single term is created or updated via a GraphQL mutation Params $post_id (int): Inserted post ID $post_type_object (WP_Post_Type): The Post Type object for the post being mutated $args (array): The args used to insert the term $mutation_name (string): The name of the mutation being performed Source File: wp-graphql/src/Mutation/PostObjectUpdate.php
graphql_post_object_mutation_set_object_terms
Fire an action before setting object terms during a GraphQL Post Object Mutation. One example use for this hook would be to create terms from the input that may not exist yet, so that they can be set as a relation below. Params $post_id (int): Inserted post ID $input (array): The input for the mutation $post_type_object (WP_Post_Type): …
Continue reading “graphql_post_object_mutation_set_object_terms”
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 …
Continue reading “graphql_post_object_mutation_update_additional_data”
graphql_after_return_field_from_model
Hook that fires after the data is returned for the field Params $results (string): The returned data for the field $key (string): The name of the field on the type $model_name (string): Name of the model the filter is currently being executed in $data (mixed): The un-modeled incoming data $visibility (string): The visibility setting for …
graphql_media_item_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 mediaItems, such as updating additional postmeta, or sending emails to Kevin. . .whatever you need to do with the mediaItem. Params $media_item_id (int): The ID of the mediaItem being mutated $input …
Continue reading “graphql_media_item_mutation_update_additional_data”
graphql_after_resolve_field
Fire an action AFTER the field resolves Params $source (mixed): The source passed down the Resolve Tree $args (array): The args for the field $context (AppContext): The AppContext that is passed down the resolve tree $info (ResolveInfo): The ResolveInfo that is passed down the resolve tree $field_resolver (mixed): The field resolver function $type_name (string): The name of …
graphql_before_resolve_field
Fire an action BEFORE the field resolves Params $source (mixed): The source passed down the Resolve Tree $args (array): The args for the field $context (AppContext): The AppContext that is passed down the resolve tree $info (ResolveInfo): The ResolveInfo that is passed down the resolve tree $field_resolver (mixed): The field resolver function $type_name (string): The name of the type the …