When working with my custom types, I want to utilize the GraphQLSchema
from the graphql
module. If I simply write:
interface MyThing {
schema: GraphQLSchema
}
It doesn't reference the actual GraphQLSchema
definition from the module (it's just any
). Visual Studio Code then suggests automatically adding the import statement:
import { GraphQLSchema } from 'graphql'
Now, the definition is correct (hovering over it in VSCode shows the correct type) but my custom type file no longer functions—I can't use MyThing
in my code because it's undefined.
Although my tsconfig includes my custom typings and node_modules/@types
, VSCode seems to recognize them, so I assume everything is set up correctly. I even tried explicitly adding the path to the graphql file containing the definition, but it didn't work.
I can easily use other namespaced definitions without an import, but this particular one is causing issues.
Any suggestions for resolving this?