Skip to content

mrlapizgithub/replit-query

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

REPL.IT QUERY

In this repl.it API, I plan to take advantage of everything. Adapted from replya.

Quickstart

const replit = require("replit-query")();
await replit.login("username", "password");
...

Documentation

Each of these examples will require an instance of the client.

const client = require("replit-query")();

Query

This is the root of basically all applications. PARAMS query: This is what will be your query. It will be implemented like this:

{
  query
}

You may want to read up on graphQL. RETURN A return value will look something like

{
  ...
}

query

await client.query('userByUsername(username: "username"){karma}').karma;

userByUsername

await client.talk.userByUsername("username", ["karma"]).karma;

userById

await client.talk.userById(2222, ["karma"]).karma;

leaderboard

await client.talk.leaderboard(5, ["karma"])[0].karma; // top 5, the first person's karma

commentById

await client.talk.commentById(123456, ["title"]).title;

posts

await client.talk.posts(10, ["title"])[0].title; // newest post's title

login

await client.login("username", "password");
/*
=> {
  username: ...,
  email: ...,
  ...
  auth_jwt: ...,
  ...
}
*/

getLoginKey

await client.getLoginKey("username", "password"); // => 3Er%R4d3f...

Errors

They will be in the following form. replit query error: ... Note that errors are put within a .catch() block.

Credits

Special thanks to m3l0f1 to which this is adapted from replya

About

Easiest way to access the repl.it graphQL apis.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published