Generating function fails with "Unable to find any GraphQL type definitions"

Solved

Generating function fails with "Unable to find any GraphQL type definitions"

Nick_Wesselman
Shopify Staff
167 42 65

When creating a new function with generate extension, the CLI command fails with the following error:

Building GraphQL types ...
[FAILED]
[FAILED]       Unable to find any GraphQL type definitions for the following pointers:
[FAILED]

── external error ──────────────────────────────────────────────────────────────

Error coming from `npm exec -- graphql-code-generator --config package.json`

Command failed with exit code 1: npm exec -- graphql-code-generator --config package.json
[FAILED]
[FAILED]       Unable to find any GraphQL type definitions for the following pointers:
[FAILED]
[FAILED]           - src/*.graphql
[FAILED]
[STARTED] Parse Configuration
[SUCCESS] Parse Configuration
[STARTED] Generate outputs
[STARTED] Generate to ./generated/api.ts
[STARTED] Load GraphQL schemas
[SUCCESS] Load GraphQL schemas
[STARTED] Load GraphQL documents

Nick Wesselman | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Accepted Solution (1)

Nick_Wesselman
Shopify Staff
167 42 65

This is an accepted solution.

To resolve this issue, you should upgrade to Shopify CLI 3.49.5 or later using npm run shopify upgrade.

Nick Wesselman | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

View solution in original post

Replies 2 (2)

Nick_Wesselman
Shopify Staff
167 42 65

This is an accepted solution.

To resolve this issue, you should upgrade to Shopify CLI 3.49.5 or later using npm run shopify upgrade.

Nick Wesselman | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Dipen_M
Shopify Partner
6 2 0

Yes, I have upgrade the Shopify CLI 3.48.6 to latest version and It is also working for me. Thanks @Nick_Wesselman 

Shopify App Developer | Sharing Expert Insights