wp-graphql

GraphQL API for WordPress

GPL-3.0 License

Downloads
304.7K
Stars
3.6K
Committers
154

Bot releases are hidden (Show)

wp-graphql - v0.2.3

Published by jasonbahl over 5 years ago

🚀 Release Notes

Breaking Changes

  • none

New Features

  • #676: New TimezoneEnum type added to the Schema
  • #719: New graphql_menu_item_connection_args and graphql_menu_item_connection_query_args filters added to the MenuItemConnectionResolver. Thanks @epeli!

Bug Fixes

  • #714 Fixes global $post not properly being setup before resolving fields for posts. Thanks @epeli!
  • #716: Adjusts how the MenuLocationEnum values are determined to include all locations, not just locations with a menu already assigned.
wp-graphql - v0.2.2

Published by jasonbahl over 5 years ago

🚀 Release Notes:

Bug Fixes

  • fixes bug with batch queries introduced in v0.2.1
  • fixes a bug with the graphql_request_data filter causing issues in GET requests. Thanks @epeli!
  • fixes a bug with root queries for individual post objects of custom post type. Thanks @mwidmann!

New Features

  • add .gitattributes definitions to exlude files for output to packagist. Thanks @mikelking!
  • add support for categoryNotIn and tagNotIn in PostObjectConnection queries. Thanks @craigmcnamara!
  • adds Access-Control-Max-Age to the response headers to cache preflight options requests. Thanks @chriszarate!
  • adds new argument to the sourceUrl on the MediaItem Type to allow for a specific size to be selected. Thanks @hsimah!

Updates

  • updates to Docker environment for running automated tests. Thanks @mngi-arogers!
  • updates to connection registry to make config methods public. Thanks @hsimah!
  • adds test for children terms. Thanks @iimez!
wp-graphql - v0.2.1

Published by jasonbahl over 5 years ago

🚀 RELEASE: v0.2.1

Release Notes:

  • Update GraphQL-PHP from v0.11.2 to v0.12.6
  • Update composer.json, composer.lock and other composer files to reflect changes

Bugfix

  • fix php warnings being thrown by after_execute_actions in the Request.php class
wp-graphql - v0.2.0

Published by jasonbahl almost 6 years ago

🚀 RELEASE: v0.2.0

Breaking Changes

  • the filter graphql_request_results can return data in a different shape than previously returned. If making use of this filter, verify it's working as expected or make appropriate changes for your use case.
  • the do_graphql_request action now executes after the Schema has been built. In early days this hook was used sometimes to hook in and extend the Schema. If you have anything hooked here that modifies the Schema in some way, try hooking into graphql_get_schema instead.

New Features

  • A new Request class has been introduced, simplifying and consolidating the entry points for execution of GraphQL requests. Thanks @chriszarate!
  • A new graphql() function has been added as an entry point to the Request class. Ex: $resposne = graphql([ .'query' => '{posts{edges{node{id,title}}}}' ]);
  • update menu items order to post__in instead of menu_order
  • Update Type definitions for post_by_args. Thanks @hsimah!
    • ID was incorrectly expecting String instead of ID
    • postId was incorrectly expecting ID instead of Int
  • Pass currentConnection and connectionArgs down through context to nested fields of a connection. See notes on usage here: https://github.com/wp-graphql/wp-graphql/pull/637
wp-graphql - v0.1.4

Published by jasonbahl almost 6 years ago

Release Notes

Enhancements & Bug Fixes

  • #619 adds better Exceptions in TypeRegistry functions so that if Types / Fields aren't registered properly, the developer should have better insight into what they've done wrong
  • #569 removes APIGen docs from the Travis-CI integration which was causing the build to appear as if it were failing when it wasn't actually failing. - thanks @CodeProKid!
  • #576 Adds tests to ensure post excerpts are properly being output for the post being resolved. - thanks @CodeProKid!
  • Typos corrected in some field descriptions. - Thanks @MoOx!
  • Moves graphql_register_types hook later in TypeRegistry::init() to make sure all core Types (including Connections, Unions and Mutations) have all been registered and are available when extending the Schema.
