Skip to content

Commit

Permalink
feat: calling accounts api from accounts graph
Browse files Browse the repository at this point in the history
  • Loading branch information
ericzorn93 committed Jan 2, 2025
1 parent 533f67e commit d349d50
Show file tree
Hide file tree
Showing 17 changed files with 608 additions and 526 deletions.
1 change: 1 addition & 0 deletions apps/services/accounts-graphql/.env.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
AMQP_CONNECTION_URI=""
ACCOUNTS_API_URI=""
2 changes: 1 addition & 1 deletion apps/services/accounts-graphql/cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func run() error {
}

// Set up all ConnectRPC Handlers
srv := handler.New(generated.NewExecutableSchema(generated.Config{Resolvers: &resolvers.Resolver{}}))
srv := handler.New(generated.NewExecutableSchema(generated.Config{Resolvers: resolvers.NewResolver(config)}))
srv.AddTransport(transport.Options{})
srv.AddTransport(transport.GET{})
srv.AddTransport(transport.POST{})
Expand Down
2 changes: 1 addition & 1 deletion apps/services/accounts-graphql/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require (
connectrpc.com/connect v1.17.0
connectrpc.com/validate v0.1.0
github.com/99designs/gqlgen v0.17.61
github.com/google/uuid v1.6.0
github.com/vektah/gqlparser/v2 v2.5.20
google.golang.org/grpc v1.68.1
)
Expand All @@ -19,7 +20,6 @@ require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
github.com/google/cel-go v0.22.1 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
Expand Down
6 changes: 4 additions & 2 deletions apps/services/accounts-graphql/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import (

// Config for the application
type Config struct {
AMQPUrl string
AMQPUrl string
AccountsAPIURI string
}

// NewConfig constructs the config
func NewConfig() (Config, error) {
config := Config{
AMQPUrl: os.Getenv("AMQP_CONNECTION_URI"),
AMQPUrl: os.Getenv("AMQP_CONNECTION_URI"),
AccountsAPIURI: os.Getenv("ACCOUNTS_API_URI"),
}

return config, nil
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d349d50

Please sign in to comment.