octokit / graphql-schema

GitHub’s GraphQL Schema with validation. Automatically updated.
MIT License
176 stars 62 forks source link

[FEAT]: Connection objects should have fewer nullable fields #983

Closed jyasskin closed 2 weeks ago

jyasskin commented 2 weeks ago

Describe the need

I'm using graphql-codegen to get typescript types for the return values of queries to github, using https://github.com/octokit/graphql-schema/blob/main/schema.graphql as the schema. I've noticed that, for example, in a repository(...){issues(...) {nodes{...}}} query, the result.repository.issues.nodes field can be null, and if it's not, then elements of that array can be null. The meaning of that result isn't addressed in the documentation, and I hope it's impossible. If it is impossible, I think https://github.com/octokit/graphql-schema/blob/abea5069314512040ec6c1385cddc118785f59c2/schema.graphql#L18846 should be typed as nodes: [Issue!]! rather than the current nodes: [Issue].

Every Connection and Edge type has this issue, and it'd be nice if someone at Github would check if null results are actually possible.

SDK Version

No response

API Version

No response

Relevant log output

No response

Code of Conduct

github-actions[bot] commented 2 weeks ago

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

wolfy1339 commented 2 weeks ago

The schema is downloaded from GitHub directly, we have no control over it's contents

jyasskin commented 2 weeks ago

Whoops, sorry for the noise then. I've opened a discussion at https://github.com/orgs/community/discussions/139032, in the hope that that's the right place for this sort of feedback.

wolfy1339 commented 2 weeks ago

That wold indeed be the proper channel for these types of issues.