Skip to content

cli fails generating artifacts #4562

Open
@santino

Description

@santino

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
Since the release of v0.78.12 the cli package has an issue that causes a failure on generating the Typescript artifacts.
This happens when working with a single data source and a transform in wrap mode.
This is the output:

💡 🕸️  Mesh Generating the unified schema
💡 🕸️  Mesh - Source1 Dereferencing the bundle
💡 🕸️  Mesh - Source1 Creating the GraphQL Schema from dereferenced schema
💡 🕸️  Mesh Generating artifacts
💡 🕸️  Mesh Generating index file in TypeScript
💥 🕸️  Mesh TypeError: Cannot read properties of undefined (reading 'get')
    at generateTsArtifacts (/Users/user/projects/mesh-project/node_modules/@graphql-mesh/cli/bin.js:251:70)
    at Object.handler (/Users/user/projects/mesh-project/node_modules/@graphql-mesh/cli/bin.js:1033:19)

To Reproduce
Steps to reproduce the behavior:

  • Have a Mesh service that works on a single data source (hence no stitching required)
  • Define a transform at the source level that supports both bare and wrap mode (e.g. naming convention, filterSchema, etc.)
  • Omit the mode property in the transform config (or set it to wrap)
  • Run the server

Expected behavior
The artifacts are generated correctly and the server runs as normal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions