zyv4yk commented on issue #9085:
URL: https://github.com/apache/devlake/issues/9085#issuecomment-5482335515
Correction to the fix sketch above: the struct shape I proposed does not
work, and the PR takes a different route.
`GraphqlInlineAccountQuery` is not used only for `Actor` fields. It is also
used where the schema says `User` — PR and issue assignees, and
`commit.author.user`. Spreading `... on Bot` on those makes GitHub reject the
entire query:
```
gh api graphql -f query='
{ repository(owner:"grafana", name:"grafana") { pullRequest(number:131544) {
assignees(first:1){ nodes { ... on User { login } ... on Bot { login } } }
} } }'
{"errors":[{"extensions":{"code":"cannotSpreadFragment","typeName":"Bot","parentName":"User"},
"message":"Fragment on Bot can't be spread inside User"}]}
```
Same error on `commits.nodes.commit.author.user`. So adding the fragment to
the existing type would not just miss the fix, it would break PR and issue
collection outright.
#9086 splits it in two instead: `GraphqlInlineAccountQuery` keeps its
current `User`-only shape, and a new `GraphqlInlineActorQuery` carries `... on
User` + `... on Bot` for the four genuinely `Actor`-typed fields
(`PullRequest.author`, `PullRequest.mergedBy`, `PullRequestReview.author`,
`Issue.author`). Both expose an `Account()` accessor so the extractors read one
normalized account.
The rest of the report stands, including the `[bot]` suffix difference
between `Bot.login` and the REST login.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]