Skip to content

Commit

Permalink
Update graphql README and tests for new server configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
timburks committed Feb 16, 2023
1 parent 9167fb2 commit f1fa969
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,8 @@ jobs:
- name: Install
run: go install ./...

- name: Install registry-server
run: go install github.com/apigee/registry/cmd/registry-server@latest
- name: Create default registry configuration
run: registry config configurations create localhost --registry.address='localhost:8080'

- name: Test everything with SQLite
run: registry-server & make test
env:
APG_REGISTRY_ADDRESS: localhost:8080
APG_REGISTRY_AUDIENCES: http://localhost:8080
APG_REGISTRY_INSECURE: 1
run: make test
15 changes: 9 additions & 6 deletions cmd/registry-graphql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ provide access to spec revisions or artifact values.

## Invocation

Just run the `registry-graphql` program. It uses the `APG_*` environment
variables to connect to a Registry API server. Because it serves static files,
it should be run in the same directory as its source files.

If you're building a React or other browser-hosted client application, you
can use the `-cors-allow-origin` flag to allow CORS requests while you are
Just run the `registry-graphql` program. It uses the
[registry](https://github.com/apigee/registry) project's
[pkg/connection](https://github.com/apigee/registry/tree/main/pkg/connection) to
get an authenticated connection to a Registry API server. Because it serves
static files, it should be run in the same directory as its source files.

If you're building a React or other browser-hosted client application, you can
use the `-cors-allow-origin` flag to allow CORS requests while you are
developing your app. This allows you to specify a single allowed origin, which
can include `*`, which allows all CORS requests. Take care to quote the `*` to
avoid shell expansion:

```
registry-graphql -cors-allow-origin '*'
```
Expand Down
6 changes: 6 additions & 0 deletions cmd/registry-graphql/graphql/graphql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@ import (
"testing"

"github.com/apigee/registry/pkg/connection"
"github.com/apigee/registry/pkg/connection/grpctest"
"github.com/apigee/registry/rpc"
"github.com/apigee/registry/server/registry"
"github.com/graphql-go/graphql"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)

func TestMain(m *testing.M) {
grpctest.TestMain(m, registry.Config{})
}

func unavailable(err error) bool {
if err == nil {
return false
Expand Down

0 comments on commit f1fa969

Please sign in to comment.