Posts about GraphQL
Hi, r/Python.
I wanted to share my library – twscrape – makes easy to collect data from tweets via authorized accounts. Since Twitter recently restricted public access to search, I created this library to help me continue gathering data for my own projects. Here are some of the features it offers:
Automatic authorization of accounts with receiving verification code on email
Pool of accounts which can collect data asynchronously
Automatic account switching when rate limit reached
Saving & re-using session
Both Search & GraphQL API
RAW & SNScrape data format (easy to adapt your processing script if you have worked with SNScrape before)
I hope that twscrape will not only benefit me, but also prove to be a valuable tool for community. You can find the library on GitHub at https://github.com/vladkens/twscrape
Thank you for considering it!
We just soft-launched Inigo Analytics for GraphQL APIs -- it's self-serve (and quick) to try out.
The tool provides in-depth (and zero-config) GraphQL analytics. You get query-level inspection and analytics, granular search filters, performance metrics, schema planning/coverage/heatmaps, error breakdowns, aggregate and latency views, smart widgets, and usage heatmaps. It integrates with all of the most popular GraphQL servers, and supports billions of monthly queries.
If you’re looking to add GraphQL analytics to your API stack or want an Apollo Studio alternative, Inigo Analytics is ready to go.
You can try it out yourself, or happy to walk you and your team through a demo.
You may have the fortune of being familiar with the jOOQ library for Java/JVM apps, that can generate domain models based on your database schema, as well as methods on these classes to perform queries. In case you're not, here's an example. Based on this Postgres schema,
TABLE User {
id SERIAL PRIMARY KEY,
name VARCHAR(30),
age INTEGER
}
jOOQ would generate classes USER, ID, NAME and AGE, which would be fully type-checked, meaning the methods available on these classes would be based on their respective types in the database, allowing queries such as:
import com.domain.generated.tables.USER;
import com.domain.generated.tables.pojos.User;
import static org.jooq.impl.DSL.select;
List<User> usersAged30NotNamedDave =
select(USER.ID, USER.NAME, USER.AGE)
.from(USER)
.where(USER.AGE.eq(30))
.and(USER.NAME.ne("Dave"))
.fetchInto(User.class);
...
As you can see, this is extremely useful for removing boilerplate, ensuring type-safety, and making sure any query you write will be valid.
I'm hoping there exists a Typescript library that generates typed GraphQL in a similar way to this. None of the ones I've found so far have all these features: as far as I can tell, they mostly seem to generate types based on your server's schema, but then still require you to manually write queries in the form of multiline strings or similar, as opposed to having methods on the generated types that let you perform queries in a jOOQ-like way. Thank you for any help!