slicknode/graphql-query-complexity

Support `extensions` property

MichalLytek opened this issue ยท 3 comments

As graphql-js now has a dedicated mechanism for storing additional metadata, we should use that to place and read complexity info from constructed types:
graphql/graphql-js#2097

ivome commented

This is great news... thanks for raising the issue! I added a new fieldExtensionsEstimator and added deprecation notices to the fieldConfigEstimator so we can remove this in future releases (plus those hacky TypeScript extensions of the GraphQL types we currently have).

those hacky TypeScript extensions of the GraphQL types we currently have

They are not so bad, it's better to provide typings for the properties because this will check the signature of function which results in better DX. However I haven't tried to merge declarations for extenstions as they might be typed as record with any ๐Ÿ˜•

ivome commented

I just published a new version v0.4.0 with this feature