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

QueryValue is highly recursive #320

Open
shonubijerry opened this issue Jan 29, 2025 · 2 comments
Open

QueryValue is highly recursive #320

shonubijerry opened this issue Jan 29, 2025 · 2 comments

Comments

@shonubijerry
Copy link

I use TypeScript and get TS error Type instantiation is excessively deep and possibly infinite.ts(2589) whenever I have below code.

import { QueryValueObject } from 'fauna'

type MyType = {
  name: string
} & QueryValueObject

myFunc = (payload: MyType) => {
 return payload
}

myFunc({ name: 'olu'})

I think the issue is from here export type QueryValue = looks like QueryValue is deeply recursive.

@shonubijerry
Copy link
Author

I resolved this by

type MyType = {
  name: string
} & Record<string, Omit<QueryValue, 'QueryValueObject'>>

@cleve-fauna
Copy link
Contributor

cleve-fauna commented Feb 5, 2025

Hi @shonubijerry try:

interface MyType extends QueryValueObject {
  name: string
}

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