When working with resolves we see that graphback resolvers are returned as array where most of the people will expect this to be just single object. Any reason why we have this.
Most of the frameworks will return error when dealing with array.
[Error: "0" defined in resolvers, but not in schema]
After debugging I see that the second object is completely empty and redundant.
Maybe that is because of the data sync extensions?
{"Query":{},"Mutation":{},"Subscription":{}
CC @ssd71
Yes, it is possible for the datasync plugin to return an empty resolvers object, that happens when no resolvers are added, the primary reason for this may be that it doesn't detect any datasync models, definitely have to fix that behaviour
When working with resolves we see that graphback resolvers are returned as array where most of the people will expect this to be just single object. Any reason why we have this.
I think we introduced this as part of https://github.com/aerogear/graphback/pull/1455 to allow the ability to add custom resolvers https://github.com/aerogear/graphback/blob/master/packages/graphback-core/src/plugin/GraphbackCoreMetadata.ts#L47
Ah.. I would expect this to return single objects and resolver to be merged instead of having array.
I actually they're is separate bug - have datasync configured and I should be getting resolvers but second object appears empty - also sync doesn't work so let's triage this - it might be very simple fix but do not want to rush this and merge without discussion with @craicoverflow
The array confused me, and I haven't seen this done before. I would much prefer resolvers to be an object
it might be very simple fix but do not want to rush this and merge without discussion with @craicoverflow
It was an oversight on my behalf, no need to wait for me on a fix like this.
Most helpful comment
It was an oversight on my behalf, no need to wait for me on a fix like this.