Skip to content

Latest commit

 

History

History
36 lines (20 loc) · 1.1 KB

README.md

File metadata and controls

36 lines (20 loc) · 1.1 KB

z01mails

Template repository to use the API, used in this example to send emails and synchronize the list of users.

Stack

This code use NodeJS, queries are in SQL and GraphQL

  • @01-edu/api to use our graphQL API
  • better-sqlite3 to use a local database
  • nodemailer to send emails

Env variables

all the environement variable are centralized in config.js

  • DOMAIN domain of the school to query
  • Z01_TOKEN more info in how to get your read-only access token on @01-edu/api documentation
  • MAIL_USER nodemailer user
  • MAIL_PASS nodemailer password

Structure

We used a declarative approach, queries should be written either in .sql and .graphql files. The matching functions will be generated so you can use them.

GraphQL queries

Used directory is z01/queries name of the file will be used to name the exposed function.

SQL queries

Used directory is sqlite/queries exactly like graphql queries, name of the file will be used to name the exposed function.