Comments (15)
Not directly for the @octokit/graphql
method. But we do have a plugin for @octokit/rest
: https://github.com/octokit/plugin-throttling.js
Let me get back to you on how to use the plugin with @octokit/graphql
, it’s not straight forward at this point. I’m currently working on other things so it will take a while I’m afraid. But if you want to look into it yourself and have any questions, I’d be happy to help you out
from graphql.js.
That's looks straight to the point!
I guess, @octokit/rest
does not include @octokit/graphql
.
Would be great if I could use this plugin.
from graphql.js.
https://github.com/octokit/plugin-throttling.js does include special throttling for @octokit/graphql
now. It’s still not usable with @octokit/rest
, but if you don’t want to wait, here is how we use it in probot:
Note that it’s using internal APIs, so make sure to pin the @octokit/graphql
version for the time being
from graphql.js.
I'm working on the Octokit Core library which will include the .graphql
method, but also the plugin API. So you will be able to load the throttle plugin.
Initial version should be ready soon: octokit/core.js#3
from graphql.js.
octokit/core.js#3 is resolved now, does that mean this is ready for action now? Examples of how to integrate with @octokit/graphql
would be great!
from graphql.js.
I'm open to suggestions. Throttling with GraphQL is much more complicated then it is with REST. @ReaLoretta gave a great talk on advanced GraphQL patterns such as this at GitHub Universe: https://www.youtube.com/watch?v=i5pIszu9MeM.
We are looking into creating a GraphQL pagination plugin too: octokit/plugin-paginate-graphql.js#1
from graphql.js.
We're about to dive into some octokit graphql work. What is the recommended way to perform simple throttling/rate limiting at this point?
from graphql.js.
Use the throttle plugin, it has some throttle logic specific to GraphQL built in, but I don't think it covers it all yet. As mentioned above GraphQL is much more complicated compared to the REST API, throttling alone won't help you if your queries are to complex. Make sure to watch Rea's talk that I've linked above.
The original issue is resolved, so I'm going to close the issue. @octokit/rest
is now built on @octokit/core
, both can utilize the throttle plugin in the same way.
from graphql.js.
Apologies for pulling on an old thread, I've been looking through the repo and it's not clear to me how to integrate a plugin with the current graphql implementation. Is there a way to pass an Octokit instance to this library that I am missing?
from graphql.js.
This library exports a stateless graphql
function. You can use @octokit/core
, which includes the octokit.graphql
method on each instance
from graphql.js.
Hi! I also stumbled upon this thread and don't see a solution to this issue.
Proposal: Can this be reopened until someone contributes a functional code example of @octokit/graphql.js with rate limiting / retrying / etc?
from graphql.js.
https://github.com/octokit/plugin-throttling.js/ and https://github.com/octokit/plugin-retry.js now both handle GraphQL queries. We recommend you use the octokit
package which has it all included
import { Octokit } from "octokit"
const octokit = new Octokit({ auth: TOKEN })
const result = await octokit.graphql(query, variables)
from graphql.js.
In order to use the plugin-throttling , we moved from the @octokit/graphql package to the "octokit" package like the example . We now able to use throttle with graphql but we are getting now a warning in the console browser :
![Screenshot 2024-08-11 at 10 45 15](https://private-user-images.githubusercontent.com/176222269/356858639-eebd31ba-9e4e-433a-9949-b4a27f563a82.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1NDE3MjcsIm5iZiI6MTcyNDU0MTQyNywicGF0aCI6Ii8xNzYyMjIyNjkvMzU2ODU4NjM5LWVlYmQzMWJhLTllNGUtNDMzYS05OTQ5LWI0YTI3ZjU2M2E4Mi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODI0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyNFQyMzE3MDdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iMjliMDc5MWNlN2Q1OGI1OWMwZGYzZWM0ZWM1YjNkZGUzZDM3NGUzNjU1MGFhNGE2N2VmMzg1NzZkNzk1N2JhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.ri9G1q6om8HLvpRbWaKcANHlE5Oghaf2ovdstm9ZSAE)
Someone know why the browser interpret the module as Node Js module ?
from graphql.js.
Please use the ESM.sh build for browser usage.
import { Octokit } from "https://esm.sh/octokit";
from graphql.js.
Please use the ESM.sh build for browser usage.
import { Octokit } from "https://esm.sh/octokit";
How i am supposed to install it ?
Currently getting :
Cannot find module 'https://esm.sh/octokit' or its corresponding type declarations.ts(2307)
from graphql.js.
Related Issues (20)
- Deployment branch rules in environments cause error
- variables aren't working HOT 2
- Requests for Projects (Beta) via graphql return wrong results HOT 2
- I don't think it's necessary. If you really need a defaults callback then you can use https://github.com/octokit/core.js which does support it. HOT 1
- GitHub GraphQL cursor Pagination on first request HOT 1
- How to populate Int Variables in Typescript HOT 2
- Remove Node version 10 from .github/workflows/test.yml
- ci: use `test_matrix` and `test` jobs HOT 1
- How to add connection timeout constraint HOT 3
- "An operation name is required if the query contains multiple operations" HOT 2
- Accidental release of `octokit-next.js` to `@octokit/graphql` HOT 6
- Accidental release of `octokit-next.js` to `@octokit/graphql` HOT 1
- Possibility to use custom reviver in deserialization? HOT 2
- Cannot fetch more than 100 branches, even when using pagination
- [BUG]: Uncaught TypeError: Cannot read properties of undefined (reading 'map') - HOT 3
- How can I retrieve the date an issue was added to a projectV2 using Github's GRAPHQL api? HOT 3
- [FEAT]: Return type for TS HOT 5
- [FEAT]: GraphQL: Ensure Order of [Processing of] Mutations HOT 3
- [BUG]: getting unicorn HTML in an error response HOT 5
- [FEAT]: Custom Properties (Queryable & Mutation to set/update). HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql.js.