Graphql-code-generator: Error: upperCase couldn't be found in module upper-case!

Created on 7 Jan 2020  ·  8Comments  ·  Source: dotansimha/graphql-code-generator

Describe the bug
Error: upperCase couldn't be found in module upper-case!

image

To Reproduce
use namingConvention like

 config: {
    strict: true,
    namingConvention: {
      default: "change-case#pascalCase",
      enumValues: "change-case#upperCase"
    }
  },
bug core waiting-for-release

Most helpful comment

It should be enumValues: upper-case#upperCase

All 8 comments

Until we fix it, could you install upper-case npm package in your project?

upper-case was already installed though version 1.x. after upgrading to 2.x it's running now.

I made the last update. to ensure that I deleted the node_modules folders and reinstalled all packages. I have that same problem.

@OneCyrus @umutyerebakmaz Could you try with the canary version 1.11.2-alpha-6bc83503.0?

Fixed in v1.12.0

I'm having this issue using 1.15.5.

output:

> graphql-codegen --config codegen.yml --watch

  ✔ Parse configuration
  ❯ Generate outputs
    ❯ Generate src/generated/graphql.tsx
      ✔ Load GraphQL schemas
      ✔ Load GraphQL documents
      ✖ Generate
        → undefined couldn't be found in module upper-case!


 Found 1 error

  ✖ src/generated/graphql.tsx
    Error: undefined couldn't be found in module upper-case!
        at Object.resolveExternalModuleAndFn (/Users/anault/Projects/apollo-project/client/node_modules/@graphql-codegen/plugin-helpers/index.cjs.js:27:15)

codegen.yml:

overwrite: true
schema: "../server/schema.graphql"
documents: "src/**/*.graphql"
generates:
  src/generated/graphql.tsx:
    config:
      reactApolloVersion: 3
      withHooks: true
      withComponent: false
      withHOC: false
      namingConvention:
        enumValues: upper-case
    plugins:
      - typescript
      - typescript-operations
      - typescript-react-apollo

It should be enumValues: upper-case#upperCase

@ardatan Aha! The styling in the documentation's code blocks made it seem like #upperCase was a comment.

Was this page helpful?
0 / 5 - 0 ratings