:rocket: GraphQL API for WordPress

Overview

alt text

WPGraphQL

WPGraphQL is a free, open-source WordPress plugin that provides an extendable GraphQL schema and API for any WordPress site.

Below are some links to help you get started with WPGraphQL


Total Downloads Monthly Downloads Daily Downloads Latest Stable Version License Actions Status Actions Status codecov

Install

  • Requires PHP 7.1+
  • Requires WordPress 5.0+

Quick Install

Follow the WPGraphQL Quick Start instructions to install and activate WPGraphQL Details here

Additional Documentation

Shout Outs

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Backers

Backers on Open Collective

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Sponsors on Open Collective

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

Comments
  • v1.8.0 causing gatsby-source-wordpress error

    v1.8.0 causing gatsby-source-wordpress error

    v1.80 was preventing my headless Wordpress site from building successfully with the following error:

    gatsby-source-wordpress Found a duplicate ID in WordPress - this means you will have fewer nodes in Gatsby than in WordPress. This will need to be resolved in WP by identifying and fixing the underlying bug with your WP plugins or custom code.

    I reverted to v1.72 and the error disappeared.

    Hope this helps someone out!

    type: bug Gatsby Component: Pagination Regression 
    opened by pauljavascripting 32
  • Query custom post types by slug returns null

    Query custom post types by slug returns null

    I think I found another bug. I registered a custom post type and am trying to query a post by it's slug, but it returns null. When I query the same post by the ID, database ID or URI there is no problem.

    Example query

    {
      byId: blogPostBy(id: "cG9zdDo0NQ==") {
        title
        id
        slug
      }
      bySlug: blogPostBy(slug: "test") {
        title
        id
        slug
      }
    }
    

    This returns:

    {
      "data": {
        "byId": {
          "title": "Blogpost test",
          "id": "cG9zdDo0NQ==",
          "slug": "test"
        },
        "bySlug": null
      }
    }
    

    Context

    I registered my custom post type with the following code:

    register_post_type('blog', [
        'graphql_plural_name' => 'blogPosts',
        'graphql_single_name' => 'blogPost',
        'has_archive' => true,
        'labels' => [
            'add_new' => 'New blog post',
            'name' => 'Blog',
            'singular_name' => 'Blog post',
        ],
        'menu_position' => 10,
        'public' => true,
        'rewrite' => ['slug' => 'blog'],
        'show_in_graphql' => true,
        'show_in_rest' => true,
        'supports' => ['editor', 'title'],
    ]);
    

    I am using the following WordPress plugins and versions:

    • WordPress 5.4.2
    • WP GraphQL 0.10.3
    • WP GraphiQL 1.0.1
    type: bug needs: reproduction status: awaiting author response 
    opened by sboerrigter 32
  • How to create a field that is actually its own document tree (related custom post to current post).

    How to create a field that is actually its own document tree (related custom post to current post).

    Hi. I have two custom post types Apples and Buckets where Buckets tracks groups of Apples in it's comment field via Apple's ID.

    How would I extend the plugin in PHP to basically lookup related apple post and toss those documents (along with their custom taxonomies) into a field variables.

    I was looking at the register_graphql_field but I'm not sure if it supports entire document objects.

    I'd basically want to pull it like this:

    Buckets { edges { node { ... BucketFields appleDocuments { edges { node { ... AppleFields

    Thanks for the assistance.

    opened by joseffb-mla 27
  • 404 error at /graphql endpoint (wp installation directory different from site url)

    404 error at /graphql endpoint (wp installation directory different from site url)

    In the WordPress general settings I have the following settings:

    WordPress Address (url): mysite.com/cms Site Address (url): mysite.com

    Trying to access the graphql api at mysite.com/cms/graphql returns a 404 error and redirects to the 404 error WordPress page. Could the different in installation locaiton and site url causing this?

    I'm currently using the Twenty Sixteen theme and there are two other active plugins; FakerPress and WordPress Importer.

    type: question 
    opened by acollins1991 27
  • Proposal for WPGraphQL Dashboard Settings Pages

    Proposal for WPGraphQL Dashboard Settings Pages

    I was wondering if it wouldn't be nice to have an Admin-Page for WPGraphQl for Settings, Status and other functionality, similar to WooCommerce.

    Not sure if it is something that could be in an extra plugin or rather should be in core. I'd be happy about discussions.

    Here are some features I can think of right now, please add some more in the comments:

    1. Status Page
      1. Check compatibility of Plugin versions (Would need some sort of interface in all plugins to be able to check)
      2. Check for requirements (are there any like Memory Limit etc. ?)
      3. Verify GraphQL endpoint
      4. PHP and Environment Info, Installed Plugins working with WPGraphQL (Gotta Register plugin as WPGraphQL plugin somehow)
      5. Way to export all this Info for Issues and debugging
    2. Settings Page
      1. API for WPGraphQL Plugins to add Tabs for their own Settings
        1. WPGraphQL Cors Settings
        2. WPGraphQL Persisted Queries Settings
      2. WooGraphQL: Define JWT Secret
      3. WPGraphQL JWT Authentication: Define Secret, Change Auth Token expiration
    3. Include into core:
      1. WPGraphiQL (default: enabled)
      2. WPInsights (default: disabled)
    4. Extension Page (Plugin)
      • To install WPGraphQL Extensions (Plugins)
    5. General Considerations:
      1. Settings should be properly hookable/filterable allowing plugins to extend the setting pages for their needs.
      2. Settings should be accessible

    Let the discussion begin 😄

    status: discussion type: feature impact: high 
    opened by henrikwirth 25
  • WPGraphQL should call `html_entity_decode()` for all content fields

    WPGraphQL should call `html_entity_decode()` for all content fields

    By default WordPress encodes HTML entities before they are saved to database. This can be convinient when templating HTML strings in PHP because developers don't have to think about it.

    But with WPGraphQL this is a burden when content is rendered via React or any other modern tool that has HTML entity encoding build-in because you'll get double html entity encoding.

    There are tools that allow HTML entity decoding in JS but they neither intentionally incomplete like unescape in Lodash or too large like he or ent to be bundled into the browser bundles. But even if we had good tools to do it, it is very cumbersome because developers would have to remember to use them basically every single time when content is being rendered from WP. This is a common issue we have faced when building real world headless sites and apps using React and React Native with WPGraphQL.

    So we end up building HTML entity decoding as WPGrapQL filters on the PHP side: https://gist.github.com/esamattis/54abd801b078056f9e646d63d47ccc4c

    I believe tools like React are the major consumers of WPGraphQL and so I would like to propose that WPGraphQL would add build-in HTML entity decoding for the content fields.

    By content fields I mean text content which is added by the content creators. Such are title, post content, excerpts, ACF text fields etc. Examples of non-content fields would be url, slugs, id where decoding could break something if they where to contain strings that match HTML entities.

    type: enhancement status: discussion ObjectType: Post 
    opened by esamattis 24
  • Error when creating comments on latest dev branch

    Error when creating comments on latest dev branch

    When trying to leave a comment using code that worked on 0.2.x, using the latest of 0.3.x, I get:

    Error: GraphQL error: Variable "$input" got invalid value {"clientMutationId":"CreateComment","content":"Test","author":"Paul","authorEmail":"[email protected]","postId":"1234=","authorIp":"1.2.3.4"}; Field "postId" is not defined by type CreateCommentInput.

    Has the API for comments changed?

    opened by paulisloud 24
  • In GraphiQL Query Composer No Sub-Selection Available

    In GraphiQL Query Composer No Sub-Selection Available

    When composing a query in GraphiQL, the composer does not recognize certain selections as having sub-selections. I'm using Advanced Custom fields with the WPGraphQL for Advanced Custom Fields plugin, and I'm referring specifically to these fields. Interestingly, that plugin's page is no longer there. Does this mean that WPGrapQL no longer supports this plugin?

    In the screen below, executiveTeam should have an arrow right icon to indicate that there are sub-selections available. However, as you can see, there is a checkbox instead. If we check the box and run the query we get the error, "Field \"executiveTeam\" of type \"[Page_Aboutpagefields_ExecutiveTeam]\" must have a sub selection."

    Screen Shot 2022-03-09 at 8 53 24 AM

    Notably, only Flexible Content fields seem to have this problem. As you can see in the image above, heroImage, which is field of type image, is expandable. If I create a test field of the field type repeater, sub-selection is available.

    Screen Shot 2022-03-09 at 9 08 57 AM

    Finally, I did not have this issue before updating the plugin, and I only updated the plugin to resolve a perpetual loading spinner.

    type: bug status: in review close candidate javascript GraphiQL 
    opened by jadamconnor 23
  • [v.1.6.7] Breaking WPGatsby data fetching.

    [v.1.6.7] Breaking WPGatsby data fetching.

    Multiple people on https://github.com/gatsbyjs/gatsby/discussions/33856 are experiencing an issue where the latest WPGraphql plugin somehow disables update detection on Gatsby's side. There's no errors or warnings.

    Only fix for now is v1.6.6. Are there some breaking changes that keeps Gatsby from updating to the new schema? I see that both plugins had an update 2 days ago.

    type: bug Component: Model Layer Gatsby 
    opened by HenrijsS 23
  • GraphQL WordPress Plugin Performance Issue

    GraphQL WordPress Plugin Performance Issue

    GraphQL Plugin's performance deteriorates significantly with the number of post-types and taxonomies defined in the WordPress.

    Reproduce the bug:

    1. Try to add more than 20-30 post types, with around the same number of taxonomies defined for them.
    2. Check out the response timing of GraphQL endpoint.

    To further add to this issue, even caching does not resolve this performance problem. I've tried with

    1. Object Caching (Redis)
    2. MySQL caching(I know I shouldn't have)
    3. Using a GraphQL caching plugin for WordPress

    Screencast for the same:

    Query statistics:

    | Request Type: | WordPress Homepage | GraphQL Request(just endpoint) | WP-JSON Request(just endpoint) | GraphQL Request(Single Post) | WP-JSON Request(Single Post) | |----------------------------------------------|--------------------|--------------------------------|--------------------------------|------------------------------|------------------------------| | Timing with default WordPress | 85 ms | 220 ms | 80 ms | 230 ms | 80 ms | | Timinig with 10 post types and 10 taxonomies | 90 ms | 400 ms | 110 ms | 407 ms | 100 ms | | Timing with 50 post types and 50 taxonomies | 160 ms | 1650 ms | 260 ms | 1650 ms | 230 ms |

    Here's a link to XDebug profiling for the above requests(I've skipped the 10 post type in there) https://drive.google.com/drive/folders/1-U_8Gb4BsL_UEHMyO0NKthRRkXQmq_2i?usp=sharing

    Related info:

    What version of WPGraphQL you're using, and the platform(s) you're running it on

    WPGraphQL version: 1.3.5

    What other plugins you're using

    No plugin active on the site except WPGraphQL

    The behavior you expect to see, and the actual behavior

    The number of post types and taxonomies defined in a WordPress site should have minimal/no impact on the performance of GraphQL queries.

    Any website running WooCommerce, has multiple post types defined for things like:

    1. Orders
    2. Products
    3. Variations
    4. Coupons

    having custom taxonomies like:

    1. Product type
    2. Product visibility
    3. Product categories
    4. Product tags
    5. Product shipping classes
    6. Product Color
    7. Product Design
    8. Product Material
    9. Product Size
    10. Product Style

    Once you set this up, and add a few more plugins that adds CPTs and site almost becomes unusable, if built using GraphQL.

    When reporting a bug, please be sure to include the following:

    • [x] A descriptive title
    • [x] An isolated way to reproduce the behavior (example: GitHub repository with code isolated to the issue that anyone can clone to observe the problem)
    • [x] What version of WPGraphQL you're using, and the platform(s) you're running it on
    • [x] What other plugins you're using
    • [x] The behavior you expect to see, and the actual behavior
    scope: performance 
    opened by gagan0123 23
  • Get menuItem uri or slug

    Get menuItem uri or slug

    When querying menus and their respective menuItems it would be great to be able to grab the menuItem uri or slug directly.

    When working with headless WP and setting up menus, you really just want the page slug/uri to set up your link elements.

    So something like this:

    {
      wpgraphql {
        menus {
          edges {
            node {
              menuItems {
                edges {
                  node {
                    label
                    title
                    slug
                    uri
                    target
                  }
                }
              }
            }
          }
        }
      }
    }
    
    Architecture status: in progress Component: Interfaces ObjectType: Menu 
    opened by joshuaiz 22
  • Gatsby / WooCommerce not processing mediaItems

    Gatsby / WooCommerce not processing mediaItems

    Description

    I'm having major problems trying to build a Gatsby / WooCommerce site - whenever wp-graphql-woocommerce is activated it simply will not process any media items, with this error:

    --

    gatsby-source-wordpress  Error category: undefined
    
    Error:
      Internal server error
    
    Debug message:
      in_array(): Argument #2 ($haystack) must be of type array, string given
    
    Error path: mediaItems
    
    info  gatsby-source-wordpress  GraphQL vars: {"first":100,"url":"http://178.62.90.26/graphql","in":["13"],"after":null}
    

    --

    Steps to reproduce

    Steps to reproduce:

    I have created a completely fresh install of Wordpress (v6+) on a php8+ environment (Digital Ocean Wordpress 1 click install image)

    https://marketplace.digitalocean.com/apps/wordpress

    I open the console and finish the wordpress installation process

    Next I install wp-graphql (latest master version) and run composer install in the directory, then activate the plugin

    Next I install WooCommerce, run through the installation process and create a dummy product

    Then I install WP-Gatsby (v2.3.3) and activate.

    Next I install the latest version of wp-graphql-woocommerce (v12 master), upload the plugin and activate I then change the permalink structure and check that the /graphql route is working - everything is fine

    At this point I have a single dummy product, a single Hello World post with a featured image attached, and I have only the following plugins installed on the site:

    WooCommerce (v7.2.2)

    WP Gatsby (v2.3.3)

    WP GraphQL (v1.13.7)

    WPGraphQL WooCommerce (WooGraphQL) (v0.12.0)

    I then clone this simple blog repo: https://github.com/gatsbyjs/gatsby-starter-wordpress-blog.git

    I run yarn install for dependencies.

    I change my gatsby-config to point toward my server and add an option in gatsby-source-wordpress to ignore ShippingMethod (or else it takes forever to build), and add some debugging in to help define the issue:

    --

    resolve: 'gatsby-source-wordpress',
          
    options: {
     url: process.env.WPGRAPHQL_URL || 'http://178.62.90.26/graphql',      
     
    type: {
              
     ShippingMethod: {
      exclude: true
     },
    },
    debug: {
     graphql: {
       showQueryVarsOnError: true,
       showQueryOnError: true,
       onlyReportCriticalErrors: false,
     },          
    },          
    },
    

    --

    I then add define( 'GRAPHQL_DEBUG', true ); to my wp-config.php and restart Apache just to be sure

    I then run gatsby develop and get the error I mentioned earlier when it gets to MediaItems:

    --

    gatsby-source-wordpress  Error category: undefined
    
    Error:
      Internal server error
     
    Debug message:
      in_array(): Argument #2 ($haystack) must be of type array, string given
     
    Error path: mediaItems
    
    info  gatsby-source-wordpress  GraphQL vars: {"first":100,"url":"http://178.62.90.26/graphql","in":["13"],"after":null}
    

    --

    And it creates 0 MediaItem nodes:

    no MediaItems processed

    And in my debug.log it’s just this over and over again:

    --

    [05-Jan-2023 10:21:40 UTC] PHP Deprecated:  Function WPGraphQL\Connection\TermObjects::get_connection_args is <strong>deprecated</strong> since version 1.13.0! Use \WPGraphQL\Type\Connection\TermObjects::get_connection_args instead. in /var/www/html/wp-includes/functions.php on line 5379
    
    
    [05-Jan-2023 10:21:40 UTC] PHP Deprecated:  Function WPGraphQL\Connection\Comments::get_connection_config is <strong>deprecated</strong> since version 1.13.0! Use \WPGraphQL\Type\Connection\Comments::get_connection_config instead. in /var/www/html/wp-includes/functions.php on line 5379
    

    --

    If I deactivate wp-graphql-woocommerce the image is processed absolutely fine and creates the one mediaItem node that I have:

    MediaItems processed with wp-graphql-woocommerce disabled

    I need the woocommerce aspect of things though so this isn’t a solution. It just seems to happen whenever wp-graphql-woocommerce is activated.

    Any help with this would be hugely, hugely appreciated as I’ve been banging my head against a brick wall for a while now and I'm really starting to worry that this isn't going to work

    Additional context

    I have tried the following versions of wp-graphql / wp-graphql-woocommerce

    wp-graphql - v1.12.2, v1.12.3, v1.13.0, v1.13.4, v1.13.7

    wp-graphql-woocommerce - v12, v11.2, v10.7

    Node Versions - v16.11.1, v18.12.1

    I've tried with both Digital Ocean and AWS Lightsail servers - same outcome

    And it just never seems to process the mediaItems. The strangest thing is that this did work in September, however lately it just flatly refuses to process the images whilst wp-graphql-woocommerce is activated

    WPGraphQL Version

    1.13.7

    WordPress Version

    6.1.1

    PHP Version

    8+

    Additional enviornment details

    Gatsby wp-graphql-woocommerce (v12 master) wp-gatsby (v2.3.3) WooCommerce (7.2.2)

    Please confirm that you have searched existing issues in the repo.

    • [X] Yes

    Please confirm that you have disabled ALL plugins except for WPGraphQL.

    • [ ] Yes
    • [X] My issue is with compatibility with a specific WordPress plugin, and I have listed all my installed plugins (and version info) above.
    opened by Steppio 0
  • When specify orderBy: TERM_ID there is an error occurred with the cursor

    When specify orderBy: TERM_ID there is an error occurred with the cursor

    Description

    When querying list of categories with cursor pagination and order by, then, an error occurred in SQL.

    Steps to reproduce

    1. Setup a brand new WordPress website using LocalWP for example
    2. Install WPGraphQL plugin and activate it
    3. Add 20 sample categories
    4. Execute the following query in the GraphiQL IDE
      query GetCategories($first: Int, $after: String, $last: Int, $before: String) {
        categories(
          first: $first
          after: $after
          last: $last
          before: $before
          where: {order: DESC, orderby: TERM_ID}
        ) {
          pageInfo {
            hasPreviousPage
            hasNextPage
            startCursor
            endCursor
          }
          nodes {
            slug
            databaseId
          }
        }
      }
      {
        "first": 5,
        "after": "YXJyYXljb25uZWN0aW9uOjE0",
        "last": null,
        "before": null
      }
      

    Additional context

    Error Log

    [22-Dec-2022 12:41:34 UTC] WordPress database error Column 'term_id' in where clause is ambiguous for query 
    			SELECT  t.term_id
    			FROM wp_terms AS t  INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id
    			WHERE tt.taxonomy IN ('category') AND  term_id >= "14" AND ( term_id > "14" OR (  t.term_id < 14 ) ) 
    			ORDER BY t.term_id DESC
    			 LIMIT 0, 6
    		 made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, WPGraphQL\Router::resolve_http_request, WPGraphQL\Router::process_http_request, WPGraphQL\Request->execute_http, GraphQL\Server\StandardServer->executeRequest, GraphQL\Server\Helper->executeOperation, GraphQL\Server\Helper->promiseToExecuteOperation, GraphQL\GraphQL::promiseToExecute, GraphQL\Executor\Executor::promiseToExecute, GraphQL\Executor\ReferenceExecutor->doExecute, GraphQL\Executor\ReferenceExecutor->executeOperation, GraphQL\Executor\ReferenceExecutor->executeFields, GraphQL\Executor\ReferenceExecutor->resolveField, GraphQL\Executor\ReferenceExecutor->resolveFieldValueOrError, WPGraphQL\Utils\InstrumentSchema::WPGraphQL\Utils\{closure}, WPGraphQL\Type\WPConnectionType->WPGraphQL\Type\{closure}, WPGraphQL\Type\Connection\TermObjects::WPGraphQL\Type\Connection\{closure}, WPGraphQL\Data\DataSource::resolve_term_objects_connection, WPGraphQL\Data\Connection\AbstractConnectionResolver->get_connection, WPGraphQL\Data\Connection\AbstractConnectionResolver->execute_and_get_ids, WPGraphQL\Data\Connection\TermObjectConnectionResolver->get_query, WP_Term_Query->__construct, WP_Term_Query->query, WP_Term_Query->get_terms
    

    Screenshots

    image

    WPGraphQL Version

    1.13.7

    WordPress Version

    6.1.1

    PHP Version

    8.1.9

    Additional enviornment details

    No response

    Please confirm that you have searched existing issues in the repo.

    • [X] Yes

    Please confirm that you have disabled ALL plugins except for WPGraphQL.

    • [X] Yes
    • [ ] My issue is with compatibility with a specific WordPress plugin, and I have listed all my installed plugins (and version info) above.
    opened by mohjak 0
  • feat: Refactor NodeResolver::resolve_uri() to use WP_Query

    feat: Refactor NodeResolver::resolve_uri() to use WP_Query

    What does this implement/fix? Explain your changes.

    This pr refactors NodeResolver::resolve_uri() to use WP_Query, instead of the current approach where we try to replicate the class logic locally.

    This brings the resolution process more in line with WP::main(), mitigating edge cases and reducing code complexity.

    In addition, it adds the following WP filters to the method:

    • graphql_resolve_uri_query_class . Used to swap out WP_Query with a specialized class, e.g. WC_Query from woo.
    • graphql_resolve_uri . Used to short-circuit resolve_uri() after the query has been run, but before our own attempts to resolve it to a WPGraphQL node, e.g. if we want a CPT to use a special dataloader.
    • graphql_post_resolve_uri. Used to provide a WPGraphQL node if resolve_uri() is unable to do so, e.g. a plugin-specific Edge case.

    Does this close any currently open issues?

    fixes #2178 fixes #2190 closes #1910 (possibly others)

    Part of #2366

    Any relevant logs, error output, GraphiQL screenshots, etc?

    (If it’s long, please paste to https://ghostbin.com/ and insert the link here.)

    Any other comments?

    • This PR includes #2659, which should be merged first.
    • Since we're no longer routing via our own conditionals, $extra_query_vars['nodeType'] and $extra_query_vars['taxonomy'] are now set in more places to let us validate the type we're receiving is compatible with the GraphQL type we resolve to.
    • I removed nodeByUri tests for when pretty permalinks are disabled for now. The reason is that parse_request() (from before this PR) marks those as a 404, which we were able to ignore when we were using our own logic before calling WP_Query, but no longer. I believe this is a quirk with Codeception, and not an issue with the code itself, and I am looking into workarounds to reinstate those tests.
    • Before merging, we should test with popular WPGraphQL Extensions, just in case they're doing something funky to work around the existing bugs.
    • While I dont expect there to be any performance hits (if anything, maybe a small perf improvement because WP_Query results are usually cached, and we're hitting it earlier in the lifecycle), but we should do some profiling to be 100% sure. This is beyond my skillset.
    • Date archives still resolve null, since without #2491 we have nowhere to resolve them to. We could put a graphql_debug() saying theyre not currently supported, and fallback to the ContentType, but there isnt precedent for that in the codebase.

    Where has this been tested?

    Operating System: Ubuntu 20.04 (wsl2 + devilbox + php8.0.19)

    WordPress Version: 6.1.1

    type: enhancement Architecture status: in progress 
    opened by justlevine 3
  • Overriding/subclassing the default object connection types

    Overriding/subclassing the default object connection types

    What problem does this address?

    Hi.

    I have a situation where we are using paginated queries, but need to apply complex access control logic.

    This section from PostObjectConnectionResolver illustrates the issue:

      /**
       * {@inheritDoc}
       */
      public function get_ids_from_query()
      {
        $ids = !empty($this->query->posts) ? $this->query->posts : [];
    
        // FIXME: this is where we should filter entries according to security rules
        foreach($ids as $id) {
    
        }
    
        // If we're going backwards, we need to reverse the array.
        if (!empty($this->args['last'])) {
          $ids = array_reverse($ids);
        }
    
        return $ids;
      }
    

    Existing filters let us either filter the WP_Query upstream (but our logic can't be expressed as a meta query), or the returned ids after cursors have been applied to them.

    Currently, the AbstractConnectionResolver applies cursors immediately to the output of the above function.

    What is your proposed solution?

    A filter after ids have been retrieved, but before cursors are applied to them.

    What alternatives have you considered?

    I have tried to override the PostObjectConnectionResolver:

    register_graphql_connection(
      [
        'fromType'       => 'RootQuery',
        'toType'         => ucfirst($post_type->graphql_single_name),
        'queryClass'     => 'WP_Query',
        'fromFieldName'  => $post_type->graphql_plural_name,
        'connectionArgs' => PostObjects::get_connection_args(),
        'resolve'        => function ($root, $args, $context, $info) use ($post_type) {
          $resolver = new \WPGraphQL\Data\Connection\CustomPostObjectConnectionResolver($root, $args, $context, $info, $post_type);
    
          return $resolver->get_connection();
        },
      ]
    );
    

    In:

    graphql_register_types
    

    But obviously, this results in a complaint about duplicate types.

    Is something like this possible currently?

    Additional Context

    No response

    type: question Component: Connections Component: Query Component: Pagination 
    opened by maurocolella 4
  • Timeout and Performance Issues with Media Items

    Timeout and Performance Issues with Media Items

    Description

    Hi, I reported some performance issues to the Gatsby team in the discussion here, and figured I'd report the same here. Since upgrading to WP-GraphQL 1.12, we've experienced very slow performance when sourcing images. I've tried a mix of solutions, including object caching and adjusting concurrency of requests, but the performance is the same each time, even when the data for our site is cached. Looknig at the logs, I thought that the Guttenberg/ACF plugins were to blame, but after upgrading and disabling those, the performance for the source images/media step remained the same.

    https://github.com/gatsbyjs/gatsby/discussions/37166

    Steps to reproduce

    Run Gatsby develop or build using the Gatsby Source Wordpress plugin with WPGraphl queries.

    Additional context

    No response

    WPGraphQL Version

    1.13

    WordPress Version

    v5.8.1

    PHP Version

    7.4.28

    Additional enviornment details

    No response

    Please confirm that you have searched existing issues in the repo.

    • [X] Yes

    Please confirm that you have disabled ALL plugins except for WPGraphQL.

    • [X] Yes
    • [ ] My issue is with compatibility with a specific WordPress plugin, and I have listed all my installed plugins (and version info) above.
    type: bug needs: info ObjectType: Media Gatsby scope: performance 
    opened by stevepepple 2
  • The featuredImage doesn't take the asPreview parameter into account.

    The featuredImage doesn't take the asPreview parameter into account.

    Description

    We are using the asPreview parameter on our project to enable users to preview changes they make to posts and pages.

    While the query itself is mostly correct, the featured image does not take the asPreview attribute into account and always displays the last published value instead of the draft one.

    Steps to reproduce

    1. Create a post, set a featured image and publish it
    2. Edit the post, change title and featured image
    3. Click the "Preview" button
    4. In the GraphiQL IDE paste the sample query below.

    The result has the updated title but the featured image (databaseID and src) are incorrect.

    Additional context

    Sample query

    {
      post(id: 116, idType: DATABASE_ID, asPreview: true) {
        title
        featuredImageDatabaseId
        featuredImage {
          node {
            id
            databaseId
            medium: sourceUrl(size: LARGE)
          }
        }
      }
    }
    

    Result

    "post": {
          "title": "Etiam imperdiet imperdiet orci?",
          "featuredImageDatabaseId": 73,
          "featuredImage": {
            "node": {
              "id": "cG9zdDo3Mw==",
              "databaseId": 73,
              "medium": "http://local.test/wp-content/uploads/2022/11/alexander-shatov-PHH_0uw9-Qw-unsplash-scaled.jpg"
            }
          }
        }
    

    Expected

    "post": {
          "title": "Etiam imperdiet imperdiet orci?",
          "featuredImageDatabaseId": 81,
          "featuredImage": {
            "node": {
              "id": "cG9zdDo4MQ==",
              "databaseId": 81,
              "medium": "http://local.test/wp-content/uploads/2022/11/mike-meyers-haAxbjiHds-unsplash-scaled.jpg"
            }
          }
        }
    

    WPGraphQL Version

    1.13.6

    WordPress Version

    6.1.1

    PHP Version

    8.0

    Additional enviornment details

    No response

    Please confirm that you have searched existing issues in the repo.

    • [X] Yes

    Please confirm that you have disabled ALL plugins except for WPGraphQL.

    • [X] Yes
    • [ ] My issue is with compatibility with a specific WordPress plugin, and I have listed all my installed plugins (and version info) above.
    opened by idflood 0
Releases(v1.13.7)
  • v1.13.7(Dec 9, 2022)

    Release Notes

    Chores / Bugfixes

    • (#2661): chore(deps): bump simple-git from 3.10.0 to 3.15.1
    • (#2665): chore(deps): bump decode-uri-component from 0.2.0 to 0.2.2
    • (#2668): test: Multiple domain tests. Thanks @markkelnar!
    • (#2669): ci: Use last working version of xdebug for php7. Thanks @markkelnar!
    • (#2671): fix: correct regressions to field formatting forcing snake_cace and UcFirst fields to be lcfirst/camelCase
    • (#2672): chore: update lint-pr workflow

    Full Changelog: https://github.com/wp-graphql/wp-graphql/compare/v1.13.6...v1.13.7

    Source code(tar.gz)
    Source code(zip)
    schema.graphql(322.29 KB)
    wp-graphql.zip(2.96 MB)
  • v1.13.6(Dec 7, 2022)

    Release Notes

    New Features

    • (#2657): feat: pass unfiltered args through to filters in the ConnectionResolver classes. Thanks @kidunot89!
    • (#2655): feat: add includeDefaultInterfaces to connection config, allowing connections to be registered without the default Connection and Edge interfaces applied.. Thanks @justlevine!

    Chores / Bugfixes

    • (#2656): chore: clean up NodeResolver::resolve_uri() logic. Thanks @justlevine!

    Full Changelog: https://github.com/wp-graphql/wp-graphql/compare/v1.13.5...v1.13.6

    Source code(tar.gz)
    Source code(zip)
    schema.graphql(322.29 KB)
    wp-graphql.zip(2.96 MB)
  • v1.13.5(Dec 2, 2022)

  • v1.13.4(Nov 29, 2022)

    Release Notes

    Chores / Bugfixes

    • (#2631): simplify (DRY up) connection interface registration.
    • (#2627): fix: removed connection classes as deprecated wrappers (regression). Thanks @justlevine!

    NOTE: (#2627) was supposed to have been released in 1.13.2, and is listed in the changelog for that version, but I botched that release and only released the changelog without the actual changes 🤦🏻‍♂️

    Full Changelog: https://github.com/wp-graphql/wp-graphql/compare/v1.13.3...v1.13.4

    Source code(tar.gz)
    Source code(zip)
    schema.graphql(321.98 KB)
    wp-graphql.zip(2.96 MB)
  • v1.13.3(Nov 29, 2022)

  • v1.13.1(Nov 28, 2022)

  • v1.13.0(Nov 28, 2022)

    Release Notes

    Possible Breaking Change for some users

    The work to introduce the Connection and Edge (and other) Interfaces required the User.revisions and RootQuery.revisions connection to change from resolving to the ContentRevisionUnion type and instead resolve to the ContentNode type.

    We believe that it's highly likely that most users will not be impacted by this change.

    Any queries that directly reference the following types:

    • ...on UserToContentRevisionUnionConnection
    • ...on RootQueryToContentRevisionUnionConnection

    Would need to be updated to reference these types instead:

    • ...on UserToRevisionsConnection
    • ...on RootQueryToRevisionsConnection

    For example:

    BEFORE

    {
      viewer {
        revisions {
          ... on UserToContentRevisionUnionConnection {
            nodes {
              __typename
              ... on Post {
                id
                uri
                isRevision
              }
              ... on Page {
                id
                uri
                isRevision
              }
            }
          }
        }
      }
      revisions {
        ... on RootQueryToContentRevisionUnionConnection {
          nodes {
            __typename
            ... on Post {
              id
              uri
              isRevision
            }
            ... on Page {
              id
              uri
              isRevision
            }
          }
        }
      }
    }
    

    AFTER

    {
      viewer {
        revisions {
          ... on UserToRevisionsConnection {
            nodes {
              __typename
              ... on Post {
                id
                uri
                isRevision
              }
              ... on Page {
                id
                uri
                isRevision
              }
            }
          }
        }
      }
      revisions {
        ... on RootQueryToRevisionsConnection {
          nodes {
            __typename
            ... on Post {
              id
              uri
              isRevision
            }
            ... on Page {
              id
              uri
              isRevision
            }
          }
        }
      }
    }
    

    New Features

    • (#2617: feat: Introduce Connection, Edge and other common Interfaces.
    • (#2563: feat: refactor mutation registration to use new WPMutationType. Thanks @justlevine!
    • (#2557: feat: add deregister_graphql_type() access function and corresponding graphql_excluded_types filter. Thanks @justlevine!
    • (#2546: feat: Add new register_graphql_edge_fields() and register_graphql_connection_where_args() access functions. Thanks @justlevine!

    Chores / Bugfixes

    • (#2622: fix: deprecate the previews field for non-publicly queryable post types, and limit the Previewable Interface to publicly queryable post types.
    • (#2614: chore(deps): bump loader-utils from 2.0.3 to 2.0.4.
    • (#2540: fix: deprecate Comment.approved field in favor of Comment.status: CommentStatusEnum. Thanks @justlevine!
    • (#2542: Move parse_request logic in NodeResolver::resolve_uri() to its own method. Thanks @justlevine!

    Full Changelog

    https://github.com/wp-graphql/wp-graphql/compare/v1.12.3...v1.13.0

    Source code(tar.gz)
    Source code(zip)
    schema.graphql(313.73 KB)
    wp-graphql.zip(2.96 MB)
  • v1.12.3(Nov 18, 2022)

  • v1.12.2(Nov 10, 2022)

    Release Notes

    New Features:

    • (#2541): feat: Obfuscate SendPasswordResetEmail response. Thanks @justlevine!

    Chores / Bugfixes

    • (#2544): chore: log and cleanup deprecations. Thanks @justlevine!
    • (#2605): chore: bump tested version of WordPress to 6.1. Thanks @justlevine!
    • (#2606): fix: update resolver in post->author connection to be more strict about the value of the author ID
    • (#2609): chore(deps): bump loader-utils from 2.0.2 to 2.0.3

    Full Changelog: https://github.com/wp-graphql/wp-graphql/compare/v1.12.1...v1.12.2

    Source code(tar.gz)
    Source code(zip)
    schema.graphql(294.85 KB)
    wp-graphql.zip(2.95 MB)
  • v1.12.1(Nov 3, 2022)

    What's Changed

    • chore: Prepare docs for new site by @moonmeister in https://github.com/wp-graphql/wp-graphql/pull/2583
    • Docs/new site by @moonmeister in https://github.com/wp-graphql/wp-graphql/pull/2591
    • fix: Add list of node types as X-GraphQL-Keys instead of list of edge types by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2590
    • feat: use sha256 instead of md5 for hashing the queryId by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2593
    • docs: fix contributing doc render errors by @moonmeister in https://github.com/wp-graphql/wp-graphql/pull/2600
    • fix: Only use Appsero add_plugin_data if the Appsero Client is v1.2.1 or higher by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2599
    • feat: support deprecation reason on connections by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2581
    • fix(noderesolver): adding extra_query_vars in graphql_pre_resolve_uri… by @yanmorinokamca in https://github.com/wp-graphql/wp-graphql/pull/2582
    • feat: Add operation name to X-GraphQL-Keys by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2603
    • release: v1.12.1 by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2604

    New Contributors

    • @yanmorinokamca made their first contribution in https://github.com/wp-graphql/wp-graphql/pull/2582

    Full Changelog: https://github.com/wp-graphql/wp-graphql/compare/v1.12.0...v1.12.1

    Source code(tar.gz)
    Source code(zip)
    schema.graphql(294.64 KB)
    wp-graphql.zip(2.95 MB)
  • v1.12.0(Oct 10, 2022)

    Release Notes

    Upgrading

    This release removes the ContentNode and DatabaseIdentifier interfaces from the NodeWithFeaturedImage Interface.

    This is considered a breaking change for client applications using a ...on NodeWithFeaturedImage fragment that reference fields applied by those interfaces. If you have client applications doing this (or are unsure if you do) you can use the following filter to bring back the previous behavior:

    add_filter( 'graphql_wp_interface_type_config', function( $config ) {
    	if ( $config['name'] === 'NodeWithFeaturedImage' ) {
    		$config['interfaces'][] = 'ContentNode';
    		$config['interfaces'][] = 'DatabaseIdentifier';
    	}
    	return $config;
    }, 10, 1 );
    

    New Schema Customization APIs

    WPGraphQL simplifies adding Custom Post Types and Taxonomies to the WPGraphQL Schema.

    In this release, there are new options that allow for greater customization into how Post Types and Taxonomies interact with the WPGraphQL Schema.

    We've written 2 blog posts about this:

    What's Changed

    • feat: add X-GraphQL-URL to headers of GraphQL Responses by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2565
    • feat: schema customization with post type args by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2399
    • docs: Correct typo by @altearius in https://github.com/wp-graphql/wp-graphql/pull/2568
    • chore: update Appsero SDK to 1.2.1 by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2569
    • chore(deps): bump got and @wordpress/env by @dependabot in https://github.com/wp-graphql/wp-graphql/pull/2571
    • fix: GraphiQL Query Composer update to FieldView for union type by @chrisherold in https://github.com/wp-graphql/wp-graphql/pull/2572
    • chore: use ENV variables for installing WordPress test environment by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2556
    • chore: update phpstan and fix surfaced issues by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2538
    • chore: add WPBrowser v3.1.x compatibility by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2545
    • fix: (phpstan) check if wp_parse_url() returns array by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2573
    • chore: cleanup and update version tags by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2574
    • release: v1.12.0 by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2566

    New Contributors

    • @altearius made their first contribution in https://github.com/wp-graphql/wp-graphql/pull/2568
    • @chrisherold made their first contribution in https://github.com/wp-graphql/wp-graphql/pull/2572

    Full Changelog: https://github.com/wp-graphql/wp-graphql/compare/v1.11.3...v1.12.0

    Source code(tar.gz)
    Source code(zip)
    schema.graphql(294.96 KB)
    wp-graphql.zip(2.91 MB)
  • v1.11.3(Oct 5, 2022)

  • v1.11.2(Sep 28, 2022)

  • v1.11.1(Sep 21, 2022)

  • v1.11.0(Sep 20, 2022)

    What's Changed

    • feat: Add QueryAnalyzer and Expose "X-GraphQL-Keys" in headers by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2519
    • chore: refactor AbstractConnectionResolver::$args handling by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2521
    • feat: allow global/database IDs in Comment connection where args ID inputs by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2522
    • feat: allow global/database IDs in MenuItem connection where args ID inputs by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2523
    • feat: allow global/database IDs in Term connection where args ID inputs by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2524
    • feat: allow global/database IDs in Post connection where args ID inputs by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2525
    • fix: ensure responses in QueryAnalyzer are unique by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2526
    • release: v1.11.0 by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2527

    Full Changelog: https://github.com/wp-graphql/wp-graphql/compare/v1.10.0...v1.11.0

    Source code(tar.gz)
    Source code(zip)
    schema.graphql(297.79 KB)
    wp-graphql.zip(2.91 MB)
  • v1.10.0(Sep 8, 2022)

    Release Notes

    Upgrade Notice

    PR (#2490) fixes a bug that some users were using as a feature.

    When a page is marked as the "Posts Page" WordPress does not resolve that page by URI, and this bugfix no longer will resolve that page by URI.

    Here, you can read more about why this change was made and find a snippet of code that will bring the old functionality back if you've built features around it.

    New Features

    • (#2503): Enable codeception debugging via Github Actions. Thanks @justlevine!
    • (#2502): Add idType arg to RootQuery.comment. Thanks @justlevine!
    • (#2505): Return user after resetUserPassword mutation. Thanks @justlevine!

    Chores / Bugfixes

    • (#2482): Add PHP Code Sniffer support for the WordPress.com VIP GO standard. Thanks @renatonascalves!
    • (#2490): Fix bug related to querying the page set as "Posts Page"
    • (#2497): Only enqueue admin scripts on the settings page. Thanks @justlevine!
    • (#2498): Add include and exclude args to MediaDetails.sizes. Thanks @justlevine!
    • (#2499): Check for multiple theme capabilities in the Theme Model. Thanks @justlevine!
    • (#2504): Filter mediaItems query by mimeType. Thanks @justlevine!
    • (#2506): Update descriptions for input fields that accept a databaseId. Thanks @justlevine!

    New Contributors

    • @NielsdeBlaauw made their first contribution in https://github.com/wp-graphql/wp-graphql/pull/2511

    Full Changelog: https://github.com/wp-graphql/wp-graphql/compare/v1.9.1...v1.10.0

    Source code(tar.gz)
    Source code(zip)
    schema.graphql(296.88 KB)
    wp-graphql.zip(2.90 MB)
  • v1.9.1(Aug 17, 2022)

    What's Changed

    • fix: return CommentAuthor avatar urls to unauthenticated users by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2472
    • fix: make GraphiQL user switch accessible by @nickcernis in https://github.com/wp-graphql/wp-graphql/pull/2473
    • fix(graphiql): graphiql fails if variables are invalid json by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2477
    • feat: PHPCS: enhancements to the Coding Standards Setup by @renatonascalves in https://github.com/wp-graphql/wp-graphql/pull/2471
    • release: v1.9.1 by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2478

    New Contributors

    • @nickcernis made their first contribution in https://github.com/wp-graphql/wp-graphql/pull/2473

    Full Changelog: https://github.com/wp-graphql/wp-graphql/compare/v1.9.0...v1.9.1

    Source code(tar.gz)
    Source code(zip)
    schema.graphql(296.08 KB)
    wp-graphql.zip(2.90 MB)
  • v1.9.0(Aug 9, 2022)

    Release Notes

    Upgrading

    There are 2 changes that might require action when updating to 1.9.0

    1. (#2464)

    When querying for a nodeByUri, if your site has the "page_for_posts" setting configured, the behavior of the nodeByUri query for that uri might be different for you.

    Previously a bug caused this query to return a "Page" type, when it should have returned a "ContentType" Type.

    The bug fix might change your application if you were using the bug as a feature.

    2. (#2457)

    There were a lot of bug fixes related to connections to ensure they behave as intended. If you were querying lists of data, in some cases the data might be returned in a different order than it was before.

    For example, using the "last" input on a Comment or User query should still return the same nodes, but in a different order than before.

    This might cause behavior you don't want in your application because you had coded around the bug. This change was needed to support proper backward pagination.

    Chores / Bugfixes

    • (#2450): Fix PHPCompatibility lint config. Thanks @justlevine!
    • (#2452): Fixes a bug with Comment.author connections not properly resolving for public (non-authenticated) requests.
    • (#2453): Update Github Workflows to use PHP 7.3. Thanks @justlevine!
    • (#2454): Add linter to ensure Pull Requests use "Conventional Commit" standards.
    • (#2455): Refactors and Lints the WPUnit tests. Cleans up some "leaky" data in test suites. Thanks @justlevine!
    • (#2457): Refactor Connection Resolvers to better adhere to Relay Connection spec. This fixes several bugs related to pagination across connections, specifically User and Comment connections which didn't properly support backward pagination at all. Thanks @justlevine!
    • (#2460): Update documentation for running tests with Docker. Thanks @markkelnar!
    • (#2463): Add Issue templates to the repo. Thanks @justlevine!
    • (#2464): Fixes node resolver when "page_for_posts" setting is set to a page.

    If you were affected by #2464, here's a snippet that can help bring back previous behavior:

    add_filter( 'graphql_pre_resolve_uri', function( $null, $uri, $context, $wp ) {
    
    	$page_for_posts = get_option( 'page_for_posts', 0 );
    
    	if ( empty( $page_for_posts ) ) {
    		return $null;
    	}
    
    	$permalink = get_permalink( (int) $page_for_posts );
    
    	if ( empty( $permalink ) || is_wp_error( $permalink ) ) {
    		return $null;
    	}
    
    	$parsed_permalink = wp_parse_url( $permalink );
    	$parsed_uri = wp_parse_url( $uri );
    
    	if ( ! isset( $parsed_permalink['path'] ) || ! isset( $parsed_uri['path'] )) {
    		return $null;
    	}
    
    	$trimmed_uri_path = rtrim( ltrim( $parsed_uri['path'], '/' ), '/' );
    	$trimmed_permalink_path = rtrim( ltrim( $parsed_permalink['path'], '/' ), '/' );
    
    	if ( $trimmed_permalink_path === $trimmed_uri_path ) {
    		return new \WPGraphQL\Model\Post( get_post( (int) $page_for_posts ) );
    	}
    
    	return $null;
    
    }, 10, 4 );
    

    You can read more about this here: https://github.com/wp-graphql/wp-graphql/issues/2486#issuecomment-1232169375

    Source code(tar.gz)
    Source code(zip)
    schema.graphql(296.08 KB)
    wp-graphql.zip(2.90 MB)
  • v1.8.7(Jul 21, 2022)

    Release Notes

    Chores / Bugfixes

    • (#2441): Fix contentNodes field not showing if a taxonomy is registered without connected post types. Thanks @saimonh3!
    • (#2446): Update "terser" from 5.11.0 to 5.14.2 (GraphiQL Dependency)
    • (#2440): Update JS dependencies for GraphiQL

    New Features

    • (#2435): Add filter in execute for query string. Thanks @markkelnar!
    • (#2432): Add query_id to after_execute_actions for batch requests. Thanks @markkelnar!

    New Contributors

    • @saimonh3 made their first contribution in https://github.com/wp-graphql/wp-graphql/pull/2442

    Full Changelog: https://github.com/wp-graphql/wp-graphql/compare/v1.8.6...v1.8.7

    Source code(tar.gz)
    Source code(zip)
    schema.graphql(296.08 KB)
    wp-graphql.zip(2.89 MB)
  • v1.8.6(Jun 24, 2022)

  • v1.8.5(Jun 24, 2022)

  • v1.8.4(Jun 23, 2022)

  • v1.8.3(Jun 23, 2022)

    New Features

    • (#2388): Adds ability to query menus by SLUG and LOCATION. Thanks @justlevine!

    Chores / Bugfixes

    • (#2412): Update tests to run in PHP 8, 8.1 and with WordPress 6.0. Updates Docker Deploy workflow as well.
    • (#2411): Fixes bug where menuItems "location" arg was conflicting if a taxonomy is also registered with "location" as its name.
    • (#2410): Fixes a regression with Taxonomy Connection pagination.
    • (#2406): Updates PHPUnit, WPBrowser and WPGraphQL Test Case for use in workflows. Thanks @justlevine!
    • (#2387): Fixes a bug with asset versions when querying for Enqueued Scripts and Styles. Thanks @justlevine!
    Source code(tar.gz)
    Source code(zip)
    wp-graphql.zip(2.95 MB)
  • v1.8.2(May 17, 2022)

    What's Changed

    • feat: allow global/db ids in comment mutation ID inputs by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2328
    • feat: allow global/db ids in mediaItem mutation ID inputs by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2331
    • Feat/term object mutation id inputs by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2336
    • Bugfix/#2367 fix schema linter workflow by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2368
    • Chore: replace codecov badge with coveralls by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2369
    • Feature/#2275 multisite tests by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2375
    • chore: update PostObjectFieldFormatEnum value descriptions by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2374
    • Bug/#2371 auth callback should work for mutations by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2376
    • (bugfix): #2381 register field to setting group not working by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2382
    • (bugfix): #2377 - fixes bug where Wp class wasn't being properly passed as reference to parse_request filter by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2380
    • Bugfix/#2378 fix slashes in term mutations by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2379
    • Add relative uri to MenuItem by @josephfusco in https://github.com/wp-graphql/wp-graphql/pull/2363
    • Feat/post object mutation id inputs by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2338
    • Feat/user object mutation id inputs by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2337
    • Release/v1.8.2 by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2383

    New Contributors

    • @josephfusco made their first contribution in https://github.com/wp-graphql/wp-graphql/pull/2363

    Full Changelog: https://github.com/wp-graphql/wp-graphql/compare/v1.8.1...v1.8.2

    Source code(tar.gz)
    Source code(zip)
    schema.graphql(295.17 KB)
    wp-graphql.zip(2.95 MB)
  • v1.8.1(May 3, 2022)

    What's Changed

    • "select" and "option" added to allowed HTML for settings. by @eavonius in https://github.com/wp-graphql/wp-graphql/pull/2349
    • Fixes bug with Comment Authors not always returning by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2350
    • Amendment to #2349 to add "selected" attribute to allowed HTML. by @eavonius in https://github.com/wp-graphql/wp-graphql/pull/2351
    • Feat: Refactor get_allowed_post_types() and get_allowed_taxonomies() by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2353
    • (bugfix): Fix console warnings in WPGraphiQL related to missing keys by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2354
    • chore: refactor codebase using WPGraphQL::get_allowed_{type}( 'objects ') by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2356
    • build(deps): bump moment from 2.29.1 to 2.29.3 by @dependabot in https://github.com/wp-graphql/wp-graphql/pull/2357
    • build(deps): bump async from 2.6.3 to 2.6.4 by @dependabot in https://github.com/wp-graphql/wp-graphql/pull/2358
    • Release/v1.8.1 by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2359

    New Contributors

    • @eavonius made their first contribution in https://github.com/wp-graphql/wp-graphql/pull/2349

    Full Changelog: https://github.com/wp-graphql/wp-graphql/compare/v1.8.0...v1.8.1

    Source code(tar.gz)
    Source code(zip)
    schema.graphql(295.09 KB)
    wp-graphql.zip(2.95 MB)
  • v1.8.0(Apr 7, 2022)

    What's Changed

    • Remove old GraphiQL JavaScript by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2286
    • Register post/page templates with get_page_templates() by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2296
    • fix: menus should return empty when location doesn't have a menu assigned. by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2295
    • fix: MediaItemUpdate mutation comparing string author ID with number returned from get_current_user_id by @abaicus in https://github.com/wp-graphql/wp-graphql/pull/2299
    • Bump node-forge from 1.2.1 to 1.3.0 by @dependabot in https://github.com/wp-graphql/wp-graphql/pull/2310
      • update composer dependencies by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2317
    • chore: add allow-plugins to composer.json config by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2291
    • fix: refactor AbstractConnectionResolver::get_nodes() to prevent children double slicing by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2294
    • feat: add Utils::get_database_id_from_id() for DRY handling of ID types. by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2322
    • Fix: Connections missing nodes when before or after are empty. by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2293
    • Fix: Use comment author when admin are creating/updating a different users comment. by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2323
    • Fix: comment connection filtering by commentType by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2320
    • feat: change min permissions for Plugins from update to activate by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2327
    • fix: pass WP_Comment object to comment_text filter by @justlevine in https://github.com/wp-graphql/wp-graphql/pull/2319
    • feat: add where args to plugin connections by @justlevine (expanded on the original work from @t0lya) in https://github.com/wp-graphql/wp-graphql/pull/2298
    • Bug/#2282 version graphiql with releases by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2332

    New Contributors

    • @abaicus made their first contribution in https://github.com/wp-graphql/wp-graphql/pull/2299

    Full Changelog: https://github.com/wp-graphql/wp-graphql/compare/v1.7.2...v1.8.0

    Source code(tar.gz)
    Source code(zip)
    schema.graphql(295.09 KB)
    wp-graphql.zip(3.10 MB)
  • v1.7.2(Mar 8, 2022)

    What's Changed

    • #2274 - fix bug with the generalSettings.url field being removed by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2276
    • Add composer post-install script by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2278
    • For repos that extend the docker testing image and dont have a package.json by @markkelnar in https://github.com/wp-graphql/wp-graphql/pull/2277
    • Release/v1.7.2 by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2279

    Full Changelog: https://github.com/wp-graphql/wp-graphql/compare/v1.7.1...v1.7.2

    Source code(tar.gz)
    Source code(zip)
    schema.graphql(294.20 KB)
    wp-graphql.zip(7.71 MB)
  • v1.7.1(Mar 4, 2022)

  • v1.7.0(Mar 3, 2022)

    Release Notes

    Brand. New. WPGraphiQL IDE.

    This release includes a re-write of the WPGraphiQL IDE.

    Updated UI

    CleanShot 2022-03-03 at 13 41 44

    Extension APIs

    Not only is the UI updated, but the codebase has been re-written completely to allow for 3rd party plugins to hook/filter the functionality and extend it.

    You can now write GraphiQL extensions that interact with the GraphiQL IDE, and have access to the same React Context / State as the rest of the app.

    This sets the stage for tools like WPGraphQL for WooCommerce, WPGraphQL for ACF and Atlas Content Modeler to provide custom tools that enhance their users experience of using the GraphiQL IDE.

    Authentication Switch

    In addition to the updated UI and extension-friendly architecture, WPGraphiQL now includes one of the most requested features for the tool: a button that lets you toggle between executing requests as a public (non-authenticated) user and an authenticated user (who you're logged in to the WordPress dashboard as).

    Chores / Bugfixes

    • (#2228): Allows optional fields to be set to empty values in the updateUser mutation. Thanks @victormattosvm!
    • (#2247): Add WordPress 5.9 to the automated testing matrix. Thanks @markkelnar!
    • (#2242): Adds End 2 End tests to test GraphiQL functionality in the admin.
    • (#2261): Fixes a bug where the pageByUri query might return incorrect data when custom permalinks are set. Thanks @blakewilson!
    • (#2263): Adds documentation entry for WordPress Application Passwords guide. Thanks @abhisekmazumdar!
    • (#2262): Fixes a bug where settings registered via the core register_setting() API would cause Schema Introspection failures, causing GraphiQL and other tools to not work properly.

    New Features

    • (#2248): WPGraphiQL (the GraphiQL IDE in the WordPress dashboard) has been re-built to have an extension architecture and some updated user interfaces. Thanks for contributing to this effort @scottyzen!
    • (#2246): Adds support for querying the avatar for the CommentAuthor Type and the Commenter Interface type.
    • (#2236): Introduces new graphql_model_prepare_fields filter and deprecates graphql_return_modeled_data filter. Thanks @justlevine!
    • (#2265): Adds opt-in telemetry tracking via Appsero, to allow us to collect helpful information for prioritizing future feature work, etc.
    Source code(tar.gz)
    Source code(zip)
    wp-graphql.zip(7.71 MB)
  • v1.6.12(Jan 20, 2022)

    What's Changed

    • Add WP 5.8 to the matrix of docker images built by @markkelnar in https://github.com/wp-graphql/wp-graphql/pull/2209
    • FIX: #2214 - Fix test enviromnent to play nice with wp-browser update by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2215
    • Add a note to the GraphQL Introspection setting when Debug mode is enabled by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2218
    • fix: TermObject uri strips host:port path instead of home_url() by @theodesp in https://github.com/wp-graphql/wp-graphql/pull/2212
    • Add JavaScript code analysis workflow by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2220
    • Bump follow-redirects from 1.14.4 to 1.14.7 in /src/Admin/GraphiQL/app by @dependabot in https://github.com/wp-graphql/wp-graphql/pull/2216
    • Bump markdown-it from 12.2.0 to 12.3.2 in /src/Admin/GraphiQL/app by @dependabot in https://github.com/wp-graphql/wp-graphql/pull/2211
    • Update NPM dependencies to satisfy dependabot alerts by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2221
    • Further dependabot alert updates by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2223
    • Release/v1.6.12 by @jasonbahl in https://github.com/wp-graphql/wp-graphql/pull/2225

    New Contributors

    • @theodesp made their first contribution in https://github.com/wp-graphql/wp-graphql/pull/2212

    Full Changelog: https://github.com/wp-graphql/wp-graphql/compare/v1.6.11...v1.6.12

    Source code(tar.gz)
    Source code(zip)
    wp-graphql.zip(3.24 MB)
Owner
WPGraphQL
An Open Source WordPress plugin that enables a GraphQL API for WordPress sites
WPGraphQL
GraphQL API for interacting with Gravity Forms.

?? ?? WPGraphQL for Gravity Forms A WordPress plugin that provides a GraphQL API for interacting with Gravity Forms. Join the WPGraphQL community on S

Harness Software 135 Jan 2, 2023
A PHP client for Wordpress websites that closely implement the XML-RPC WordPress API

Wordpress XML-RPC PHP Client A PHP client for Wordpress websites that closely implement the XML-RPC WordPress API Created by Hieu Le MIT licensed. Cur

Hieu Le 112 Nov 10, 2022
Makes WP GraphQL's authetication "just work". It does this by customizing the CORS headers.

WP GraphQL CORS The primary purpose of this plugin is to make the WP GraphQL plugin authentication "just work". It does this by allowing you set the C

Funkhaus 86 Jan 5, 2023
Query gutenberg blocks with wp-graphql

WPGraphQL Gutenberg Query gutenberg blocks through wp-graphql Usage Docs Join our community through WpGraphQL Slack Install Requires PHP 7.0+ Requires

null 270 Jan 3, 2023
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
Adds meta data registered via register_meta() to the GraphQL output.

WP GraphQL Meta This plugin is an add-on for the awesome WP GraphQL It builds on top of both WP GraphQL and the REST API. Any meta data you register u

Robert O'Rourke 18 Aug 4, 2021
Offset pagination for WP GraphQL

WP GraphQL Offset Pagination This is an extension for the WPGraphQL plugin for WordPress. It adds basic offset pagination as opposed to the standard C

Daryll Doyle 13 Sep 19, 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
Bringing the power of GraphQL to BuddyPress.

WPGraphQL BuddyPress Bringing the power of GraphQL to BuddyPress. Docs (soon) • Join Slack System Requirements PHP >= 7.1 WP >= 4.9 WPGraphQL >= lates

WPGraphQL 31 Jan 2, 2023
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 curated list of Awesome WordPress Theme, Plugins and Framework development Resources and WordPress Communities.

Awesome WordPress A curated list of Awesome WordPress Theme, Plugins and Framework development Resources and WordPress Communities. Inspired by bayand

Dropndot Limited 91 Dec 26, 2022
The Pronamic WordPress Basecone plugin allows you to connect your WordPress installation to Basecone.

Pronamic WordPress Basecone The Pronamic WordPress Basecone plugin allows you to connect your WordPress installation to Basecone. Table of contents Au

Pronamic 1 Oct 19, 2021
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
Twenty Twenty-Two, the default WordPress theme that will launch with WordPress 5.9.

Twenty Twenty-Two Welcome to the development repository for the default theme that will launch with WordPress 5.9. About Twenty Twenty-Two is designed

null 414 Nov 28, 2022
Easy handle APlayer on WordPress. A shortcode for WordPress to using APlayer.

Description Easy handle APlayer on WordPress. A shortcode for WordPress to using APlayer. Support [audio] tag, compatible with AMP. Requirement WordPr

Karl Chen 24 Nov 3, 2022
WordPress plugin that lets you use Discourse as the community engine for a WordPress blog

WP Discourse Note: the wp-discourse plugin requires >= PHP-5.4.0. The WP Discourse plugin acts as an interface between your WordPress site and your Di

Discourse 497 Dec 10, 2022
WordPress & TypeScript. Simple starter template for WordPress projects

WordPress & TypeScript. Simple starter template for WordPress projects that want to use TypeScript in combination with @wordpress/scripts

Make it WorkPress 11 Sep 27, 2022
Simple WordPress plugin to learn how to understand WordPress Crons and the Action Scheduler library.

Simple WordPress plugin to learn how to understand WordPress Crons and the Action Scheduler library. Import Jamendo playlists with tracks in WordPress posts.

Pierre Saikali 3 Dec 7, 2022
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