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

why is DefinitionType missing at runtime? #4788

Open
adrian-gierakowski opened this issue Dec 23, 2024 · 2 comments
Open

why is DefinitionType missing at runtime? #4788

adrian-gierakowski opened this issue Dec 23, 2024 · 2 comments

Comments

@adrian-gierakowski
Copy link

import { DefinitionType } from '@reduxjs/toolkit/query/react'

console.log(DefinitionType.query)

fails due to DefinitionType being undefined

given how DefinitionType is typed, I'd expect it to be available at run time

@phryneas
Copy link
Member

Good question - but it's not really meant to be used in userland, I think you're the first person who'd ever try to use it.

Why do you want to use it? It's literally just the strings query and mutation.

@adrian-gierakowski
Copy link
Author

adrian-gierakowski commented Dec 23, 2024

I’m working on integration between effect and rtk-query in which an api slice is generated for an effect’s Context.Tag and with the way it’s currently typed TSC is not happy when I try to simply use "query" or "mutation". I had to create my own enum to satisfy TSC here

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

No branches or pull requests

2 participants