wp-graphql - v0.1.3

Published by jasonbahl almost 6 years ago

Release Notes

New Features

  • added resetUserPassword mutation – thanks @kellenmace
  • added sendPasswordResetEmail mutation – thanks @kellenmace

Bug Fixes

  • Update logo in README.md
  • fixed #528 (generalSettings.startOfWeek throwing an error) – thanks @davidatwhiletrue
  • fixes #578, restores the graphql_input_fields filter – thanks @chriszarate
  • fixes #598, allows search results of Terms and Posts to include children (default was only objects with no parent).
wp-graphql - v0.1.2

Published by jasonbahl almost 6 years ago

Release Notes

  • Update docker environment
  • Fix bug with TermObject children missing for hierarchical Taxonomies
wp-graphql - v0.1.1

Published by jasonbahl almost 6 years ago

Release Notes

  • Fixes critical bug in Type/Object/PostObject.php that was causing issues with media items
  • Updates Docker configs to make it easier and faster to run tests in the Docker environment between changes
wp-graphql - v0.1.0

Published by jasonbahl almost 6 years ago

Release Notes

New Registration API

Similar to WordPress core register_* APIs, such as register_post_type, register_taxonomy, register_meta, etc, WPGraphQL now has it's own register_graphql_* API.

The following regiser_graphql_* functions are introduced with this release:

register_graphql_type
register_graphql_object_type
register_graphql_input_type
register_graphql_enum_type
register_graphql_union_type
register_graphql_field
register_graphql_fields
register_graphql_schema
register_graphql_connection
register_graphql_mutation
deregister_graphql_field

Docs to come, but for the time being, check the source code to see how things work. Specifically TypeRegistry.php. All Types have been refactored to be registered with these new functions.

BREAKING:

Deprecated hooks & filters

Some filters and hooks have been removed, intentionally, because they were redundant.

  • graphql_root_queries: this filter has been removed. The RootQuery type is an ObjectType and already inherits the filters established in WPObjectType, so to add fields to the RootQuery, one could use the graphql_RootQuery_fields filter, or could (recommended) use the new register_graphql_field or register_graphql_fields functions to add fields to the root.
  • graphql_post_object_mutation_input_fields: this filter has been removed. The input fields are simply fields of an InputObjectType, which inherit the filters established in WPObjectType, so to add fields, one can use the filters graphql_UpdatePostInput_fields or graphql_CreatePostInput_fields, or (recommended) use the new register_graphql_field or register_graphql_fields functions to add fields to the inputs.
  • graphql_comment_mutation_input_fields: See previous note
  • graphql_term_object_mutation_input_fields See above
  • graphql_setting_mutation_input_fields: See above

Changes to various Type names

Moved files / namespaces

wp-graphql - v0.0.34

Published by jasonbahl about 6 years ago

Release Notes

Issues Closed

  • #495
  • #496
  • #501
  • #504
  • #507 - Thanks @camsjams!
  • #505 - Thanks @ElisaMassafra!
  • #462

