Releases: wp-graphql/wp-graphql
v0.1.3
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).
v0.1.2
v0.1.1
v0.1.0
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 newregister_graphql_field
orregister_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
orgraphql_CreatePostInput_fields
, or (recommended) use the newregister_graphql_field
orregister_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
- various type names have changed for consistency.
- All input types now include
Input
in their name. - All Enum types now include
Enum
in their name - All Union types now include
Union
in their name - All connections are registered via the
register_graphql_connection()
function, and therefore all connection types and fields have consistent naming, where before the names were a bit random- Connection input args have consistent names now.
- For example:
RootCommentsCommentArgs
is nowRootQueryToCommentConnectionWhereArgs
(see: https://github.com/wp-graphql/wp-graphql/compare/release/v0.1.0?expand=1#diff-00fe868538645d14c1c8af8d3a19bde6) RootCategoriesTermArgs
is nowRootQueryToCategoryConnectionWhereArgs
https://github.com/wp-graphql/wp-graphql/compare/release/v0.1.0?expand=1#diff-9d7db44df670461f784357a0a7e3c860L83
- For example:
- Connection input args have consistent names now.
Moved files / namespaces
- Connection resolvers have all been moved under
WPGraphQL\Data
. If you extend any of the existing resolver classes, you should be able to just update your namespace, such as changing\WPGraphQL\Type\PostObject\Connection\PostObjectConnectionResolver
to\WPGraphQL\Data\PostObjectConnectionResolver
as seen here: https://github.com/wp-graphql/wp-graphql/compare/release/v0.1.0?expand=1#diff-4232742370ce60dbe32afbf8e87e3476L382
v0.0.34
Release Notes
Issues Closed
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!
v0.0.33
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: "test111@test.com"
firstName: "New"
lastName: "User"
}) {
clientMutationId
user {
id
userId
username
email
firstName
lastName
}
}
}
Bug fix
- Change when
register_initial_settings
is called
v0.0.32
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 ofdo_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
v0.0.31
Release Notes:
- Adjust the hooks for where
register_initial_settings
andsetup_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 aGRAPHQL_REQUEST
and run actionsdo_graphql_request
andgraphql_get_schema
- have the
DataSource::resolve_post_object()
method runsetup_postdata()
to make sure the Post is passing proper context down to it's resolvable fields.
v0.0.30
Release Notes
User Role Queries
- You can now query for user role info using GraphQL!
- The following rootQueries now exist:
userRole
anduserRoles
- 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 andphpunit.xml
- update
bin/install-wp-tests.sh
to allow for overriding the$DB_USER
when 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 forsizes
on amediaItem
- 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 ofgraphql_wp_object_type_config
- removed filter
graphql_comment_author_union_possible_types
in favor of the centralized filtergraphql_wp_union_type_config
in the new WPUnionType - removed filter
graphql_post_object_union_possible_types
in favor of the centralized filtergraphql_wp_union_type_config
in the new WPUnionType - removed filter
graphql_term_object_union_possible_types
in favor of the centralized filtergraphql_wp_union_type_config
in the new WPUnionType
Thanks for contributing to this release @chriszarate @CodeProKid @ElisaMassafra @timhanlon @natewoodbridge @jmlallier @kidunot89!