I want to display the name value of an array but it is returning null
async getInscription() {
const response = await api.post('graphql', {
query: `
query{
getInscription(id: ${this.id}){
id
inscriptionStatus {
status
}
inscriptionProfile {
profile
}
education_level
name
cpf
phone
date_birth
sex
state
city
rg
company_name
office
email
email_verified_at
password
created_at
updated_at
}
}
`,
});
const { getInscription } = response.data.data;
var cityObj = getInscription.city;
Reponse:
{"data":{"getInscription":{"city":"{"id":5577,"state_id":7,"name":"New York"}",}}}
How can I do to return only the name?
Since when I place cityObj.name or cityObj ['name'] the value is null.
question from:
https://stackoverflow.com/questions/66050517/display-array-value-in-vuejs 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…