Can't import IResolvers from graphql-tools
Asked Answered
S

1

7

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?

Sadducee answered 7/8, 2021 at 8:52 Comment(0)
I
20

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 [email protected] and import the symbol from graphql-tools.
  2. Run npm install @graphql-tools/utils and import the IResolvers from @graphql-tools/utils

codesandbox

Isoniazid answered 9/8, 2021 at 9:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.