Adds Settings to the Custom Post Type UI plugin to show Post Types in WPGraphQL

Overview

DEPRECATION NOTICE

πŸš€ Custom Post Type UI v1.9.0 introduced formal support for WPGraphQL!!!

πŸ‘‹ With that, this plugin is being deprecated and will no longer be maintained.

πŸ‘‰ We recommend upgrading to v1.9.0+ of Custom Post Type UI.

πŸ“ If you have issues with Custom Post Type UI showing Post Types / Taxonomies in WPGraphQL, open an issue on the Custom Post Type UI repo or the WPGraphQL repo and we'll help get it sorted.

WPGraphQL for Custom Post Type UI

Install this plugin along with WPGraphQL and Custom Post Type UI and you will have settings to show your Custom Post Types and Custom Taxonomies in GraphQL.

Comments
  • Won't change to True

    Won't change to True

    Hey there, In CPT UI I can't get "Show in GraphQL" to save as true. I thought it might be something in my config or settings so I spun up a fresh WordPress install and installed the latest versions of WPGraphQL (version 1.3.3), CPT UI (version 1.8.2), and this plugin (version 1.2.0). Everything's just set to their defaults. I added a new custom post type in CPT UI with the Post Type Slug being case_results, the Plural Label being Case Results, and the Singular Label being Case Result. Everything else is left untouched. When I select True in Show in GraphQL it seems to automatically pull in what's in Singular Label for GraphQL Single Name and Plural Label for GraphQL Plural Name. So I did try that first. But when I hit Save Post Type it just goes back to false. I tried changing the GraphQL Single Name to various different things including case-result, caseresult, and _caseresult and tried changing the GraphQL Plural Name to case-results, caseresults, and _caseresults but none worked. When I go to Registered Types/Taxes below is what I see in the Settings column. Any help would be much appreciated.

    name: case_results label: Case Results singular_label: Case Result description: "" public: true publicly_queryable: true show_ui: true show_in_nav_menus: true delete_with_user: false show_in_rest: true rest_base: "" rest_controller_class: "" has_archive: false has_archive_string: "" exclude_from_search: false capability_type: post hierarchical: false rewrite: true rewrite_slug: "" rewrite_withfront: true query_var: true query_var_slug: "" menu_position: "" show_in_menu: true show_in_menu_string: "" menu_icon: "" custom_supports: "" graphql_single_name: "" graphql_plural_name: ""

    Actually I pulled an older version of this plugin off of another site we're using it on, version 1.1, and that one seems to be working as expected.

    bug close candidate 
    opened by ashleynexvelsolutions 10
  • singular and plural field names aren't normalized

    singular and plural field names aren't normalized

    If I add a single name of team mate, it's registered to the schema like that. Ideally these fields would be normalized to camelcase automatically. so team mate becomes teamMate.

    It could be nice to have an option to infer the field names from the post type labels too. Team Mate could become teamMate automatically.

    opened by TylerBarnes 6
  • Error when adding a new post type

    Error when adding a new post type

    When adding a new post type in CPTUI, if I don't scroll down and add the GraphQL single and plural names, but I create the post type, the site will be broken and the admin will be unreachable and display The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.

    [30-Oct-2019 04:33:50 UTC] PHP Fatal error:  Uncaught GraphQL\Error\UserError: The much post_type isn't configured properly to show in GraphQL. It needs a "graphql_single_name" and a "graphql_plural_name" in /Users/tyler/Local Sites/wpgraphql/app/public/wp-content/plugins/wp-graphql/wp-graphql.php:415
    Stack trace:
    #0 [internal function]: WPGraphQL::{closure}('much')
    #1 /Users/tyler/Local Sites/wpgraphql/app/public/wp-content/plugins/wp-graphql/wp-graphql.php(424): array_map(Object(Closure), Array)
    #2 /Users/tyler/Local Sites/wpgraphql/app/public/wp-content/plugins/wp-graphql/wp-graphql.php(289): WPGraphQL::get_allowed_post_types()
    #3 /Users/tyler/Local Sites/wpgraphql/app/public/wp-includes/class-wp-hook.php(286): WPGraphQL->get_allowed_types('')
    #4 /Users/tyler/Local Sites/wpgraphql/app/public/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
    #5 /Users/tyler/Local Sites/wpgraphql/app/public/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
    #6 /Users/tyler/Local Sites/wpgraphql/app/public/wp-settings.php(525): do_action('init' in /Users/tyler/Local Sites/wpgraphql/app/public/wp-content/
    
    opened by TylerBarnes 3
  • In edit mode

    In edit mode "Show in GraphQL" always defaults to true

    Show in GraphQL always defaults to true and doesn't take its saved option. The option saves correctly but if you go back in and edit the taxonomy or post it defaults to true

    opened by rkew 1
  • Doesn't work with CPT UI 1.8.2

    Doesn't work with CPT UI 1.8.2

    Seems that latest update CPT UI (to version 1.8.2) breaks schema generation at GraphiQL IDE (page /wp-admin/admin.php?page=graphiql-ide). When this plugin activated, the Explorer window in GraphiQL IDE became empty and in developer console I see following error:

    Uncaught (in promise) Error: Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: { status: 500 } main.b7d08b5b.js:1:199854 https://........./wp-content/plugins/wp-graphql/src/Admin/GraphiQL/app/build/static/js/main.b7d08b5b.js?ver=5.7:1

    opened by Yuribtr 1
  • Field names fields should be required

    Field names fields should be required

    Currently these are not required. This leads to an odd UX.

    If you add a new post type with no intention of using it in WPGraphQL, it will still be set to "show_in_graphql" => true by default. This means when you create your new post type, without changing any settings related to this plugin, you'll get an error when attempting to make a gql request.

    Ideally these fields should be required. I went to start making a PR to do this, but I realized these fields should only be required if "Show in GraphQL" is set to true. If it's false these fields shouldn't be required. I'm not too sure how to make that work with the CPTUI $ui helper without adding some custom JS πŸ€” .

    Do we need to register a little bit of JS that flips these between required and not-required?

    opened by TylerBarnes 1
  • Adds support for custom taxonomies

    Adds support for custom taxonomies

    Solves this ticket: #6

    I'm sure there is a better way to abstract some functions here, to not repeat so much code. But this is an easy add-in and it fixes the issue. Would be great if someone tests it properly.

    If someone has some code optimize suggestions, I'm happy to add it. I'm not the biggest php guru πŸ˜„

    Review Ready Work In Progress 
    opened by henrikwirth 1
  • Undefined variable $post_type_deleted

    Undefined variable $post_type_deleted

    Getting a PHP warning:

    Notice: Undefined variable: post_type_deleted in /app/public/wp-content/plugins/wp-graphql-custom-post-type-ui-master/wp-graphql-custom-post-type-ui.php on line 78
    

    Looks like changing line 78 to the following should fix it:

    $selected_post_type = cptui_get_current_post_type( false );
    
    bug good first issue 
    opened by jasonbahl 1
  • Release v1.2.0

    Release v1.2.0

    TLDR

    • updates the plugin to have conditional logic for the graphql_single_name and graphql_plural_name to only show and be required if show_in_graphql is set to true.
    • cleans up code formatting
    • DRY up the form markup that's used for the forms
    • Fixes issue with postbox header markup

    More info

    This is basically a complete refactor of the plugin.

    The overall goal is to handle the fields for GraphQL settings better.

    Currently, users can leave graphql_single_name and graphql_plural_name blank, but set the Post Type or Taxonomy to show_in_graphql and that causes issues.

    This makes the graphql_single_name and graphql_plural_name fields conditional to only show and be required if show_in_graphql is set to true.

    See example:

    show-in-graphql-cptui

    Release Review Ready 
    opened by jasonbahl 0
  • πŸ› Fix undefined variable post_type_deleted

    πŸ› Fix undefined variable post_type_deleted

    Issue #4

    Fix the Notice: Undefined variable: post_type_deleted in /app/public/wp-content/plugins/wp-graphql-custom-post-type-ui-master/wp-graphql-custom-post-type-ui.php on line 78

    opened by 19h47 0
  • Add Composer Support

    Add Composer Support

    It would be nice for users to be able to install this plugin using composer.

    This plugin should have a composer.json file and be submitted to packagist.org

    opened by rachelbahl 0
