Can query single post type, not multiple
-
I am using Toolset to manage my custom content, I need their Views functionality, and am using the following code snippet to call the custom fields associated with that content into posts into GraphQL:
<?php add_action( 'graphql_register_types', function() { register_graphql_field( 'SupportCall', 'summary', [ 'type' => 'String', 'description' => __( 'Call summary', 'wp-graphql' ), 'resolve' => function( $post ) { $summary = get_post_meta( $post->ID, 'wpcf-summary', true ); return ! empty( $summary ) ? $summary : $summary; } ] ); } );
I am able to query single posts, but not multiple posts, which I need to make a posts list. Is there a setting I need to change, or something I need to add to the code to retrieve multiple posts? Or do I need a totally different code snippet?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Can query single post type, not multiple’ is closed to new replies.