Submit templates for repl.it/templates here.

← Back to all posts
Repl.it Talk GraphQL/API Template
h
RayhanADev (1968)

NodeJS GraphQL Template

By: RayhanADev

This is a simple NodeJS Template to use Repl.it's API/GraphQL to get information about a user!

How to Use

Everything is already set up! Simply replace the [username] field when you call the getData function!

Example:

getData('RayhanADev');

Output:

{
  karma: 653,
  firstName: 'Rayhan',
  lastName: 'Arayilakath',
  bio: 'G’day, name’s Ray and since you came by check out http://bitly/ReplitUserSearch!',
  isVerified: true,
  timeCreated: '2020-09-09T12:47:49.218Z',
  isLoggedIn: false,
  organization: { name: 'Furret Developer' },
  subscription: { planId: 'hacker2' },
  roles: [ { name: 'self learner' }, { name: 'explorer' } ]
}

Pro Tip: Want to learn how to query GraphQL and make your own project? Learn from my tutorial!

Comments
hotnewtop
badst (655)

LOL can't believe it, just what I was looking for. THX!
Also: do you know a way in which i can check all a users comments or posts?

RayhanADev (1968)

@pepelaugh YES! I know the one for posts, I’ll pingu you later today with a tutorial!

RayhanADev (1968)

@pepelaugh hey if you’re online I invited you to something!

programmeruser (575)

Add this to the headers or it won't work:

//redacted due to potential of abuse, ask me in private
angrydoge (474)

I got a promise pending error

angrydoge (474)

No, it said promise pending, then gave an error lol I probably shouldve rephrwsed that @programmeruser

LAMAQDAHODWALA (32)

Epic! Maybe release this thing to pyPI so I can get it in python?

RayhanADev (1968)

@LAMAQDAHODWALA I’m making a Python version of this tutorial after I make part two for this :)! Stay tuned!

RayhanADev (1968)

Haha lmao @realTronsi just looking at everyone’s info.

realTronsi (906)

@MocaCDeveloper you're one of the oldest members on repl that are still active, I've only found SixBeeps to have joined even before you

realTronsi (906)

@MocaCDeveloper yeah lol so you joined when you were still a youngling :D

realTronsi (906)

@MocaCDeveloper also u can come back now I'm done w/ math

MocaCDeveloper (560)

@realTronsi

xD I left repl for like a year back in 8th grade, then I came back JUST last year. Then I lost my last account so I had to recreate because I made a go project.
Then I lost my last account because for some reason I made a C project and it just didn't work anymore. Like the terminal would just not load AT ALL.

So ye, here I am with this account :D

MocaCDeveloper (560)

@realTronsi

Yep. I joined back when I wrote JavaScript and thought I was smart :D

realTronsi (906)

wait so you're actually a college student? @MocaCDeveloper

RayhanADev (1968)

@MocaCDeveloper what an interesting story xD. Can you share any og Repl stories pwease?

MocaCDeveloper (560)

@realTronsi

I am in history so I might have to go so I don't want to join right away but I got the parser.h file done(for the time being) and started on the parser.c file.

Everything is working perfectly.

realTronsi (906)

@MocaCDeveloper wait nvm lol you left at 8th grade not left after one year of 8th grade

realTronsi (906)

@MocaCDeveloper

Yep. I joined back when I wrote JavaScript and thought I was smart :D

I feel attacked

MocaCDeveloper (560)

@RayhanADev

Lol I really can't remember anything from back in 2017. It is primarily the same just has different styles nowdays. A bit more languages have been added since then and the terminal has been updated quite a bit. The terminal used to be very, VERY bold and you'd just sit there and see one side being the code, one side being the crappy terminal, then that old ugly run button lol.

RayhanADev (1968)

@MocaCDeveloper ooohhhh. Thanks for story uwu!

MocaCDeveloper (560)

@realTronsi

Lol what's the link again?

:)

MocaCDeveloper (560)

@realTronsi

I’ll be back on in a minute

RayhanADev (1968)

@MocaCDeveloper me thinking people care about my template, only to realize it’s you two xD

realTronsi (906)

@RayhanADev you need to fixx your formula, it was still to high effort

RayhanADev (1968)

@realTronsi lmao, obtw that post got unlisted xD.

RayhanADev (1968)

@MicroSoftHelp yeah version 1.0.3, but you want to wait for the documentation. I’m almost done with it.

MicroSoftHelp (62)

@RayhanADev so after you release the documentation could u explain how the alt detector works?

RayhanADev (1968)

@MicroSoftHelp that’s a secret, no..
but you can try and make one I give more than enough resources in the package!

also I’ll post in share when I finish documentation, so don’t worry!

realTronsi (906)

@RayhanADev your alt detector == flawed because you can't get upvotes from comments :p

MicroSoftHelp (62)

@realTronsi true, and @RayhanADev if you get a ping from me it is bc I'm working on a project don't worry bout it

it is private bc I have haxer plan now!!

realTronsi (906)

@RayhanADev also you be ignoring my comments to you earlier ;-;

anyways @MicroSoftHelp the alt detector most likely just checks post upvotes, sees which users are common across all the posts, and also increases alt likelyhood depending on suspected alt's cycles and activity.

RayhanADev (1968)

@realTronsi that’s the big problem and Repl GraphQL is freaking dumb about comments because the queries are super redundant.

realTronsi (906)

@RayhanADev btw since moca and xxperthacker are busy I was making a multiplayer pokemon console game to join the console game club, idk if you wanted to join since you knew a lot about pokemon and I'm bored

RayhanADev (1968)

@realTronsi sure I’ll join
but what are you using?

realTronsi (906)

@RayhanADev websockets ofc, but I have a server repl (on a secret alt) and I'll be making client side on this account. It'll be like a draft style pokemon duel where you can queue up /make custom rooms, and at the start you and your opponent gets to choose 3 between 6 pokemon to be on your team.

RayhanADev (1968)

Heya, want to try the Repl.it GraphQL, let me know how it goes!

realTronsi (906)

@RayhanADev title rename suggestion: How to use fetch

RayhanADev (1968)

@realTronsi lol, not wrong but many people don’t know the queries in GraphQL so tada!

realTronsi (906)

@RayhanADev also I'm surprised how new you are :0

RayhanADev (1968)

@realTronsi right! I’ve someone said I seem like a Repl.it OG and I laughed so hard b/c I joined this site a month ago.

realTronsi (906)

@RayhanADev you should combine this with the user search now

RayhanADev (1968)

@realTronsi actually I’m adding it to the Ultimate Repl.it Dashboard wanna help?

realTronsi (906)

@RayhanADev I have some more curious things to try, for example # of posts, # of characters typed, # of correct answers, stuff like that

RayhanADev (1968)

@realTronsi lol I love how you enjoy using it so much xD.

realTronsi (906)

@RayhanADev no I was just curious about Moca