Releases(v1.2.0)
  • v1.2.0(Mar 24, 2021)

    TLDR

    • updates the plugin to have conditional logic for the graphql_single_name and graphql_plural_name to only show and be required if show_in_graphql is set to true.
    • cleans up code formatting
    • DRY up the form markup that's used for the forms
    • Fixes issue with postbox header markup

    More info

    This is basically a complete refactor of the plugin.

    The overall goal is to handle the fields for GraphQL settings better.

    Currently, users can leave graphql_single_name and graphql_plural_name blank, but set the Post Type or Taxonomy to show_in_graphql and that causes issues.

    This makes the graphql_single_name and graphql_plural_name fields conditional to only show and be required if show_in_graphql is set to true.

    See example:

    show-in-graphql-cptui

    Source code(tar.gz)
    Source code(zip)
  • v1.1(Sep 9, 2019)

    Release Notes:

    • Adds support for Custom Taxonomy Settings. Thanks @henrikwirth!
    • Added composer.json file, so now the plugin is available on packagist so it can be installed via composer. See: https://packagist.org/packages/wp-graphql/wp-graphql-custom-post-type-ui
    Source code(tar.gz)
    Source code(zip)
Owner
WPGraphQL
An Open Source WordPress plugin that enables a GraphQL API for WordPress sites
WPGraphQL
A PHP Class for creating Wordpress Custom Post Types easily

N.B I've released an updated version of the project to a new repository, PostTypes. WP Custom Post Type Class v1.4 A single class to help you build mo

