Create resolver api#45
Conversation
|
I still notice one case that doesn't work, probably related to schema generation. When i query any union field for which the schema is generated by this branch, i get a graphql runtime error: e.g. results in |
| unionType = unionType.concat('_Union = ', unions.join(' | ')); | ||
| types.push(unionType); | ||
|
|
||
| references.push({ |
There was a problem hiding this comment.
i believe just pushing an object with just a parent and a uid is not sufficient to resolve queries afterwards, as demonstrated by the runtime error that is looking for an internal field with a type
There was a problem hiding this comment.
while debugging, i noticed the related_to field being resolved by the default resolver and not the custom resolver we register...
There was a problem hiding this comment.
it looks like not all reference fields get our custom resolvers registered, but some fallback to the default resolver, with the runtime error as consequence. Not sure why yet...
| }); | ||
| }); | ||
| groups.forEach(function (group) { | ||
| resolvers[group.parent] = (0, _defineProperty3.default)({}, group.field.uid, { |
There was a problem hiding this comment.
I believe this is the root cause of the remaining problem. References and groups can have the same parent, or multiple references/groups can have the same parent. In these cases, we are overwriting the previous resolver...
There was a problem hiding this comment.
See a7354b4 for a potential fix. This worked in my case...
There was a problem hiding this comment.
Thanks @jbertel2 for notifying this issue and fixing it. We appreciate your contribution here.

I would like to point out a potential issue, hence creating a PR to discuss this