Skip to content

homebound-team/graphql-id-linter

Repository files navigation

graphql-id-linter

According to apollo-client's issue 2510, the apollo client really, really wants you to include ids in every query that touches a type, so that it can maintain its cache.

In theory this is getting fixed in apollo-client 3.0-beta, but always returning id is probably not a bad idea anyway.

Credits, this is a ~80% copy/paste of Cecchi's solution on this comment.

Install

yarn add -D @homebound/graphql-id-linter

Include it in your graphql-codegen.yml:

schema: ./schema.json
documents: src/**/*.graphql
generates:
  src/generated/graphql-types.tsx:
    plugins:
      - "@homebound/graphql-id-linter"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published