question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

typed-document-node: camelCase exports by default?

See original GitHub issue

First of all, thank you for this amazing plugin!

By default it generates TypedDocumentNodes in PascalCase. While it makes sense for all generated TypeScript types, it probably should be camelCase for nodes as they are values rather than types. For example, typescript-react-apollo generates functions that start with lowercase letters.

There’s a config option namingConvention, but setting it to change-case-all#camelCase changes the case of types as well, which is not what we’re looking for.

It also looks like omitOperationSuffix property doesn’t work. Ideally, I would like to see the following being generated:

export const getUserQuery = ...;
export const deleteUserMutation = ...;

Is there a config property I’m missing?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
n1ru4lcommented, Sep 3, 2021

@A-Shleifman Can you send a PR with failing tests for omitOperationSuffix?

1reaction
dotansimhacommented, Aug 29, 2021

Hi! This issue is specific to codegen and not to this repo. I’m moving it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Naming Convention - GraphQL Code Generator
You need to provide a CJS module with a default export of a function that takes a string and returns a string. The...
Read more >
Naming Conventions · Styleguide JavaScript
Use camelCase when using export default for a function. The filename should be identical to your function's name. Examples. ⇣ Incorrect code for...
Read more >
apollo-typed-documents - npm
... export default authors; } declare module "*/createAuthor.graphql" { import { TypedDocumentNode } from "apollo-typed-documents"; ...
Read more >
Attribution - Sandtime.io
... @babel/plugin-proposal-dynamic-import · @babel/plugin-proposal-export-default-from · @babel/plugin-proposal-export-namespace-from ...
Read more >
License info, alfresco-ng2-components 5.1.0
Name Version License @alfresco/js‑api 5.1.0‑384 Apache‑2.0 @angular/animations 14.1.3 MIT @angular/cdk 14.1.2 MIT
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found