Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module '"graphql/utilities/printSchema"' has no exported member 'Options' #1135

Closed
jcuna opened this issue Dec 10, 2021 · 6 comments
Closed
Labels
Question ❔ Not future request, proposal or bug issue Solved ✔️ The issue has been solved

Comments

@jcuna
Copy link

jcuna commented Dec 10, 2021

Describe the Bug
Upon following the installation guide here: https://typegraphql.com/docs/installation.html and copying/pasting the examples here: https://typegraphql.com/docs/getting-started.html. Yet just adding the following line to a index.ts file will throw this error for me when I run tsc

import {buildSchema} from 'type-graphql'

or

import {buildSchemaSync} from 'type-graphql'

Run tsc

> tsc

node_modules/type-graphql/dist/utils/emitSchemaDefinitionFile.d.ts:2:10 - error TS2305: Module '"graphql/utilities/printSchema"' has no exported member 'Options'.

2 import { Options as GraphQLPrintSchemaOptions } from "graphql/utilities/printSchema";

To Reproduce
import {buildSchemaSync} from 'type-graphql'

Expected Behavior
properly compile file

Logs

> tsc

node_modules/type-graphql/dist/utils/emitSchemaDefinitionFile.d.ts:2:10 - error TS2305: Module '"graphql/utilities/printSchema"' has no exported member 'Options'.

2 import { Options as GraphQLPrintSchemaOptions } from "graphql/utilities/printSchema";
           ~~~~~~~


Found 1 error.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `tsc`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Environment (please complete the following information):

  • OS: alpine3.14
  • Node 14.17.3
  • Package version 1.1.1
  • TypeScript version 4.5.3

Additional Context
Like I said, I started following the examples as described above, yet currently the single line to import buildschema is throwing this error.

See my tsconfig.json below:

{
  "compilerOptions": {
    "strict": true,
    "esModuleInterop": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "moduleResolution": "node",
    "module": "CommonJS",
    "target": "ES2020",
    "lib": [
      "ES2020",
      "esnext.asynciterable"
    ],
    "outDir": "out",
    "strictPropertyInitialization": false,
    "typeRoots": [
      "node_modules/@types"
    ]
  },
  "exclude": [
    "tests"
  ]
}

@jcuna
Copy link
Author

jcuna commented Dec 10, 2021

I understand that type-graphql is expecting the graphql package to export that module, I will try downgrading graphql since I'm using the latest version released 3 days ago.

@jcuna
Copy link
Author

jcuna commented Dec 10, 2021

Downgrading graphql to [email protected] fixed the issue. I guess that this package needs to be updated to support latest graphql, or documentation should be updated to specify the latest supported version.

@MichalLytek
Copy link
Owner

I'm using the latest version released 3 days ago.

Are you talking about v16?
You've ignored peer dependency warnings on install?

@MichalLytek MichalLytek added the Question ❔ Not future request, proposal or bug issue label Dec 10, 2021
@jcuna
Copy link
Author

jcuna commented Dec 10, 2021

I'm using the latest version released 3 days ago.

Are you talking about v16? You've ignored peer dependency warnings on install?

  1. yes
  2. I did.

I just upgraded to v16 again to verify and there're indeed warnings which I totally ignored before. Is there a guide on how to deal with this as it's not very clear which dependencies specifically are required

@jcuna
Copy link
Author

jcuna commented Dec 11, 2021

looking at the warnings in more details, all are basically indicating that they are not compatible with graphql@16 so I guess there's still no path to upgrade to graphql@16

Thanks for pointing out the warnings.

@MichalLytek
Copy link
Owner

See #1100 🔒

@MichalLytek MichalLytek added the Solved ✔️ The issue has been solved label Dec 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question ❔ Not future request, proposal or bug issue Solved ✔️ The issue has been solved
Projects
None yet
Development

No branches or pull requests

2 participants