driescroons/graphql-fields-to-relations

SyntaxError: Unexpected token '.'

Closed this issue · 2 comments

/node_modules/graphql-fields-to-relations/lib/index.js:14
            if (parent.slice(!options.root ? 0 : options.root?.split('.').length).length > 0 &&
                                                              ^

It seems like you're using a version of node that doesn't support optional chaining. You can bundle your code using Webpack or Rollup to fix the issue, or upgrade Node to support this feature if possible. As far as I know if you're using Typescript it should also take care of this issue for you.

Webpack documentation
Rollup documentation