Giter VIP home page Giter VIP logo

Comments (6)

jbroadice avatar jbroadice commented on May 22, 2024 1

Brilliant! That's working well. Thank you very much.

from graphql-modules.

ardatan avatar ardatan commented on May 22, 2024 1

@yalamber Because your graphql files are still in the source file directory, you need to copy them to the output folder.

from graphql-modules.

ardatan avatar ardatan commented on May 22, 2024

GraphQL-Modules doesn’t have a feature like this. You have to use other libraries to handle graphql files like this
https://github.com/ardatan/graphql-import-node

from graphql-modules.

dotansimha avatar dotansimha commented on May 22, 2024

@ardatan just updated to docs: https://github.com/Urigo/graphql-modules/blob/master/docs/guides/development-environment.md#import-from-graphql-files
Thanks @JChapple

from graphql-modules.

yalamber avatar yalamber commented on May 22, 2024

Hello, I followed the documentation to import files from .graphql files, this works well in development but when building it seems to not build .graphql files and when I run npm start there is this error:
Error: Cannot find module './schema.graphql'

{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "experimentalDecorators": true,
    "module": "commonjs",
    "target": "es6",
    "lib": ["es6", "esnext", "es2015"],
    "noImplicitAny": false,
    "suppressImplicitAnyIndexErrors": true,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "sourceMap": true,
    "declaration": true,
    "outDir": "./dist",
    "rootDir": "./src"
  },
  "files": ["src/main.ts"],
  "include": ["src/**/*"],
  "exclude": ["node_modules", "**/*.spec.ts"]
}

My scripts

"scripts": {
    "dev": "nodemon --exec ts-node src/main.ts",
    "debug": "nodemon --exec node -r ts-node/register --inspect src/main.ts",
    "build": "tsc",
    "start": "node dist/main.js"
  },

from graphql-modules.

yaldram avatar yaldram commented on May 22, 2024

For anyone who came across this issue of not finding .graphql files in your build please check this - https://github.com/a7ul/esbuild-node-tsc#optional-configuration

from graphql-modules.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.