You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering if you guys have tried this plugin with typescript? I want to import a .graphql in a typescript file, but it tries to load it as a module. My module resolution in tsconfig is set to node. So the following does not work for me: import * as schema from "../models/typeDefs.graphql";
However, If I use require like the following, it will work: const schema = require("../models/typeDefs.graphql");
I don't want to use require since it's discouraged by the TS community and my linting rules. Any idea how I can get this to work?
The text was updated successfully, but these errors were encountered:
I met similar issue with my setup(react+apollo+meteor+ts). What @asemoon mentioned is useful, we just had to let TS to pickup that definition file with the following setup in tsconfig.json -
I was wondering if you guys have tried this plugin with typescript? I want to import a .graphql in a typescript file, but it tries to load it as a module. My module resolution in tsconfig is set to node. So the following does not work for me:
import * as schema from "../models/typeDefs.graphql";
However, If I use require like the following, it will work:
const schema = require("../models/typeDefs.graphql");
I don't want to use require since it's discouraged by the TS community and my linting rules. Any idea how I can get this to work?
The text was updated successfully, but these errors were encountered: