skip to Main Content

v0.0.18 Release Notes

v0.0.18 is here!

https://github.com/wp-graphql/wp-graphql/releases/tag/v0.0.18

New Features

Get single postObjects by Global ID, DB ID and URI

  • This adds a new “uri” field to the objects to be queried for.
  • This adds new RootQuery fields to get posts by URI, {post}Id, or global “id”.
  • Ex: the following would return the same post object 3 times:
{
  postById: postBy(id:"cG9zdDoxMDAw") {
    ...postData
  }
  postByPostId: postBy(postId:1000) {
    ...postData
  }
  postByURI: postBy(uri:"hello-world") {
    ...postData
  }
}

fragment postData on post {
  id
  postId
  uri
}

 

User Mutations

  • CRUD user mutations are introduced (respects authentication/authorization):
mutation createUser {
  createUser( input: {
    clientMutationId: "someId"
      username: "username"
      email: "email@site.com"
    }) {
      user {
      firstName
      lastName
    }
  }
}

403 Default Header Status

The default header status for responses will be 403. For authenticated requests, the status will be 200. The execution will remain the same, where authorization will occur at the resolve level, but the status change will allow clients to invalidate current users, etc when a request comes back as unauthenticated without getting a full error for the entire request.

Misc Updates

  • Updates [graphql-php](https://github.com/webonyx/graphql-php/compare/v0.9.8…v0.9.14) from 0.9.8 to 0.9.14′
  • Fixes a bug with the plugins/themes for connections
  • Fixes some default $args for post connection queries
  • Add a child{Type} to hierarchical postTypeObjects
  • Updates `last_name` field on user type to `lastName` (**breaking change**)

 

Unit Test Changes

  • Updates to Travis scripts for automated unit testing
  • Updates to phpunit.xml.dist to exclude groups by default
  • Adds some AJAX tests

Documentation

  • Adds readme.txt
  • Adds an initial CONTRIBUTING.md file
  • Updates to the README.md (moving some stuff to the Wiki)

Leave a Reply

Share This
Back To Top