replit-query

1.1.8 • Public • Published

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: ...
}
*/

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

Package Sidebar

Install

npm i replit-query

Weekly Downloads

3

Version

1.1.8

License

ISC

Unpacked Size

4.6 kB

Total Files

5

Last publish

Collaborators

  • coder100