graphql-mesh: new OpenAPI Handler and its examples are broken - Mesh: Unexpected token '.' - MacOS only

Describe the bug

The examples openapi-react-weatherbit, openapi-location-weather and openapi-javascript-wiki are broken due to recent changes to the OpenAPI Handler.

To Reproduce Steps to reproduce the behavior: (checkout master, cd into examples) Install and run the package commands start/build: mesh build|dev have empty output.

Weatherbit build fails with Failed to resolve '../.mesh' from './src/useMeshSdk.ts' /@graphql-mesh/examples/openapi-react-weatherbit/src/useMeshSdk.ts:1:33

Because the mesh folder is non-existent after “successful” mesh sdk build.

Also the openapi-javascript-wiki has an sdk.ts file which is gitignored but still checked in(?!), it currently won’t be (re)generated.

Expected behavior

Broken stuff should not be on master, failed builds should print an error!

Environment:

  • OS: MacOS
  • @graphql-mesh/openapi: 0.16.11/master
  • NodeJS: 12.22

Additional context

@ardatan would you mind explaining the new store constructor argument? How does it replace the introspection cache? (edit: I was able to run the adapter with the new store injected after looking at the testfile) Currently @graphql-mesh/store is in version 0.1.0-alpha-ea13f8d4a.0, I’d prefer not to have this alpha tag in my package.json 😛 - to which versions do you recommend freezing (e.g. last version before adding store)?

Are the docs up to date for the new OpenAPI Handler?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 31 (31 by maintainers)

Most upvoted comments

@JustusNBB Actually the content of the code is not important because it is a generated code already 😄

@JustusNBB Got it! Let me give a try locally on my Mac. If that’s the problem, that means we should run tests for Mac in addition to Windows and Linux on CI 😃

I also did a cleanup by removing outdated sdk file which can be easily generated using mesh build and found under .mesh; Oh now I realized the issue is with mesh start command. Ok now I’m working on it 👍

weather-bit and location-weather do work now on master (0.17)

javascript-wiki@0.5.111 start ~/@graphql-mesh/examples/openapi-javascript-wiki mesh dev

Mesh: Unexpected token ‘.’

It also still has a src/mesh/sdk.ts checked in AND gitignored!!

@ardatan You also changed the 0.16.10 release adding store 0.0.0, so the store alpha turned out to be stable?

I don’t think releases and examples are broken. Probably it is a version mismatch in package.json or yarn.lock/package-lock.json .

You can see the upcoming changes in that Release PR; https://github.com/Urigo/graphql-mesh/pull/2336 And the docs for the upcoming version; https://github.com/Urigo/graphql-mesh/tree/master/website/docs

https://github.com/Urigo/graphql-mesh/blob/master/website/docs/recipes/build-mesh-artifacts.md#why-you-should-build-mesh-artifacts New store implementation replaces the existing introspection cache in a different approach. Now we have 4 different commands dev, build, start, and validate. dev -> introspects the remote schemas no matter what and doesn’t save it. build -> does the introspection and the code generation for future run start -> runs the built artifacts validate -> does the introspection and compares it with the existing ones to make sure there are no breaking changes