Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Fix Mutations #53

Merged
merged 10 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 6 additions & 6 deletions .gitbook.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
root: ./docs/

structure:
readme: ./base.md
summary: ./SUMMARY.md

root: ./docs/
structure:
readme: ./base.md
summary: ./SUMMARY.md
10 changes: 5 additions & 5 deletions .github/workflows/data/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
POSTGRES_PASSWORD=
POSTGRES_USER=postgres
POSTGRES_HOST=postgres
POSTGRES_DB=postgres
POSTGRES_HOST_AUTH_METHOD=trust
POSTGRES_PASSWORD=
POSTGRES_USER=postgres
POSTGRES_HOST=postgres
POSTGRES_DB=postgres
POSTGRES_HOST_AUTH_METHOD=trust
20 changes: 10 additions & 10 deletions .github/workflows/data/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
version: '3.1'
services:
db:
image: postgres
restart: always
env_file:
- .env
volumes:
- ./:/docker-entrypoint-initdb.d
ports:
version: '3.1'
services:
db:
image: postgres
restart: always
env_file:
- .env
volumes:
- ./:/docker-entrypoint-initdb.d
ports:
- 5432:5432
156 changes: 78 additions & 78 deletions .github/workflows/data/init.sql
Original file line number Diff line number Diff line change
@@ -1,78 +1,78 @@
-- create schema for example/interface/schema.graphql

CREATE TABLE animals (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
type TEXT NOT NULL,
breed TEXT NOT NULL,
color TEXT NOT NULL
);

