Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GraphQL Support #39

Closed
Richienb opened this issue Jul 25, 2020 · 5 comments
Closed

Add GraphQL Support #39

Richienb opened this issue Jul 25, 2020 · 5 comments

Comments

@Richienb
Copy link
Contributor

It would be useful if gh-got provided a graphql function that made requests using the GitHub GraphQL API v4.

// @sindresorhus

@sindresorhus
Copy link
Owner

Agreed

@fregante
Copy link
Contributor

fregante commented Oct 8, 2020

I just remembered about this wrapper. Why would one use it instead of the official ones?

https://github.com/octokit/rest.js
https://github.com/octokit/graphql.js

First party, well typed, paginated, etc

@sindresorhus
Copy link
Owner

@fregante The official clients came out (or rather was officially adopted by GitHub) two years after this package was made.

This package is mostly just useful if you want low overhead and just need a couple of API calls.

We should definitely add those packages to the readme as recommendations.

@fregante
Copy link
Contributor

fregante commented Oct 8, 2020

two years after this package was made

I'm aware, but I'm very quick to deprecate my own packages when I see someone found a better solution. Specifically for this issue I don't think it's a good investment to add GraphQL here when there's already something.

package is mostly just useful if you want low overhead

I think got has more overhead than you think 😅

❯ npx package-size gh-got @octokit/rest

  package               size       minified   gzipped
  gh-got@9.0.0          755.86 KB  221.33 KB  68.36 KB
  @octokit/rest@18.0.6  128.98 KB  59.06 KB   12.67 KB

Edit: the install size differs however due to >2 MB of Types in Octokit:

https://packagephobia.com/result?p=gh-got
https://packagephobia.com/result?p=%40octokit%2Frest

@sindresorhus
Copy link
Owner

You're right. No reason to use this package, unless you really want raw access to the endpoints for some reason. And no point in adding more features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants