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

GraphQL SDL file loading broken in versions @graphql-mesh/cli >0.91.2 #7586

Open
4 tasks
ejkg opened this issue Aug 27, 2024 · 0 comments
Open
4 tasks

GraphQL SDL file loading broken in versions @graphql-mesh/cli >0.91.2 #7586

ejkg opened this issue Aug 27, 2024 · 0 comments

Comments

@ejkg
Copy link

ejkg commented Aug 27, 2024

Issue workflow progress

Progress of the issue based on the
Contributor Workflow

Make sure to fork this template and run yarn generate in the terminal.

Please make sure Mesh package versions under package.json matches yours.

  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

Describe the bug

I am unable to run mesh dev or mesh start on any build.

The result of either command creates this output:

[2024-08-27T13:09:38.485Z] ERROR 🕸️  Mesh /Users/path/to/project/src/graphql/modules/data-source-a/file.ts
extend type TypeFromSomeDataSource {
       ^^^^

SyntaxError: Unexpected identifier 'type'
    at wrapSafe (node:internal/modules/cjs/loader:1281:20)
    at Module._compile (node:internal/modules/cjs/loader:1321:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (node:internal/modules/helpers:179:18)
    at jiti (/Users/path/to/project/node_modules/@graphql-mesh/include/node_modules/jiti/dist/jiti.js:1:244799)
    at /Users/path/to/project/src/graphql/modules/barcode-scanner/index.ts:2:46
    at evalModule (/Users/path/to/project/node_modules/@graphql-mesh/include/node_modules/jiti/dist/jiti.js:1:247
    at jiti (/Users/path/to/project/node_modules/@graphql-mesh/include/node_modules/jiti/dist/jiti.js:1:245241)
    at /Users/path/to/project/src/graphql/additionalResolvers.ts:5:23
    at evalModule (/Users/path/to/project/node_modules/@graphql-mesh/include/node_modules/jiti/dist/jiti.js:1:247
    at jiti (/Users/path/to/project/node_modules/@graphql-mesh/include/node_modules/jiti/dist/jiti.js:1:245241)
    at /Users/path/to/project/.mesh/index.ts:41654:32
    at async Promise.all (index 0)
    at async Object.getMeshOptions (/Users/path/to/project/.mesh/index.ts:41653:31)
    at async Object.handler (/Users/path/to/project/node_modules/@graphql-mesh/cli/cjs/index.js:194:33)

scrubbed for PII.

To Reproduce Steps to reproduce the behavior:

You will need the following components to test this:

  • at least one configured mesh data source.
  • extend type <some type build from that data source>
  • run mesh dev or try to run in prod mode mesh build && mesh start

Expected behavior

Expect to properly load GraphQL schema files from .graphql files, which unfortunately doesn't happen. Mesh appears to treat the file as a typescript file because the module system doesn't recognize the import as a non-TS(JS) file.

Environment:

  • OS: Sonoma 14.6.1 (23G93 - Apple Silion M1)
  • @graphql-mesh/0.95.2:
  • NodeJS: 20.17

Additional context

It's worth mentioning that this is also happening in integration environments that we have to run E2E tests as well.

Repository owner deleted a comment Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@ejkg and others