zalando-incubator / graphql-jit

GraphQL execution using a JIT compiler
https://try-graphql-jit.boopathi.in/
Other
1.05k stars 57 forks source link

doesn't handle resolveType that returns a promise #69

Open benawad opened 4 years ago

benawad commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

redmundas commented 4 years ago

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

ChristianBoehlke commented 4 years ago

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 commented 3 years ago

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

PabloSzx commented 3 years ago

Any updates on this issue?

hayes commented 2 years ago

Looks like isTypeOf also does not support promises