Created
          November 19, 2021 17:58 
        
      - 
      
- 
        Save jasonbahl/c556a273c41a90356cab8f94b93385a5 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | add_filter( 'graphql_pre_resolve_field', function( $default, $source, $args, $context, $info, $type_name, $field_key, $field, $field_resolver ) { | |
| if ( 'content' === $field_key && 'Post' === $type_name ) { | |
| return 'your override value'; | |
| } | |
| return $default; | |
| }, 10, 9 ); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
This example shows how to override the "content" resolver for the "Post" type.
You can see the results of this filter in this screensot, where the "content" field returns
your override valuefor each post returned.