Open fabulator opened 11 months ago
I am open to suggestions on how this could be handled, but there isn't anything existing in the type system to support these kinds of changes. I recognize the problem but not sure if this is something that belongs in core.
I think a potential solution would be 2 changes:
forceResolver: boolean
option to expose fieldsforceResolver
required to be true
if the exposed field is a promise.I'm not sure how complex this would be, or if this is the best path forward, but that's the best thing that comes to mind immediately
Hello,
I have found a problem when using "expose" and GraphQL JIT. I have following example, that is correctly compiled by typescript:
I'm trying query
When JIT is not in plugins, I get correct response. When I use JIT, I see error String cannot represent value: {}. Because the name is Promise.
In Readme of JIT there is: "The primary limitation is that all computed properties must have a resolver and only these can return a Promise." Which is probably the problem. Fix is simple. I just put a resolver to property and it's working:
I was just wondering if there could be some settings for the builder, that could enforce that exposeString would required for property to be type of string and not promise. It could be usefull for JIT users and it would make usage with JIT more type safe.