Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
6bfa271
feat: initialize GraphQL ORM with Prisma and GQloom
xcfox Oct 19, 2025
d5398cd
refactor: rename allUsers query to users in GraphQL schema and resolver
xcfox Oct 19, 2025
58204de
fix: update email validation in signupUser mutation to use z.email()
xcfox Oct 19, 2025
1e6620a
feat: migrate database from SQLite to PostgreSQL and enhance query ca…
xcfox Oct 19, 2025
4461882
feat: add README for GraphQL server example with TypeScript, Prisma, …
xcfox Oct 19, 2025
4c99abe
chore: remove generated Prisma files for User and Post models along w…
xcfox Oct 19, 2025
370ee85
chore: add .gitignore file to exclude node_modules, dist, environment…
xcfox Oct 19, 2025
e555077
feat: add test setup script for GraphQL GQloom integration with Prisma
xcfox Oct 19, 2025
ad6cabc
docs: update GQLoom description in README to clarify its Code-First a…
xcfox Oct 19, 2025
91249ed
feat: update TypeScript configuration and enhance resolvers with sele…
xcfox Oct 19, 2025
527b193
fix: change post and user ID types from Float to Int in GraphQL schem…
xcfox Oct 19, 2025
b7c28f5
Update .github/tests/orm/graphql-gqloom/run.sh
xcfox Oct 20, 2025
6511211
Update orm/graphql-gqloom/src/resolvers/post.ts
xcfox Oct 20, 2025
2e2a5a5
Update orm/graphql-gqloom/src/server.ts
xcfox Oct 20, 2025
9d3eda5
Update orm/graphql-gqloom/src/resolvers/user.ts
xcfox Oct 20, 2025
6ff4846
Update orm/graphql-gqloom/src/db.ts
xcfox Oct 20, 2025
60c96ef
Update .github/tests/orm/graphql-gqloom/run.sh
xcfox Oct 20, 2025
f7fc824
Update orm/graphql-gqloom/src/resolvers/post.ts
xcfox Oct 20, 2025
8e2afa1
Refactor seed.ts to use centralized Prisma client instance
xcfox Oct 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .github/tests/orm/graphql-gqloom/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/bin/bash

set -eu

echo "🔍 Starting test setup for graphql-gqloom..."

echo "📂 Current working directory before REPO_ROOT: $(pwd)"
echo "📁 Listing contents:"
ls -la

REPO_ROOT="$(git rev-parse --show-toplevel)"
echo "📌 Detected repo root: $REPO_ROOT"

cd "$REPO_ROOT/orm/graphql-gqloom"
echo "📂 Changed directory to: $(pwd)"

echo "📦 Installing test deps..."
npm install

# Go to Node script dir and install its deps
NODE_SCRIPT_DIR="../../.github/get-ppg-dev"
pushd "$NODE_SCRIPT_DIR" > /dev/null
npm install

# Start Prisma Dev server
LOG_FILE="./ppg-dev-url.log"
rm -f "$LOG_FILE"
touch "$LOG_FILE"

echo "🚀 Starting Prisma Dev in background..."
node index.js >"$LOG_FILE" &
NODE_PID=$!

# Wait for DATABASE_URL
echo "🔎 Waiting for Prisma Dev to emit DATABASE_URL..."
MAX_WAIT=60
WAITED=0
until grep -q '^prisma+postgres://' "$LOG_FILE"; do
sleep 1
WAITED=$((WAITED + 1))
if [ "$WAITED" -ge "$MAX_WAIT" ]; then
echo "❌ Timeout waiting for DATABASE_URL"
cat "$LOG_FILE"
kill "$NODE_PID" || true
exit 1
fi
done

DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1)
export DATABASE_URL="$DB_URL"
echo "✅ DATABASE_URL: $DATABASE_URL"

popd > /dev/null # Back to orm/graphql-gqloom

# Run migrations and seed
npx prisma migrate reset --force --skip-seed
npx prisma migrate dev --name init
npx prisma db seed

# Start the app
npm run dev &
pid=$!

# Wait for app to be ready
echo "🔎 Waiting for app to be ready..."
MAX_WAIT=60
WAITED=0
until curl -s http://localhost:4000/ > /dev/null 2>&1; do
sleep 1
WAITED=$((WAITED + 1))
if [ "$WAITED" -ge "$MAX_WAIT" ]; then
echo "❌ Timeout waiting for app to start"
kill "$pid" 2>/dev/null || true
kill "$NODE_PID" 2>/dev/null || true
exit 1
fi
done
echo "✅ App is ready"

# Run GraphQL Postman collection
echo "🧪 Running Postman tests..."
npx newman run "$REPO_ROOT/.github/tests/postman_collections/graphql.json" --bail

# Cleanup
echo "🛑 Shutting down app (PID $pid) and Prisma Dev (PID $NODE_PID)..."
kill "$pid" 2>/dev/null || true
kill "$NODE_PID"
wait "$NODE_PID" 2>/dev/null || true
wait "$pid" 2>/dev/null || true
4 changes: 4 additions & 0 deletions orm/graphql-gqloom/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
dist/
*.env*
src/generated
1 change: 1 addition & 0 deletions orm/graphql-gqloom/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/jod
Loading