0

I am making an API REST with axios to get the data. This data is recieved correctly but when I access to the object it gaves me an error since the object is @graph, an mabe is because it has an special character. ¿How can i access to @graph?

Object in the API i am trying to access

Code I have implement and error to access @graph

If someone could help me. Thanks

miguel
  • 13
  • 2
  • Does this answer your question? [How to access object property with invalid characters](https://stackoverflow.com/questions/21056075/how-to-access-object-property-with-invalid-characters) – jonrsharpe Jan 21 '22 at 10:02
  • Or e.g. https://stackoverflow.com/q/12953704/3001761, probably quite a few others. – jonrsharpe Jan 21 '22 at 10:03

1 Answers1

0

let test = {
  "@graph": "test value"
};
console.log(test["@graph"]);

try with

console.log(url.data["@graph"])

cheers

Panos K
  • 1,061
  • 12
  • 26