There certainly is, though I am not doubting you are having issues. I can try to help.
Can you share the CreateUserInput
and LoginUserInput
input types?
if it looks like
input CreateUserInput {
username: String
password: String
}
Then this should work
import { Client, query as q } from 'faunadb'
const client = new Client({
secret: MYSECRET // assuming this has `create` privileges on the User collection
})
client.query(q.Call('create_user', { username: 'jason', password: 'abc1234' } ))
.then(res => console.log(res)) // or do whatever with the response
If you are still getting errors, stringify the WHOLE response.
Also, if you want to inspect what the value of input
var is then you can use Abort
to inspect it. Update the UDF to something like this:
Query(
Lambda(
['input'],
Abort(Format('%@', Var('input'))
)
)
Then call and see what you get.