Urigo / WhatsApp-Clone-Client-React

https://www.tortilla.academy/Urigo/WhatsApp-Clone-Tutorial
https://tortilla.academy
614 stars 144 forks source link

yarn codegen command fail to load schema from the server? #1597

Open saher-elgendy opened 2 years ago

saher-elgendy commented 2 years ago

I can't start the project, i got this error when i run yarn codgen command:

 √ Parse configuration
  > Generate outputs
    > Generate ./src/graphql/types.tsx
      × Load GraphQL schemas
        → Failed to load schema
        Load GraphQL documents
        Generate

 Found 1 error

  × ./src/graphql/types.tsx
    Failed to load schema from ../WhatsApp-Clone-Server/modules/*/index.ts:

      Unable to find any GraphQL type definitions for the following pointers:

          - ../WhatsApp-Clone-Server/modules/*/index.ts

        Error:
      Unable to find any GraphQL type definitions for the following pointers:

          - ../WhatsApp-Clone-Server/modules/*/index.ts
 at prepareResult (E:\saher dev\what's app full\WhatsApp-Clone-Client-React\WhatsApp-Clone-Client-React\node_modules\@graphql-t
oolkit\core\index.cjs.js:1138:15)
    at loadTypedefs (E:\saher dev\what's app full\WhatsApp-Clone-Client-React\WhatsApp-Clone-Client-React\node_modules\@graphql-to
olkit\core\index.cjs.js:1108:12)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Object.loadSchema (E:\saher dev\what's app full\WhatsApp-Clone-Client-React\WhatsApp-Clone-Client-React\node_modules\
@graphql-toolkit\core\index.cjs.js:1161:21)
    at async loadSchema (E:\saher dev\what's app full\WhatsApp-Clone-Client-React\WhatsApp-Clone-Client-React\node_modules\@graphq
l-codegen\cli\bin.js:396:24)
    at async E:\saher dev\what's app full\WhatsApp-Clone-Client-React\WhatsApp-Clone-Client-React\node_modules\@graphql-codegen\cl
i\bin.js:763:55
    at async Task.task (E:\saher dev\what's app full\WhatsApp-Clone-Client-React\WhatsApp-Clone-Client-React\node_modules\@graphql
-codegen\cli\bin.js:618:17)

        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.
    Error: Failed to load schema
        at loadSchema (E:\saher dev\what's app full\WhatsApp-Clone-Client-React\WhatsApp-Clone-Client-React\node_modules\@graphql-
codegen\cli\bin.js:406:15)
        at processTicksAndRejections (internal/process/task_queues.js:93:5)
Failed to compile.