@data-eden/codegen
TypeScript icon, indicating that this package has built-in type declarations

0.18.0 • Public • Published

@data-eden/codegen

Usage

When writing imports it is important to follow a pattern for queries, mutations and fragments.

As we want to avoid too much work in the babel side we assume convention to offset actual work to the codegen process.

Convention

This showcases the convention for Fragments, but the same applies to oeprations such as Queries and Mutations.

GOOD

const userFieldsFragment = gql`
  fragment UserFields on User {
    id
    username
    role
  }
`;

BAD

const UserFieldsFragment = gql`
  fragment UserFields on User {
    id
    username
    role
  }
`;
const userFields = gql`
  fragment UserFields on User {
    id
    username
    role
  }
`;

/@data-eden/codegen/

    Package Sidebar

    Install

    npm i @data-eden/codegen

    Weekly Downloads

    0

    Version

    0.18.0

    License

    MIT

    Unpacked Size

    25.2 MB

    Total Files

    55

    Last publish

    Collaborators

    • cafreeman
    • hjdivad
    • gabrielcsapo
    • rwjblue