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.

Naming convention of types

See original GitHub issue

I am unsure whether or not I have missed a configuration step, but my generated types for arrays is looking like this after upgrading to 0.14.1:

export namespace GetMachinesForFleetInventory {
  export type Variables = {};

  export type Query = {
    __typename?: "Query";

    machines: Machines[] | null;
  };

  export type Machines = {
    __typename?: "Machine";

    id: number;

    model: string | null;

    category: string | null;

    brand: string | null;

    productionDate: Date | null;
  };
}

I would really want Machines[] to be Machine[] (the __typename), as working with them in singular form.

Is there a configuration for this? 😃

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
janhartmanncommented, Nov 20, 2018

I can see why the codegen does this, and maybe I just need to adjust my mind to this naming.

I guess I am just used to have a Machine and when its an array its Machine[]. So the __typename is the one defining the type 😃

0reactions
codepunktcommented, Mar 21, 2019

@dotansimha Thanks for your work! 😃

New version, new problems. See #1535

Read more comments on GitHub >

github_iconTop Results From Across the Web

Naming convention (programming) - Wikipedia
In computer programming, a naming convention is a set of rules for choosing the character sequence to be used for identifiers which denote...
Read more >
Coding best practices
Variable Naming Conventions¶. Variable naming is an important aspect in making your code readable. Naming variables follow a simple idea: Create variables that ......
Read more >
Programming Naming Conventions – Camel, Snake, Kebab ...
What are Naming Conventions in Programming? · Camel Case · Snake Case · Kebab Case · Pascal Case.
Read more >
Naming Conventions - Devopedia
In general, use nouns for classes, verbs for functions, and names that show purpose for variables, attributes and arguments. Avoid (Systems) ...
Read more >
9. Naming Conventions - Oracle
9 - Naming Conventions ; Classes, Class names should be nouns, in mixed case with the first letter of each internal word capitalized....
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