graphql-schema
graphql-schema copied to clipboard
Actor type is generated incorrectly
Hi,
The actor type seems to be generated incorrectly, based on the exported type:
/** Represents an object which can take actions on GitHub. Typically a User or Bot. */
export type Actor = {
/** A URL pointing to the actor's public avatar. */
avatarUrl: Scalars['URI'];
/** The username of the actor. */
login: Scalars['String'];
/** The HTTP path for this actor. */
resourcePath: Scalars['URI'];
/** The HTTP URL for this actor. */
url: Scalars['URI'];
};
https://github.com/octokit/graphql-schema/blob/master/schema.d.ts#L71-L80
However, I can also query user or bot properties off of this (as mentioned by the comment); seems as if the correct definition would be:
export type Actor = (User | Bot) & {
...
};
Happy to make a pull request; however this seems auto-generated by another package (https://github.com/dotansimha/graphql-code-generator#readme), so wanted to first ask if anyone here had any insight before escalating the problem there?
Hi @tomasreimers! Yeah the types are autogenerated and contributed by the community. I'm not using them myself yet. It sounds like something that would need to be resolved in https://github.com/dotansimha/graphql-code-generator#readme?
Okay, bug filed here: https://github.com/dotansimha/graphql-code-generator/issues/6539
I couldn't find a previous discussion, but I have to imagine this has been discussed before. Let's see what they say!
The fix suggested in https://github.com/dotansimha/graphql-code-generator/issues/6539 does work and is part of my fork which is also published to npm, with automatic updates enabled:
- Forked repository: zhouzi/graphql-schema
- npm package: github-graphql-schema
:tada: This issue has been resolved in version 13.9.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket: