Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Default Apollo Hooks rather than generated HOC for Apollo Queries #177

@chrischen

Description

@chrischen

"Why Hooks are the future"
https://blog.apollographql.com/apollo-client-now-with-react-hooks-676d116eeae2

Hooks have been declared as the future of Apollo client, and also reduces the bundle size (if you only use the apollo hooks API for querying.

Maybe modify codegen.yml to emit hooks like in this example from the internet:

 models.tsx:
    documents: "packages/files-client-state/src/**/*.gql"
    schema: 
      - ./packages/client-state/src/**/*.graphql
      - ./packages-modules/module/server/src/graphql/**/*.graphql
    config:
        namingConvention: keep
        typesPrefix: I
        withMutationFn: true
        withHOC: true
        withComponent: true
        withHooks: true
    preset: "@cdmbase/import-types-preset"
    presetConfig:
      typesPath: "core"
      importTypesNamespace: SchemaTypes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions