I have an Appwrite function (using Nodejs runtime) which should get user's data from 3rd party source and then create user in Database. For getting user's data the code is:
const user = await axios.get(URL, params)
My problem is I can not access to the user's object data after getting response. Consoling the user type shows me object but trying to get user.email output nothing. This filed definately exists, I've checked it with Postman app. So my Axios get requiest config is correct. And response fromat is json.
I'm also tryied to initialize user with and empty object and return data even it empty. But running function falls into error: TypeError: Converting circular structure to JSON.
Probably I have another way to get user's data logged in through OAuth login? Simply, I want to save logged user into Database.
Function doesn't parse json data
I believe the axios.get() returns a Response which contains a lot of stuff that leads to a circular reference. Try:
const response = await axios.get(...);
console.log(response.data);
You are absolutely right. Sorry for my distraction
[RESOLVED] Function doesn't parse json data
Recommended threads
- MongoDb Database Breaks integer[] & bigi...
I've got a table with the below column created. When I try to insert the value `[-3408048000]` into it, the dart sdk cloud function call is successful (no error...
- Appwrite Functions cold start
Hello. I'm seeing really long cold starts on Appwrite Cloud Functions and wanted to know if this is expected. My function just authenticates the user, fetches ...
- Error can not create `tablesdb` event wi...
When i'm trying to add an event with `tablesdb` i get an error message My event value: `tablesdb.mtg-decklist-dev.tables.queue_parsing.rows.*.create` Same err...