5

import { IResolvers } from "graphql-tools"; I was trying to import IResolvers from graphql-tools and got the message Module: '"../node_modules/graphql-tools"' has no exported member 'IResolvers'.

My dependencies are:"apollo-server-express": "^3.1.2","graphql": "^15.5.1", "graphql-tools": "^8.1.0"

Is this because I am on apollo 3 instead of apollo 2 which has IResolver?

Lin Du
  • 88,126
  • 95
  • 281
  • 483
goat 9009
  • 111
  • 1
  • 7

1 Answers1

18

From the Migrating to Apollo Server 3#Removed exports doc, many types, and interfaces has been removed including IResolvers interface.

There are two solutions:

  1. Run npm install graphql-tools@4.x and import the symbol from graphql-tools.
  2. Run npm install @graphql-tools/utils and import the IResolvers from @graphql-tools/utils

codesandbox

Lin Du
  • 88,126
  • 95
  • 281
  • 483