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

Update graphql README and tests for new server configuration. #140

Merged
merged 1 commit into from
Feb 16, 2023
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
14 changes: 5 additions & 9 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,11 @@ jobs:
version: v1.45
args: --timeout 5m0s

- name: Install
run: go install ./...
- name: Install the registry tool
run: go install github.com/apigee/registry/cmd/registry@latest

- 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'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


- 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