Skip to content

Commit 985efbd

Browse files
Robson TenórioRobson Tenório
Robson Tenório
authored and
Robson Tenório
committed
update README - custom params
1 parent 31fffa1 commit 985efbd

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

Diff for: README.md

+28
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,34 @@ let post = await Post
517517
.get()
518518
```
519519

520+
# Custom params
521+
522+
If you need to pass any extra param not provided by `vue-api-query` pattern, just use the `params()` method while querying:
523+
524+
```js
525+
// GET /users?doSomething=yes&process=no
526+
527+
let users = await User
528+
.params({
529+
doSomething: 'yes',
530+
process: 'no'
531+
})
532+
.get()
533+
```
534+
535+
Of course you can chain it with other methods, including on relationships.
536+
537+
```js
538+
// GET /posts/1/comments?include=user&blah=123
539+
540+
let comments = await post
541+
.comments()
542+
.include('user')
543+
.params({blah: 123})
544+
.get()
545+
```
546+
547+
520548

521549
# Response from backend
522550

0 commit comments

Comments
 (0)