bkstorm/graphql-fields-list

Support function type form transform in FieldsListOptions

Opened this issue · 0 comments

Here is the definition of FieldsListOptions:
export interface FieldsListOptions { path?: string; transform?: FieldNamesMap; withDirectives?: boolean; skip?: string[]; }
Problem: transform is just a key-value object. If I want to add a prefix (or suffix) to all fields, I have to define all of them.
Solution: add function type for transform which converts old value to new value, like the argument of the map method of Array.