Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.

GraphQL API

Simon Roy edited this page Jul 30, 2024 · 2 revisions

Cursif is built with GraphQL, a query language for APIs. You can use it to request the exact data you need, and therefore limit the number of requests you need.

Code Society's endpoint: https://api.codesociety.xyz/api

Getting Start

If you are new with GraphQL, we recommend that you read GraphQL's Introduction.

Cursif GrapQL endpoint is at /api. You can use the official Code Society Instance https://api.codesociety.xyz/api.

Run GraphQL Queries and Mutation

Interactive explorer

You can explore the API using an interactive GraphQL explorer, such as:

Authentication (example)

Authentication requires email and password.

mutation {
  login(email: "[email protected]", password: "GraceHopper123!") {
    token
    user {
      id
      username
      email
      firstName
      lastName
  }
}

Registration (example)

Registration require 3 parameters, username, email and password. You can optionally include your firstName and lastName.

mutation {
  register(
    username: "ghopper",
    firstName: "Grace",
    lastName: "Hopper",
    email: "[email protected]", 
    password: "GraceHopper!"
  ) {
    username
    firstName
    lastName
    email
    password
  }
}

References

Clone this wiki locally