I have a project built with NextJS, React, GraphQL and TypeScript. In this project, I have some static JSON data stored in ../data/applications.json:
[
{
"id": "elector-v3",
"name": "Tesla Auto Pilot Elector API",
"apiName": "tap-api-v3-elector",
"apiPath": "/tap/v3/elector"
},
{
"id": "clairvoyance-v2",
"name": "Tesla Auto Pilot Clairvoyance API",
"apiName": "tap-api-v2-clairvoyance",
"apiPath": "/tap/v2/clairvoyance"
},
... and many more...
]
With NextJS and TypeScript, I can import this data directly in my TS file:
import applicationsData from "../data/applications.json"
I notice when handling this data, TypeScript recognizes the shape of this data.
How can I create a type out of this data?