You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also since this is an ESM I can't use require. So that route for import is not an option...I can't use const { graphql, buildSchema } = require('graphql');
And trying this route:
import { graphqlHTTP } from 'express-graphql';
import { buildSchema } from 'graphql';
Gave me:
import { buildSchema } from 'graphql';
^^^^^^^^^^^
SyntaxError: The requested module 'graphql' is expected to be of type CommonJS, which does not support named exports. CommonJS modules can be imported by importing the default export.
For example:
import pkg from 'graphql';
const { buildSchema } = pkg;
already posted this on stack, no responses.
The text was updated successfully, but these errors were encountered:
I do not know how to make this "happy". And I've spent hours on this...about had it.
the
package.json
in the folder with this code is as a "type"="module"api.ts
I'm not able to import
buildSchema
and get that working...no matter what I've tried so far.The error I get now is a TS error:
TypeError: buildSchema is not a function
I already have these installed:
Also since this is an ESM I can't use require. So that route for import is not an option...I can't use
const { graphql, buildSchema } = require('graphql');
And trying this route:
Gave me:
already posted this on stack, no responses.
The text was updated successfully, but these errors were encountered: