Simple Auth Server For Signup & Login Mutation
Setup
Required Schema
Table Name: User
CREATE TABLE public."user" (
id uuid DEFAULT public.gen_random_uuid() NOT NULL,
email text NOT NULL,
password text NOT NULL
);
ALTER TABLE ONLY public."user"
ADD CONSTRAINT user_email_key UNIQUE (email);
ALTER TABLE ONLY public."user"
ADD CONSTRAINT user_pkey PRIMARY KEY (id);
Queries
me { email } // Used for login check
Mutations
login(email: String, password: String) { token }
signup(email: String, password: String) { token }