Closed zwhitchcox closed 4 years ago
Actually, I find these APIs by reading the code of https://github.com/skygragon/leetcode-cli
Nice! Thank you!
Hey, can anybody please tell me all the endpoints of graphql leetcode api?
Hey, can anybody please tell me all the endpoints of graphql leetcode api?
from https://github.com/shuzijun/leetcode-editor/blob/master/src/main/java/com/shuzijun/leetcode/plugin/utils/URLUtils.java should be https://leetcode.com/graphql
Hi, I learned it today. It's not safe for a company to expose its graphql schema in production, so Leetcode disabled its introspection feature which will let everybody know all the schema. see https://www.apollographql.com/blog/graphql/security/why-you-should-disable-graphql-introspection-in-production/
But there is a workaround. You can open the leetcode website and check the browser network request search for graphql, there would be many graphql requests and you can try to find a needed pattern by reading the payload & response.
Here is an example of questionOfToday
from https://leetcode.cn/problemset/all/ you'll find similar results in leetcode.com though.
@Nitigya272001 I hope this could help you, and I know it's still so tricky because you need to guess some requests might happen on one specific page and read a lot of the web requests.
Hi, I learned it today. It's not safe for a company to expose its graphql schema in production, so Leetcode disabled its introspection feature which will let everybody know all the schema. see https://www.apollographql.com/blog/graphql/security/why-you-should-disable-graphql-introspection-in-production/
But there is a workaround. You can open the leetcode website and check the browser network request search for graphql, there would be many graphql requests and you can try to find a needed pattern by reading the payload & response.
Here is an example of
questionOfToday
from https://leetcode.cn/problemset/all/ you'll find similar results in leetcode.com though.
@Nitigya272001 I hope this could help you, and I know it's still so tricky because you need to guess some requests might happen on one specific page and read a lot of the web requests.
@TieWay59 Your solution came very in handy for me! Thank you very much!!
I've populated a list of all leetcode's GraphQL queries and its postman collection @ https://github.com/akarsh1995/leetcode-graphql-queries
I've been looking online, and I can't find any documentation for it. Nice solutions btw.