Skip to content

Fix broken types for field groups and access functions#8617

Merged
dcousens merged 8 commits intomainfrom
groups-types
Jun 8, 2023
Merged

Fix broken types for field groups and access functions#8617
dcousens merged 8 commits intomainfrom
groups-types

Conversation

@dcousens
Copy link
Copy Markdown
Member

@dcousens dcousens commented Jun 8, 2023

#8570 introduced Session types to a number of the Typescript types throughout a typical Keystone configuration, and actually strengthened the types to the degree that a number of existing configurations became unreasonable to fix, like when using groups.

group didn't actually support using a refined ListTypeInfo type, which led to types that you couldn't actually fix without explicitly using group<any, Lists.Post.TypeInfo>, which isn't ideal, or necessary.

This pull request fixes this problem that so group will now continue to work in code where ListTypeInfo has been refined from BaseListTypeInfo (the default), without explicitly requiring type parameters.

This pull request also should fix #8616 by returning the exact types of the literal functions provided instead of attempting to automatically infer them. When users (like @Thinkscape) are using type prefixes like lists: Lists, this shouldn't break their code now.

@changeset-bot

This comment was marked as resolved.

@dcousens dcousens changed the title Fix broken types for field groups and all operations function Fix broken types for field groups and access functions Jun 8, 2023
@dcousens dcousens self-assigned this Jun 8, 2023
@dcousens dcousens merged commit 9ad71cf into main Jun 8, 2023
@dcousens dcousens deleted the groups-types branch June 8, 2023 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tsc compilation fails with TS 5.0.4+ and core@5.3.0

2 participants