StellateHQ / fuse

Fuse: The fastest way to build and query great APIs with TypeScript

Home Page:https://fusedata.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feedback for “Fuse Introduction” - Problem with loading initial graphql schema

johny opened this issue · comments

Something is broken with the initial setup of the application.

Tried to generate fresh app via npx create-fuse-app in clean directory, the generator works, but after running npx fuse dev the graphql generator has some problems/errors and it doesn't pick up the schema.

Steps to reproduce

mkdir fuse-example
cd fuse-example
npx create-fuse-app

This works fine

◇  Installed fuse!
│
◇  Created Base files!
│
└  You're all set to work with your Fuse API!

But then, after starting dev server, you get:

npx fuse dev 

Server listening on http://localhost:4000/graphql
✔ Parse Configuration
⚠ Generate outputs
  ❯ Generate to /Projects/fuse-example/fuse/
    ✖
      Failed to load schema from ./schema.graphql:
      Unable to find any GraphQL type definitions for the following pointers:
      - ./schema.graphql
      Error:
      Unable to find any GraphQL type definitions for the following pointers:
      - ./schema.graphql
      at prepareResult (file:///Projects/fuse-example/node_modules/@graphql-tools/load/esm/load-typedefs.js:77:15)
      at loadTypedefs (file:///Projects/fuse-example/node_modules/@graphql-tools/load/esm/load-typedefs.js:37:20)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async loadSchema (file:///Projects/fuse-example/node_modules/@graphql-tools/load/esm/schema.js:12:21)
      at async loadSchema (file:///Projects/fuse-example/node_modules/@graphql-codegen/cli/esm/load.js:33:24)
      at async file:///Projects/fuse-example/node_modules/@graphql-codegen/cli/esm/codegen.js:186:69
      at async file:///Projects/fuse-example/node_modules/@graphql-codegen/cli/esm/codegen.js:185:56
      at async file:///Projects/fuse-example/node_modules/@graphql-codegen/cli/esm/codegen.js:62:17
      at async Task.run (file:///Projects/fuse-example/node_modules/listr2/dist/index.js:960:11)
      at async /Projects/fuse-example/node_modules/p-map/index.js:57:22
      GraphQL Code Generator supports:
      - ES Modules and CommonJS exports (export as default or named export "schema")
      - Introspection JSON File
      - URL of GraphQL endpoint
      - Multiple files with type definitions (glob expression)
      - String in config file
      Try to use one of above options and run codegen again.
    ◼ Load GraphQL documents
    ◼ Generate
  ℹ Watching for changes in /Projects/fuse-example...

The server starts, but the users schema isn't loaded correctly.

That is true, when surfing to the URL the schema.graphql pops up 😅