Joe Grainger 412 Nov 25, 2022
Adds a dashboard widget that allows admins to quickly open the edit screen for any WordPress post type- including orders, products, and subscriptions.

Quick Open Dashboard Widget Requires PHP: 7.0 WP requires at least: 5.7 WP tested up to: 5.7 WC requires at least: 5.6.0 WC tested up to: 5.8.0 Stable

Universal Yums 4 Nov 11, 2021
WPGraphQL Extension: Adds "meta_query" support to postObject connection queries using WP_Query

WPGraphQL Meta Query This plugin adds Meta_Query support to the WP GraphQL Plugin for postObject query args. Why is this an extension and not part of

WPGraphQL 42 Nov 10, 2022
An WPGraphQL extension that adds SearchWP's query functionality to the GraphQL server

QL Search What is QL Search? An extension that integrates SearchWP into WPGraphQL. Quick Install Install & activate SearchWP v3.1.9+ Install & activat

Funkhaus 11 May 5, 2022
WPGraphQL for Advanced Custom Fields

WPGraphQL for Advanced Custom Fields WPGraphQL for Advanced Custom Fields automatically exposes your ACF fields to the WPGraphQL Schema. Install and A

WPGraphQL 558 Jan 8, 2023
a wordpress plugin that improves wpgraphql usage together with wpml

WPGraphQL WPML Extension Contributors: rburgst Stable tag: 1.0.6 Tested up to: 5.6.1 Requires at least: 4.9 Requires PHP: 7.0 Requires WPGraphQL: 0.8.

null 42 Dec 15, 2022
This is an extension to the WPGraphQL plugin for Yoast SEO

WPGraphQl Yoast SEO Plugin Please note version 14 of the Yoast Plugin is a major update. If you are stuck on version of Yoast before V14 then use v3 o

Ashley Hitchcock 197 Dec 26, 2022
A custom WordPress nav walker class to fully implement the Twitter Bootstrap 4.0+ navigation style (v3-branch available for Bootstrap 3) in a custom theme using the WordPress built in menu manager.

WP Bootstrap Navwalker This code in the main repo branch is undergoing a big shakeup to bring it in line with recent standards and to merge and test t

WP Bootstrap 3.3k Jan 5, 2023
A WordPress package for updating custom plugins and themes based on an API response from a custom update server.

WordPress Update Handler A WordPress package for updating custom plugins and themes based on an JSON REST API response from a custom update server. Ch

WP Forge 7 Oct 5, 2022
A WordPress plugin to suspend WordPress sites automagically. Simple and lightweight, no annoying ads and fancy settings.

Suspend WP A WordPress plugin to suspend WordPress sites automagically. Simple and lightweight, no annoying ads and fancy settings. ?? Demo (coming so

Waren Gonzaga 3 Nov 15, 2021
A simple platform information plugin for WordPress. Shows you environment variables, PHP settings and more.

A simple platform information plugin for WordPress. Shows you environment variables, PHP settings and more.

New To Vaux 2 Sep 7, 2022
Free WordPress plugin to generate Admin Settings Page.

ClioWP Settings Page ClioWP Setting Page is a free WordPress Plugin which creates a sample Settings Page. This β€œtest” page contains almost any type of

Christos Pontikis 5 Nov 3, 2022
Authentication for WPGraphQL using JWT (JSON Web Tokens)

WPGraphQL JWT Authentication This plugin extends the WPGraphQL plugin to provide authentication using JWT (JSON Web Tokens) JSON Web Tokens are an ope

WPGraphQL 268 Dec 31, 2022
Enable query locking for WPGraphQL by implementing persisted GraphQL queries.

?? WP GraphQL Lock This plugin enables query locking for WPGraphQL by implementing persisted GraphQL queries. Persisted GraphQL queries allow a GraphQ

Valu Digital 21 Oct 9, 2022
[ALPHA] Implementation of persisted queries for WPGraphQL

WPGraphQL Persisted Queries Persisted GraphQL queries allow a GraphQL client to optimistically send a hash of the query instead of the full query; if

Quartz 18 Jun 20, 2022
Send emails via mutation using WpGraphQl

WPGraphQL Send Email Plugin One of the simple things about a traditional WordPress sites is sending emails, this plugin makes it easy to do this via a

Ashley Hitchcock 18 Aug 21, 2022
Structured content blocks for WPGraphQL

WPGraphQL Content Blocks (Structured Content) This WPGraphQL plugin returns a WordPress post’s content as a shallow tree of blocks and allows for some

Quartz 72 Oct 3, 2022
WPGraphQL Polylang Extension for WordPress

WPGraphQL Polylang Extension Extend WPGraphQL schema with language data from the Polylang plugin. Features For posts and terms (custom ones too!) Adds

Valu Digital 102 Dec 29, 2022
Wordpress wrapper to expose Carbon Fields to WpGraphQL queries.

WpGraphQLCrb A Wordpress wrapper to expose Carbon Fields to WpGraphQL queries. Important This is just the first version. There is a lot of work to be

Matheus Paiva 16 Aug 19, 2022