Docker Revamp (#462)

We were having issues with our Code Coverage reports since switching our testing to a Docker environment.

This release introduces a new Docker setup that effectively runs tests with coverage and utilizes CodeCov for coverage reports. Thanks @mngi-arogers for work on this!

wp-graphql - v0.0.33

Published by jasonbahl about 6 years ago

Release Notes:

registerUser mutation

We now have a root registerUser mutation that allows for public users to register as a user on the site. Thanks for working on this @kellenmace!

Example usage:

mutation RegisterUser {
  registerUser(input: {
    clientMutationId: "registerUser"
    username: "newUser"
    password: "password"
    email: "[email protected]"
    firstName: "New"
    lastName: "User"
  }) {
    clientMutationId
    user {
      id
      userId
      username
      email
      firstName
      lastName
    }
  }
}

Bug fix

  • Change when register_initial_settings is called
wp-graphql - v0.0.32

Published by jasonbahl about 6 years ago

Release Notes

Bug Fixes

  • introduces a new context-less hook do_action( 'init_graphql_request' ) which fires when a GraphQL request has begun. The use of do_graphql_request to trigger some actions in certain contexts was causing errors.

Tests

  • adjusts PostObjectConnectionQueriesTest.php to generate much less data for Post Connection tests, speeding up the tests quite a bit. Thanks @chriszarate!

Composer Updates

Running composer validate presented some suggestions to adjust. This PR adjusts them.

  • Remove version from composer.json
  • Update Licence in composer.json
  • Update composer.lock
wp-graphql - v0.0.31

Published by jasonbahl about 6 years ago

Release Notes:

  • Adjust the hooks for where register_initial_settings and setup_types occur to make sure core post_types are fully setup before building the Schema.
  • Adjust the wp graphql generate-static-schema cli command to define the request as a GRAPHQL_REQUEST and run actions do_graphql_request and graphql_get_schema
  • have the DataSource::resolve_post_object() method run setup_postdata() to make sure the Post is passing proper context down to it's resolvable fields.
wp-graphql - v0.0.30

Published by jasonbahl about 6 years ago

Release Notes

User Role Queries

  • You can now query for user role info using GraphQL!
  • The following rootQueries now exist: userRole and userRoles
  • example:
query GetUserRoles {
  userRoles {
    edges {
       node {
           name
           id
        }
     }
  }
}

Comment Mutations

  • You can now mutate comments!
  • The following root mutations are now available: createComment, deleteComment, updateComment, restoreComment

Menu Queries

  • You can now query for menus (and menuItems)!
  • The following root queries exist now: menu, menus, menuItem, menuItems
  • example:
query GetMenuItems {
  menuItems {
    edges { 
       node {
          menuItemId
          connectedObject {
             ... on Post {
                title
                postId
             }
             ... on Category {
                name
                categoryId
             }
          }
       }
    }
  }
}

New Docker Environment!

  • You can now easily launch a Docker environment for developing with/for WPGraphQL. At the root of the plugin is a docker-compose.dev.yml file with further instructions outlined on usage.

Misc changes / bug fixes

  • update .gitignore to ignore .vscode files and phpunit.xml
  • update bin/install-wp-tests.sh to allow for overriding the $DB_USERwhen setting up tests
  • fixed a bug with $request variables not working right in one of the hooks
  • fixed a bug with apply_filters( 'the_title' ) being applied incorrectly
  • WPUnionType introduced (in favor of GraphQL/UnionType)
  • fixed bug with sourceUrl not properly being returned when querying for sizes on a mediaItem
  • made graphql_init a pluggable function allowing for it to be initialized externally once only for themes/plugins that include it in their codebase

BREAKING CHANGES:

  • removed filter graphql_type_config in favor of graphql_wp_object_type_config
  • removed filter graphql_comment_author_union_possible_types in favor of the centralized filter graphql_wp_union_type_config in the new WPUnionType
  • removed filter graphql_post_object_union_possible_types in favor of the centralized filter graphql_wp_union_type_config in the new WPUnionType
  • removed filter graphql_term_object_union_possible_types in favor of the centralized filter graphql_wp_union_type_config in the new WPUnionType

Thanks for contributing to this release @chriszarate @CodeProKid @ElisaMassafra @timhanlon @natewoodbridge @jmlallier @kidunot89!

wp-graphql - v0.0.29

Published by jasonbahl over 6 years ago

Release Notes

Bug Fixes

  • fixes bug with setting a parent using the parentId input during PostObject mutations
  • fixes a bug with not properly returning errors in JSON when exceptions outside the Router.php execution occur
wp-graphql - v0.0.28

Published by jasonbahl over 6 years ago

Release Notes:

  • Updates to the main README to make it easier to find some resources about plugin usage
  • Introduce graphql_access_control_allow_headers filter
  • Adjust some sanitization re: GET request handling
  • Fixes a bug with undefined variables for GET requests
  • Adds stati arg to PostObjectConnectionArgs
  • Fixes bug re: ordering by in, notIn and parentIn
wp-graphql - v0.0.27

Published by jasonbahl over 6 years ago

Release Notes

Docker Environment for local dev & testing

  • @chriszarate did some awesome work getting the plugin working with Docker. You can read about how to use Docker for local development in the Readme, and the tests run in the Docker environment on Travis as well. Thanks @chriszarate!!
  • We've got functional and acceptance test support now!! so now we can test using actual remote requests, imitating how Apollo would send a request, for example! Great stuff.

Pagination Tweaks

  • Also the work of @chriszarate. Some funkiness with cursor pagination was addressed. Fwiw, there's likely more funkiness with pagination to be addressed, so if you're reading this, try and paginate various data sets and if it's not working as expected, hop in and contribute to make it better! 😉

Fix PostObjectType resolvers

  • #402 addresses an issue with the "taxonomies" field on PostObjectType

Adjust QueryArgs for connections

  • #418 adds more context to the ConnectionArgs classes and passes the Type $config to filters, so extensions (such as WPGraphQL Meta Query & WPGraphQL Tax Query) can hook in more precisely and take advantage of specific Type config. This opens the door a bit more for more granular filtering in general.

Misc Updates

  • updated license tag in composer.json
  • adjusted some hook and filter arguments to continue to play nice with WPGraphQL Insights
wp-graphql - v0.0.26

Published by jasonbahl over 6 years ago

Release Notes

Updates:

  • Adding more params to Mutation hooks, such as AppContext and ResolveInfo
  • Adjust PostObjectCreate mutations to set the status from the mutation input later in the mutation, allowing for side effects to be triggered before the mutation completes. See #396
wp-graphql - v0.0.25

Published by jasonbahl over 6 years ago

Release Notes:

Breaking Change:

Making Connections Contextual: #387 made changes to how Connection Types are registered and implemented throughout. Previously, connections were pretty generic, such as PostsConnection and that connection was a field of the RootQuery and appeared elsewhere like as children of a Post, or connection from TermObjects. . .The flaw in that is that connections should be contextual based on the node it's connecting from and connecting to. So, now, we have connections such as: PostCategoriesConnection and RootCategoriesConnection. This allows for each type to execute differently, and provide other conditional attributes like edge data that exists when categories are being queried as a field of a Post vs. when they're being queried for as a Root Query. Same with args on the connections, they can now be added to specific connections, instead of available generally across the board. You can read more about it in #387

TermObjectConnection Resolvers

  • #381 Brought up the issue that querying for categories against a PostObject didn't properly resolve to all selected Terms that are connected to the PostObject. This introduced 2 new arguments on TermObjectConnection fields: shouldOutputInFlatList and shouldOnlyIncludeConnectedItems. You can read more about use in #387

Batch Request Support

We've added batch request support in #385! This allows for multiple queries/mutations to be sent in an HTTP request as an array of requests, and they will be processed in one request!

Misc Updates:

  • Added Code of Conduct, Issue Template, Pull Request Template
  • removed unused translations from CLI script (thanks @renatonascalves!)
  • cleaned up misc formatting, specifically moving to brackets for conditionals instead of :/endif;
  • fixed docblock for Types::non_null and Types::list_of to play nicer with IDEs
  • fix issue where permalinks weren't flushing correctly on plugin activation
wp-graphql - v0.0.24

Published by jasonbahl almost 7 years ago

Release Notes

Set terms during Post Object Mutations

  • #333 Introduced the ability to pass input for terms as part of a PostObject mutation input, allowing for terms to be connected to the Post (or page / custom post type) during the same mutation the post is being created or updated.
  • See #333 for details
Package Rankings
Top 0.97% on Packagist.org
Top 6.68% on Proxy.golang.org
Badges
Extracted from project README
Total Downloads Monthly Downloads Daily Downloads Latest Stable Version License Actions Status Actions Status Coverage Status Backers on Open Collective Sponsors on Open Collective
Related Projects