Skip to content

Releases: robsontenorio/vue-api-query

Stable release and for() method

Choose a tag to compare

@robsontenorio robsontenorio released this 16 Jul 16:10
  • Tag 1.0.0 stable
  • for() method for creating new related objects

Creating new related objects is easy. Just use the for() method, passing the related object.

  let post = new Post({title: 'Woo!'})  

  // POST /posts
  await post.save()

  let comment = new Comment({text: 'New one for this post'}).for(post)

  // POST /posts/1/comments
  await comment.save()

Custom params

Choose a tag to compare

@robsontenorio robsontenorio released this 05 Jun 01:15

If you need to pass any extra param not provided by vue-api-query pattern, just use the params() method while querying:

// GET /users?doSomething=yes&process=no

let users = await User
  .params({
    doSomething: 'yes',
    process: 'no'
  })
  .get()

Of course you can chain it with other methods, including on relationships.

// GET /posts/1/comments?include=user&blah=123

let comments = await post
  .comments()
  .include('user')
  .params({blah: 123})
  .get()

Add `primaryKey()` method.

Choose a tag to compare

@robsontenorio robsontenorio released this 16 May 18:21

In case your model does not work with default primary key ('id').

0.5.0

Choose a tag to compare

@robsontenorio robsontenorio released this 11 Apr 03:49

Support PUT, POST, DELETE for nested relationships

0.4.1

Choose a tag to compare

@robsontenorio robsontenorio released this 06 Apr 22:54

Fix internal variable name

0.4.0

Choose a tag to compare

@robsontenorio robsontenorio released this 05 Apr 12:43
  • Add select() for sparse fields

  • Remove find() restriction for integers

0.3.0

Choose a tag to compare

@robsontenorio robsontenorio released this 31 Mar 01:44
  • add delete() method

0.2.0

Choose a tag to compare

@robsontenorio robsontenorio released this 30 Mar 04:32
  • add "fetch style request" with $get()
  • add pagination with page() and limit()