Skip to content

Instantly share code, notes, and snippets.

View alinauroz's full-sized avatar

Ali Nauroze alinauroz

View GitHub Profile
@alinauroz
alinauroz / resolvers.ts
Created September 2, 2025 01:12
Sample GraphQL resolvers I wrote for an app, including a query to generate admin-only JWT tokens for issues and a mutation to allow logged-in users to add comments. Demonstrates secure role-based access, Prisma database integration and triggering notifications.
import prisma from '@/prisma/prisma';
import { IGqlContext } from '@/types';
import { isLoggedIn, isAdmin } from '../../wrappers';
import jwt from 'jsonwebtoken';
import { notifyCommentAdded } from '@/utils/notification';
import logAmplitude from '@/logs';
/**
* Generates a secret JWT token for a specific issue.
* Only accessible by admin users.
@alinauroz
alinauroz / publish-ghpages.md
Created April 5, 2021 20:44 — forked from tduarte/publish-ghpages.md
If you need to force push an subtree
git checkout master # you can avoid this line if you are in master...
git subtree split --prefix dist -b gh-pages # create a local gh-pages branch containing the splitted output folder
git push -f origin gh-pages:gh-pages # force the push of the gh-pages branch to the remote gh-pages branch at origin
git branch -D gh-pages # delete the local gh-pages because you will need it: ref