Skip to content

Instantly share code, notes, and snippets.

@therealgilles
therealgilles / class-gql.php
Last active February 4, 2026 03:51
Events GraphQL functions
<?php
/**
* Events GraphQL functions
*/
namespace Events;
use WPGraphQL\Data\Connection\TermObjectConnectionResolver;
use WPGraphQL\AppContext;
use WPGraphQL\Model\Post;
@therealgilles
therealgilles / class-teccursorfixer.php
Last active February 4, 2026 04:25
Fix WPGraphQL cursor pagination when TEC Custom Tables V1 is active
<?php
/**
* Fix WPGraphQL cursor pagination when TEC Custom Tables V1 is active.
*
* TEC Custom Tables V1 replaces WP_Meta_Query with Custom_Tables_Meta_Query,
* redirecting meta key JOINs (e.g. _EventStartDate) from wp_postmeta to the
* tec_occurrences table.
*
* This class addresses three issues:
*
@therealgilles
therealgilles / class-wpgraphqlorderbymetafield.php
Last active February 4, 2026 04:13
WP GraphQL Meta Field Ordering
<?php
/**
* Plugin Name: WP GraphQL Meta Field Ordering
* Description: Adds functionality to order by a meta field as specified by the user.
* See: https://gist.github.com/jasonbahl/da87dbccb58f1323a324a9b3e8952d6c
* and also:
* https://github.com/wp-graphql/wp-graphql/issues/287
* https://github.com/wp-graphql/wp-graphql/pull/721
* https://github.com/wp-graphql/wp-graphql-meta-query/blob/develop/wp-graphql-meta-query.php
*/