In my custom types I wish to make use of the GraphQLSchema
from the graphql
module. If I just write:
interface MyThing {
schema: GraphQLSchema
}
It does not reference the GraphQLSchema
definition from the module (it's just any
). VSCode then suggests to auto add the import file:
import { GraphQLSchema } from 'graphql'
The definition is now correct (i.e. hovering above it in VSCode pops the correct type) but now my custom type file no longer works - i.e. I cannot use MyThing
in my code - it's no longer defined.
My tsconfig does include my custom typings as well as node_modules/@types
- vscode seems to see it so I assume it's fine. I did try specifically adding the path to the graphql file containing the definition but no go.
I am able to use other definitions that are namespaced just fine without an import - just not that one.
Suggestions?