ardatan / ardatan/graphql-mesh
Mesh - FHIR Failed to generate the schema Error: Unable to load fhir.schema.json
- Dominant language
- TypeScript
- Stars
- 3.5k
- Forks
- 363
- Avg merge
- 6h 10m
- Merged PRs (30d)
- 19
Description
### Issue workflow progress
_Progress of the issue based on the [Contributor Workflow](https://github.com/the-guild-org/Stack/blob/master/CONTRIBUTING.md#a-typical-contributor-workflow)_
- [ ] 1. The issue provides a reproduction available on [Github](https://github.com/Urigo/graphql-mesh/tree/master/examples/hello-world), [Stackblitz](https://stackblitz.com/github/Urigo/graphql-mesh/tree/master/examples/hello-world) or [CodeSandbox](https://codesandbox.io/s/github/Urigo/graphql-mesh/tree/master/examples/hello-world)
> 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 a pending review
---
**Describe the bug**
I am trying to run the project given in the example project given in this repository called [json-schema-fhir](https://github.com/Urigo/graphql-mesh/tree/master/examples/json-schema-fhir)
**To Reproduce**
Steps to reproduce the behaviour:
clone this repository [json-schema-fhir](https://github.com/Urigo/graphql-mesh/tree/master/examples/json-schema-fhir)
https://codesandbox.io/p/github/nirzaf/json-schema-fhir/draft/upbeat-shtern?file=%2Fexample-queries%2Fpatient.query.graphql&selection=%5B%7B%22endColumn%22%3A2%2C%22endLineNumber%22%3A18%2C%22startColumn%22%3A2%2C%22startLineNumber%22%3A18%7D%5D&workspace=%257B%2522activeFileId%2522%253A%2522cl85mvl6n0009lpgl7hjocn5x%2522%252C%2522openFiles%2522%253A%255B%255D%252C%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522gitSidebarPanel%2522%253A%2522COMMIT%2522%252C%2522sidekickItems%2522%253A%255B%257B%2522key%2522%253A%2522cl85n6k28000k356hw6iyfgvq%2522%252C%2522type%2522%253A%2522PROJECT_SETUP%2522%252C%2522isMinimized%2522%253Afalse%257D%252C%257B%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522start%2522%252C%2522key%2522%253A%2522cl85muipb0008356hv6chabsl%2522%252C%2522isMinimized%2522%253Afalse%257D%255D%257D
yarn install
yarn run
**Expected behaviour**
Should begin the localhost:3000 server and should be able to query [hapi.fhir.org](http://hapi.fhir.org/baseR4) via graphql
**Environment:**
- OS: Windows 11
- - yarn --version 1.22.15
- `@graphql-mesh/...`:
- NodeJS: node --version v16.16.0
**Additional context**
package.json file
```
{
"name": "json-schema-fhir",
"version": "0.0.285",
"license": "MIT",
"private": true,
"scripts": {
"download-fhir-schema": "node scripts/download-fhir-schema.js",
"build": "mesh build",
"start": "mesh dev",
"start:prod": "mesh start"
},
"dependencies": {
"@graphql-mesh/cli": "0.78.15",
"@graphql-mesh/json-schema": "0.35.12",
"graphql": "16.6.0",
"unzip-stream": "0.3.1"
}
}
```
##Complete error log
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
> json-schema-fhir@0.0.285 start
> mesh dev
� �️ Mesh - Server Generating the unified schema...
� �️ Mesh - FHIR Failed to generate the schema Error: Unable to load ./fhir.schema.json from C:\Users\mmfazrin\RiderProjects\json-schema-fhir
at C:\Users\mmfazrin\RiderProjects\json-schema-fhir\node_modules\json-machete\index.js:157:35
at async dereferenceObject (C:\Users\mmfazrin\RiderProjects\json-schema-fhir\node_modules\json-machete\index.js:150:40)
at async dereferenceObject (C:\Users\mmfazrin\RiderProjects\json-schema-fhir\node_modules\json-machete\index.js:265:36)
at async dereferenceObject (C:\Users\mmfazrin\RiderProjects\json-schema-fhir\node_modules\json-machete\index.js:265:36)
at async dereferenceObject (C:\Users\mmfazrin\RiderProjects\json-schema-fhir\node_modules\json-machete\index.js:265:36)
at async Object.dereferenceObject (C:\Users\mmfazrin\RiderProjects\json-schema-fhir\node_modules\json-machete\index.js:265:36)
at async getDereferencedJSONSchemaFromOperations (C:\Users\mmfazrin\RiderProjects\json-schema-fhir\node_modules\@omnigraph\json-schema\index.js:303:35)
at async Object.createBundle (C:\Users\mmfazrin\RiderProjects\json-schema-fhir\node_modules\@omnigraph\json-schema\index.js:2282:32)
at async Object.getWithSet (C:\Users\mmfazrin\RiderProjects\json-schema-fhir\node_modules\@graphql-mesh\store\index.js:160:38)
at async JsonSchemaHandler.getMeshSource (C:\Users\mmfazrin\RiderProjects\json-schema-fhir\node_modules\@graphql-mesh\json-schema\index.js:50:24)
� �️ Mesh - Server Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh with DEBUG=1 environmental variable to get more verbose output.
at Object.getMesh (C:\Users\mmfazrin\RiderProjects\json-schema-fhir\node_modules\@graphql-mesh\runtime\index.js:554:15)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with examples/json-schema-fhir/package.json and scripts/download-fhir-schema.js, then run yarn install and the example's mesh dev command. Trace why fhir.schema.json is unavailable during schema generation and verify that the example starts its localhost server and can query hapi.fhir.org without the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, node.js, typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100