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

doesn't handle resolveType that returns a promise #69

Open
benawad opened this issue Jan 8, 2020 · 7 comments
Open

doesn't handle resolveType that returns a promise #69

benawad opened this issue Jan 8, 2020 · 7 comments

Comments

@benawad
Copy link

benawad commented Jan 8, 2020

For abstract types, graphql-js handles resolveType if it's a promise https://github.com/graphql/graphql-js/blob/e590dd2b6f1d05085fbb057fe357be957378bcfb/src/execution/execute.js#L967

graphql-jit currently does not https://github.com/zalando-incubator/graphql-jit/blob/master/src/execution.ts#L896

this normally wouldn't cause a problem because most people don't return a promise from resolveType, but type-graphql converts all resolveTypes to return promises so I'm running into this.

@ruiaraujo
Copy link
Collaborator

Thanks for the issue.

While there are plans to address these limitations, I would also explore removing this behavior from type-graphql, those redundant promises do add overhead and prevent v8 optimizations.

@benawad
Copy link
Author

benawad commented Jan 9, 2020

Yep already done, just wanted to let you know in case you haven't run across this edge case.

@redmundas
Copy link

I have the same problem. is there a solution other than forking type-graphql?

@ChristianBoehlke
Copy link

Hello! We're using this library and have a use case in which we would like to resolve the type of some interfaces asynchronously. @ruiaraujo, do I understand you correctly that this is something you would like to support (regardless of the redundant type-graphql case)? Can you already say if this is something in the near or distant future?

@kaushik143
Copy link

kaushik143 commented Jan 12, 2021

Does the library now support resolving the type of some interface asynchronously?

@PabloSzx
Copy link

Any updates on this issue?

@hayes
Copy link

hayes commented Feb 11, 2022

Looks like isTypeOf also does not support promises

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

7 participants