apollo-subgraph-template

command module
v0.0.0-...-f8f0079 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2022 License: MIT Imports: 11 Imported by: 0

README

CircleCI

apollo-subgraph-template

Template to create a new Apollo subgraph service using Entgo, Gqlgen, and some CI

Prerequisites

Initial Setup

Take a look at these files and do any necessary changes to paths, names, or config details.

  • go.mod
  • Dockerfile
  • docker-compose.psql.yml
  • docker-compose.yml
  • gqlgen.yml
  • cue.mod/module.cue
  • sonar-project.properties

Run the init.sh script to enter in a new module name and make the replacement in all files.

./init.sh

# enter the name of the module:
github.com/organization/repo-name

This project template already has two objects: Account and Tenant. Feel free to remove and delete those files from the ent/schema/ route. This template also includes a custom ID type of UUID located in the same schema directory.

Common Commands

These are common commands to generate code, build the project, run pre-commit hooks, start up docker, and so on.

Generate all code for Entgo & Gqlgen

go generate ./...

Build project binary to bin/

make build

Dagger CI commands

# Init dagger once installed
dagger project init

# Install all dagger files to /pkg dir
dagger project update

Docker commands

# Start only postgres database
make dp

# Build all docker images
make db

# Start both docker images
make du

# Run both db & du commands
make da

Pre-commit commands

# Install all pre-commit hooks
pre-commit install

# Force run all pre-commit hooks
pre-commit run --all-files

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
ent

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL