DEV Community

Discussion on: what does this mean?: import { gql } from "@apollo/client"; ^^^^^^ SyntaxError: Cannot use import statement outside a module

Collapse
 
yobretyo profile image
Bret

So run “nodeman index”?

Collapse
 
faturachmanyusup profile image
Faturachman Yusup

import { gql } from '@apollo/client'

☝️npm start

const { gql } = require('@apollo/client’)

☝️ node index.js

Thread Thread
 
yobretyo profile image
Bret

THABK YOI!! Well, that error comes up when I try and add my ...coffeeMutation.Mutation

Then it throws that error

Thread Thread
 
yobretyo profile image
Bret

So, it’s running now.... but there’s still an error of a constructor

Thread Thread
 
faturachmanyusup profile image
Faturachman Yusup

if you don't mind, maybe you can share your repo link