Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No index signature with a parameter of type 'string' was found on type 'ResolvedSomeListNameCreateInput | ResolvedSomeListNameUpdateInput'.ts(7053) #8485

Closed
adrianbienias opened this issue Apr 14, 2023 · 1 comment
Assignees
Labels
🐛 bug Unresolved bug

Comments

@adrianbienias
Copy link
Contributor

adrianbienias commented Apr 14, 2023

An example from the documentation Hooks - Keystone 6 Documentation

  SomeListName: list({
    access: allowAll,
    fields: {
      someFieldName: text({
        hooks: {
          resolveInput: async ({
            listKey,
            fieldKey,
            operation,
            inputData,
            item,
            resolvedData,
            context,
          }) => {
            /* ... */
            return resolvedData[fieldKey]
          },
        },
      }),
    },
  }),

produces a TypeScript error for resolvedData[fieldKey]

Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'ResolvedSomeListNameCreateInput | ResolvedSomeListNameUpdateInput'.
  No index signature with a parameter of type 'string' was found on type 'ResolvedSomeListNameCreateInput | ResolvedSomeListNameUpdateInput'.ts(7053)
@adrianbienias adrianbienias changed the title No index signature with a parameter of type 'string' was found on type 'ResolvedContactCreateInput | ResolvedContactUpdateInput' o index signature with a parameter of type 'string' was found on type 'ResolvedSomeListNameCreateInput | ResolvedSomeListNameUpdateInput'.ts(7053) Apr 14, 2023
@adrianbienias adrianbienias changed the title o index signature with a parameter of type 'string' was found on type 'ResolvedSomeListNameCreateInput | ResolvedSomeListNameUpdateInput'.ts(7053) No index signature with a parameter of type 'string' was found on type 'ResolvedSomeListNameCreateInput | ResolvedSomeListNameUpdateInput'.ts(7053) Apr 14, 2023
@borisno2 borisno2 added the 🐛 bug Unresolved bug label Apr 24, 2023
@dcousens
Copy link
Member

dcousens commented Nov 14, 2023

Fixed in 033cde4 as part of #8551

@dcousens dcousens self-assigned this Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Unresolved bug
Projects
None yet
Development

No branches or pull requests

3 participants