CREATE TABLE "user" (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE post (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
user_id INTEGER NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE category (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE posts_to_categories (
post_id INTEGER NOT NULL,
category_id INTEGER NOT NULL,
PRIMARY KEY (post_id, category_id)
);

-- initialize base data
INSERT INTO "user" (name) VALUES ('Alice');
INSERT INTO "user" (name) VALUES ('Bob');
INSERT INTO "user" (name) VALUES ('Charlie');
INSERT INTO "user" (name) VALUES ('David');
INSERT INTO "user" (name) VALUES ('Eve');

INSERT INTO category (name) VALUES ('News');
INSERT INTO category (name) VALUES ('Technology');
INSERT INTO category (name) VALUES ('Science');
INSERT INTO category (name) VALUES ('Sports');
INSERT INTO category (name) VALUES ('Entertainment');

INSERT INTO post (name, user_id) VALUES ('Hello World', 1);
INSERT INTO post (name, user_id) VALUES ('GraphQL is awesome', 2);
INSERT INTO post (name, user_id) VALUES ('Postgres is cool', 3);
INSERT INTO post (name, user_id) VALUES ('Deno is interesting', 4);
INSERT INTO post (name, user_id) VALUES ('Node.js is fast', 5);

-- some posts are in multiple categories
INSERT INTO posts_to_categories (post_id, category_id) VALUES (1, 1);
INSERT INTO posts_to_categories (post_id, category_id) VALUES (2, 2);
INSERT INTO posts_to_categories (post_id, category_id) VALUES (3, 3);
INSERT INTO posts_to_categories (post_id, category_id) VALUES (4, 4);
INSERT INTO posts_to_categories (post_id, category_id) VALUES (5, 5);
INSERT INTO posts_to_categories (post_id, category_id) VALUES (1, 2);
INSERT INTO posts_to_categories (post_id, category_id) VALUES (2, 3);
INSERT INTO posts_to_categories (post_id, category_id) VALUES (3, 4);
INSERT INTO posts_to_categories (post_id, category_id) VALUES (4, 5);
INSERT INTO posts_to_categories (post_id, category_id) VALUES (5, 1);


-- insert some animals
INSERT INTO animals (name, type, breed, color) VALUES ('Fido', 'dog', 'labrador', 'black');
INSERT INTO animals (name, type, breed, color) VALUES ('Whiskers', 'cat', 'siamese', 'white');
INSERT INTO animals (name, type, breed, color) VALUES ('Spot', 'dog', 'dalmatian', 'white');
INSERT INTO animals (name, type, breed, color) VALUES ('Fluffy', 'cat', 'persian', 'grey');
INSERT INTO animals (name, type, breed, color) VALUES ('Rover', 'dog', 'bulldog', 'brown');
INSERT INTO animals (name, type, breed, color) VALUES ('Mittens', 'cat', 'maine coon', 'black');

-- create schema for example/interface/schema.graphql
CREATE TABLE animals (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
type TEXT NOT NULL,
breed TEXT NOT NULL,
color TEXT NOT NULL
);
CREATE TABLE "user" (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE post (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
user_id INTEGER NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE category (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE posts_to_categories (
post_id INTEGER NOT NULL,
category_id INTEGER NOT NULL,
PRIMARY KEY (post_id, category_id)
);
-- initialize base data
INSERT INTO "user" (name) VALUES ('Alice');
INSERT INTO "user" (name) VALUES ('Bob');
INSERT INTO "user" (name) VALUES ('Charlie');
INSERT INTO "user" (name) VALUES ('David');
INSERT INTO "user" (name) VALUES ('Eve');
INSERT INTO category (name) VALUES ('News');
INSERT INTO category (name) VALUES ('Technology');
INSERT INTO category (name) VALUES ('Science');
INSERT INTO category (name) VALUES ('Sports');
INSERT INTO category (name) VALUES ('Entertainment');
INSERT INTO post (name, user_id) VALUES ('Hello World', 1);
INSERT INTO post (name, user_id) VALUES ('GraphQL is awesome', 2);
INSERT INTO post (name, user_id) VALUES ('Postgres is cool', 3);
INSERT INTO post (name, user_id) VALUES ('Deno is interesting', 4);
INSERT INTO post (name, user_id) VALUES ('Node.js is fast', 5);
-- some posts are in multiple categories
INSERT INTO posts_to_categories (post_id, category_id) VALUES (1, 1);
INSERT INTO posts_to_categories (post_id, category_id) VALUES (2, 2);
INSERT INTO posts_to_categories (post_id, category_id) VALUES (3, 3);
INSERT INTO posts_to_categories (post_id, category_id) VALUES (4, 4);
INSERT INTO posts_to_categories (post_id, category_id) VALUES (5, 5);
INSERT INTO posts_to_categories (post_id, category_id) VALUES (1, 2);
INSERT INTO posts_to_categories (post_id, category_id) VALUES (2, 3);
INSERT INTO posts_to_categories (post_id, category_id) VALUES (3, 4);
INSERT INTO posts_to_categories (post_id, category_id) VALUES (4, 5);
INSERT INTO posts_to_categories (post_id, category_id) VALUES (5, 1);
-- insert some animals
INSERT INTO animals (name, type, breed, color) VALUES ('Fido', 'dog', 'labrador', 'black');
INSERT INTO animals (name, type, breed, color) VALUES ('Whiskers', 'cat', 'siamese', 'white');
INSERT INTO animals (name, type, breed, color) VALUES ('Spot', 'dog', 'dalmatian', 'white');
INSERT INTO animals (name, type, breed, color) VALUES ('Fluffy', 'cat', 'persian', 'grey');
INSERT INTO animals (name, type, breed, color) VALUES ('Rover', 'dog', 'bulldog', 'brown');
INSERT INTO animals (name, type, breed, color) VALUES ('Mittens', 'cat', 'maine coon', 'black');
76 changes: 38 additions & 38 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
name: deploy Github pages

on:
# Trigger the workflow every time you push to the `main` branch
# Using a different branch name? Replace `main` with your branch’s name
push:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:

# Allow this job to clone the repo and create a page deployment
permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v3
- name: Install, build, and upload your site
uses: withastro/action@v1
with:
path: ./docs # The root location of your Astro project inside the repository. (optional)
# node-version: 18 # The specific version of Node that should be used to build your site. Defaults to 18. (optional)
package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
name: deploy Github pages
on:
# Trigger the workflow every time you push to the `main` branch
# Using a different branch name? Replace `main` with your branch’s name
push:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:
# Allow this job to clone the repo and create a page deployment
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v3
- name: Install, build, and upload your site
uses: withastro/action@v1
with:
path: ./docs # The root location of your Astro project inside the repository. (optional)
# node-version: 18 # The specific version of Node that should be used to build your site. Defaults to 18. (optional)
package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
44 changes: 22 additions & 22 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: integration
on: [ pull_request ]
# When a new revision is pushed to a PR, cancel all in-progress CI runs for that
# PR. See https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
init:
strategy:
matrix:
go: [ "1.18", "1.20" ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- run: |
chmod +x .github/workflows/check-init
.github/workflows/check-init

name: integration
on: [ pull_request ]
# When a new revision is pushed to a PR, cancel all in-progress CI runs for that
# PR. See https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
init:
strategy:
matrix:
go: [ "1.18", "1.20" ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- run: |
chmod +x .github/workflows/check-init
.github/workflows/check-init
24 changes: 12 additions & 12 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: golangci-lint
on: [ pull_request ]

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
name: golangci-lint
on: [ pull_request ]
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.55.2
Loading
Loading