functions-js icon indicating copy to clipboard operation
functions-js copied to clipboard

feat/Function query params

Open justadev-afk opened this issue 2 years ago • 0 comments

What kind of change does this PR introduce?

New feature added, query params support

What is the current behavior?

Currently the api doesnt support query params

What is the new behavior?

Be able to use query params from options.

Current way:

const { data, error } = await fclient.invoke<MirrorResponse>('mirror?hello=world', {})

New:

const { data, error } = await fclient.invoke<MirrorResponse>('mirror', {
   params: {
     hello: 'world',
   }
})

This is specially good when you're using verbs like get and delete. I've used the axios way to receive qs, the parameter named "params"

justadev-afk avatar May 23 '24 12:05 justadev-afk