Check out example codes for "gatsby typescript template". It will help you in understanding the concepts better.

Code Example 1

gatsby new gatsby-starter-typescript https://github.com/haysclark/gatsby-starter-typescriptCopyInstall command: copy code to clipboard

Learn ReactJs, React Native from akashmittal.com