Has anyone used Table with graphql-code-generator's client preset?
At work, we use TanStack Table as well as the client-preset from graphql-code-generator. This lets us use fragment masking in our GraphQL queries. Basically, each component defines its own GraphQL fragment, and then it has to use an
useFragment
function to get that data from its props.
This doesn't seem to work nicely with TanStack Table. We'll define something like:
But there are two type errors:
- When we pass in the columns to DataTable, we get Property 'accessorFn' is missing in type 'ColumnDefBase<{ ' $fragmentRefs'?: { UserTableFragment: UserTableFragment; } | undefined; }, any> & StringHeaderIdentifier & ColumnDefMeta' but required in type 'AccessorFnColumnDefBase<Row, any>'
- When we define the cell
in each column, we get Property 'UserTableFragment' is missing in type '{ UserCellFragment: UserCellFragment; }' but required in type '{ UserTableFragment: UserTableFragment; }
Has anyone successfully gotten these two libraries to play nice together?0 Replies