Skip to content

require-selections - allow configuring id fields per entity #2933

@ItaiYosephi

Description

@ItaiYosephi

Is your feature request related to a problem? Please describe.

In apollo client, it's possible to customize the cache IDs for entities. I would like to be able to do match those in the require-selections rule.

Describe the solution you'd like

I would like to add an option to override the required selections per entity per project, for example:

'@graphql-eslint/require-selections': [
  'error',
  {
    overrides: {
      project1: {
        Person: ['name', 'email'],
      },
      project2: {
        Product: ['upc'],
        // If one of the keyFields is an object with fields of its own, you can
        // include those nested keyFields by using a nested array of strings:
        Book: ['title', 'author', ['name']],
      },
    },
  },
],

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions