graphile-engine icon indicating copy to clipboard operation
graphile-engine copied to clipboard

Fix return type of simplifyParsedResolveInfoFragmentWithType

Open dhritzkiv opened this issue 7 months ago • 1 comments

Description

Specify type as ResolveTree for returned fields in simplifyParsedResolveInfoFragmentWithType. Otherwise, the return type is simply {} which is not indexable in TS.

Checklist

  • [x] My code matches the project's code style and yarn lint:fix passes.
  • [ ] I've added tests for the new feature, and yarn test passes.
  • [ ] I have detailed the new feature in the relevant documentation.
  • [ ] I have added this feature to 'Pending' in the RELEASE_NOTES.md file (if one exists).
  • [x] If this is a breaking change I've explained why.

dhritzkiv avatar May 13 '25 21:05 dhritzkiv

Sorry about that – I didn't see that tests fail when I initially submitted this PR.

I've now changed the syntax to allow for treating fields as ResolveTree, when initializing it.

dhritzkiv avatar Jun 11 '25 16:06 dhritzkiv

fields isn't actually a ResolveTree; it's a Record<string, ResolveTree>. Whilst reworking this I spotted a bug in the merging, so I've raised an alternative fix in #873.

benjie avatar Jul 07 '25 10:07 benjie