GraphQL tutorial for LessWrong and Effective Altruism Forum
This post is a tutorial on using GraphQL to query for information about LessWrong and the Effective Altruism Forum. It's mostly intended for people who have wanted to explore LW/EA Forum data but have found GraphQL intimidating (this was the case for myself until several weeks ago). General steps for writing a query (This section will make more sense if you have seen some example queries; see next section.) For the queries that I know how to do, here is the general outline of steps: 1. Go to https://www.lesswrong.com/graphiql or https://forum.effectivealtruism.org/graphiql depending on which forum you want to query data for. 2. Figure out what the output type should be (e.g. comments, comment, posts, post). 3. Type {output_type(input)} into GraphiQL and hover over input. Here is what it looks like for the comment output type: Here is what it looks like for the comments output type: 4. Click on the type that appears after input (e.g. MultiCommentInput, SingleCommentInput). A column on the right should appear (if it was not there already). Depending on the fields listed in that column, there will now be two ways to proceed. (Generally, it seems like singular output types (e.g. comment) will have selector and plural output types (e.g. comments) will have terms.) Here is what it looks like for the comment output type. In the image, I have already clicked on SingleCommentInput so you can see selector under the documentation (rightmost) column. Here is what it looks like for the comments output type. Again, in this image, I have already clicked on MultiCommentInput so you can see terms under the documentation (rightmost) column. In the fields listed, if there is selector (e.g. for comment): * Click on the selector type (e.g. CommentSelectorUniqueInput). Use one of the fields (e.g. _id) to pick out the specific item you want. Here is what you should click o
I don't know what a schema is in Postman so I don't know how to help you, sorry. If you go here you can see the code I am currently using to make the HTTP requests, and you can grep around in that codebase to find calls to send_query, which will give you the GraphQL queries I use.