aylei / leetcode-rust

my leetcode solutions in rust
Apache License 2.0
717 stars 141 forks source link

Where did you guys find that graphql api? #12

Closed zwhitchcox closed 4 years ago

zwhitchcox commented 4 years ago

I've been looking online, and I can't find any documentation for it. Nice solutions btw.

aylei commented 4 years ago

Actually, I find these APIs by reading the code of https://github.com/skygragon/leetcode-cli

zwhitchcox commented 4 years ago

Nice! Thank you!

Nitigya272001 commented 2 years ago

Hey, can anybody please tell me all the endpoints of graphql leetcode api?

alexhuang091 commented 2 years ago

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

TieWay59 commented 1 year ago

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.

image

@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.

DavidTeju commented 1 year ago

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.

image

@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!!

akarsh1995 commented 1 year ago

I've populated a list of all leetcode's GraphQL queries and its postman collection @ https://github.com/akarsh1995/leetcode-graphql-queries