Import .graphql file when using typescript with meteor

I was learning to integrate meteor + apollo + react, and try to separate graphql schema into its own file… By using both swydo:graphql and babel-plugin-inline-import, was able to start up the app without issue in runtime, but still, editor is complaining cannot find module '../imports/api/link.graphql' for the following line

import { Link } from '../imports/api/link.graphql';

I guess this is due to typescript setup with my meteor app? Any suggestion how to configure the tsconfig.json to get around this?

So I guess I resolved this by

  1. create a graphql.d.ts file under /imports/@types/ with
declare module "*.graphql" {
	const value: any;
	export = value;
}
  1. configure tsconfig.json with
"compilerOptions": {
    ...
    "typeRoots": ["node_modules/@types", "imports/@types"],
    ...
}
"files": ["imports/@types/graphql.d.ts"],
"include": ["**/*"],

Hope this is helpful in future…