Coder Social home page Coder Social logo

correttojs / graphql-codegen-apollo-cache Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 1.0 1.98 MB

GraphQL Code Generator plugin for generating a functions to read and write from the apollo cache

TypeScript 99.40% JavaScript 0.60%
graphql codegen typescript apollo-client apollo-cache-inmemory graphql-code-generator graphql-codegen

graphql-codegen-apollo-cache's Introduction

Caffè corretto ☕🥃

Caffè corretto, an Italian beverage, consists of a shot of espresso with a small amount of liquor, usually grappa, and sometimes sambuca or brandy. It is also known (outside Italy) as an "espresso corretto".

Most Italian bartenders prepare a caffè corretto simply adding a few drops of the desired liquor into an espresso shot; however in some cases the liquor is served in a shot alongside the coffee allowing the customer to pour the quantity they desire. A few bartenders also let their regular customers make their drink themselves providing the espresso shot and the bottle of liquor.

The Italian word corretto reminds the (supposed) soundness of my code

JavaScript Nodejs Next.js Vercel React TypeScript GraphQL Deno

Top Langs

Hellas Verona 💙💛

last matches:

Hellas Verona FC Hellas Verona FC - Udinese Calcio: 1 - 0 😄💙💛
Atalanta BC Atalanta BC - Hellas Verona FC: 2 - 2 😐
Hellas Verona FC Hellas Verona FC - Genoa CFC: 1 - 2 😭
Cagliari Calcio Cagliari Calcio - Hellas Verona FC: 1 - 1 😐
Hellas Verona FC Hellas Verona FC - AC Milan: 1 - 3 😭

next match:

Hellas Verona FC Hellas Verona FC - FC Internazionale Milano

Thanks Deno for the auto updated page

graphql-codegen-apollo-cache's People

Contributors

correttojs avatar dependabot[bot] avatar renovate-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

burnsco

graphql-codegen-apollo-cache's Issues

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

Rate Limited

These updates are currently rate limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency standard-version to v9.3.2
  • chore(deps): update dependency graphql to v15.6.1
  • chore(deps): update dependency typescript to v4.4.4
  • fix(deps): update dependency auto-bind to v5

Other Branches

These updates are pending. To force PRs open, click the checkbox below.

  • chore(deps): update dependency set-value to 4.0.1 [security]

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.


  • Check this box to trigger a request for Renovate to run again on this repository

generate error

my config:

# https://graphql-code-generator.com/docs/plugins/typescript-react-apollo

overwrite: true
schema: src/service/generated/schema.dev.graphql
documents: 'src/service/gql/*.gql'
hooks:
  afterAllFileWrite:
    - prettier --write "src/**/*.+(js|jsx|ts|tsx|json|yml|yaml|scss|css|md)"
generates:
  src/service/generated/component.tsx:
    plugins:
      - typescript
      - typescript-operations
      - typescript-react-apollo
    config:
      withHOC: false
      withHooks: true
      withComponent: false
      skipTypename: true
      nonOptionalTypename: true
      addDocBlocks: false
  src/service/generated/cache.tsx:
    config:
      documentMode: external
      importDocumentNodeExternallyFrom: ./component
    preset: import-types
    presetConfig:
      typesPath: ./component
    plugins:
      - graphql-codegen-apollo-cache

but the generated file has some error:

  • more space
  • unsorted import
  • extra comma
  • unexported type
import * as Types from './component';

import * as Operations from './component';
import  { NormalizedCacheObject, defaultDataIdFromObject } from 'apollo-cache-inmemory';
import type { ApolloClient } from 'apollo-client';








export function readFragmentaction(cache: ApolloClient<NormalizedCacheObject>, fragmentId: string) {
                return cache.readFragment<Types.actionFragment>({
                    id: defaultDataIdFromObject({id: fragmentId, __typename: 'Action'}),
                    fragment: Operations.actionFragmentDoc,,
                    fragmentName: 'action',
                })
            };
export function readFragmentpageInfo(cache: ApolloClient<NormalizedCacheObject>, fragmentId: string) {
                return cache.readFragment<Types.pageInfoFragment>({
                    id: defaultDataIdFromObject({id: fragmentId, __typename: 'PaginationInfo'}),
                    fragment: Operations.pageInfoFragmentDoc,,
                    fragmentName: 'pageInfo',
                })
            };
export function readFragmentcluster(cache: ApolloClient<NormalizedCacheObject>, fragmentId: string) {
                return cache.readFragment<Types.clusterFragment>({
                    id: defaultDataIdFromObject({id: fragmentId, __typename: 'Group'}),
                    fragment: Operations.clusterFragmentDoc,,
                    fragmentName: 'cluster',
                })
            };

image

extra info:

  • node v12.16.1
  • "@graphql-codegen/cli": "^1.15.4"
  • "@graphql-codegen/schema-ast": "^1.15.4"
  • "@graphql-codegen/typescript": "1.15.4"
  • "@graphql-codegen/typescript-operations": "1.15.4"
  • "@graphql-codegen/typescript-react-apollo": "1.15.4"
  • "typescript": "~3.9.5",

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.