Skip to content

Commit

Permalink
Merge branch 'PRO-1694-AD-tx-and-beneficiaries' into PRO-1738-AD-req-…
Browse files Browse the repository at this point in the history
…fields
  • Loading branch information
Allyson-English committed Jul 26, 2023
2 parents 0a772d1 + aa23305 commit 9657889
Show file tree
Hide file tree
Showing 22 changed files with 1,925 additions and 277 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: gotest

on:
pull_request:
branches: [ '**' ]
branches: ["**"]

jobs:
tests:
Expand All @@ -12,7 +12,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
go-version: 1.20.5

- name: Checkout code
uses: actions/checkout@v3
Expand Down
10 changes: 8 additions & 2 deletions cmd/identity-api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

"github.com/DIMO-Network/identity-api/graph"
"github.com/DIMO-Network/identity-api/internal/config"
"github.com/DIMO-Network/identity-api/internal/loader"
"github.com/DIMO-Network/identity-api/internal/repositories"
"github.com/DIMO-Network/identity-api/internal/services"
"github.com/DIMO-Network/shared"
Expand Down Expand Up @@ -48,16 +49,21 @@ func main() {

repo := repositories.NewVehiclesRepo(dbs)

srv := handler.NewDefaultServer(graph.NewExecutableSchema(graph.Config{Resolvers: &graph.Resolver{
s := handler.NewDefaultServer(graph.NewExecutableSchema(graph.Config{Resolvers: &graph.Resolver{
Repo: repo,
}}))

srv := loader.Middleware(dbs, s)

http.Handle("/", playground.Handler("GraphQL playground", "/query"))
http.Handle("/query", srv)

logger.Info().Msgf("Server started on port: %d", settings.Port)

http.ListenAndServe(fmt.Sprintf(":%d", settings.Port), nil)
if err := http.ListenAndServe(fmt.Sprintf(":%d", settings.Port), nil); err != nil {
logger.Fatal().Msgf("failed to start identity api: %v\n", err)
}

}

func startContractEventsConsumer(ctx context.Context, logger *zerolog.Logger, settings *config.Settings, dbs db.Store) {
Expand Down
9 changes: 8 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require (
github.com/friendsofgo/errors v0.9.2
github.com/gofiber/fiber/v2 v2.47.0
github.com/golang-jwt/jwt/v5 v5.0.0
github.com/graph-gophers/dataloader/v7 v7.1.0
github.com/pkg/errors v0.9.1
github.com/pressly/goose/v3 v3.11.2
github.com/rs/zerolog v1.29.1
Expand All @@ -22,6 +23,12 @@ require (
github.com/volatiletech/strmangle v0.0.4
)

require (
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
golang.org/x/time v0.3.0 // indirect
)

require (
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
Expand Down Expand Up @@ -85,6 +92,7 @@ require (
github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/tidwall/gjson v1.14.4
github.com/tinylib/msgp v1.1.8 // indirect
github.com/urfave/cli/v2 v2.25.5 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
Expand All @@ -99,7 +107,6 @@ require (
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.3 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
Expand Down
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+
github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/graph-gophers/dataloader/v7 v7.1.0 h1:Wn8HGF/q7MNXcvfaBnLEPEFJttVHR8zuEqP1obys/oc=
github.com/graph-gophers/dataloader/v7 v7.1.0/go.mod h1:1bKE0Dm6OUcTB/OAuYVOZctgIz7Q3d0XrYtlIzTgg6Q=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0=
Expand Down Expand Up @@ -581,6 +583,12 @@ github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t
github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
github.com/testcontainers/testcontainers-go v0.21.0 h1:syePAxdeTzfkap+RrJaQZpJQ/s/fsUgn11xIvHrOE9U=
github.com/testcontainers/testcontainers-go v0.21.0/go.mod h1:c1ez3WVRHq7T/Aj+X3TIipFBwkBaNT5iNCY8+1b83Ng=
github.com/tidwall/gjson v1.14.4 h1:uo0p8EbA09J7RQaflQ1aBRffTR7xedD2bcIVSYxLnkM=
github.com/tidwall/gjson v1.14.4/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tinylib/msgp v1.1.6/go.mod h1:75BAfg2hauQhs3qedfdDZmWAPcFMAvJE5b9rGOMufyw=
github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0=
github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw=
Expand Down
8 changes: 8 additions & 0 deletions gqlgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,11 @@ models:
- github.com/99designs/gqlgen/graphql.Int32
Address:
model: github.com/DIMO-Network/identity-api/graph/types.Address
AftermarketDevice:
fields:
vehicle:
resolver: true
Vehicle:
fields:
aftermarketDevice:
resolver: true
Loading

0 comments on commit 9657889

Please sign in to comment.