Skip to content

Commit

Permalink
v1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
tot-ra committed Dec 11, 2020
1 parent ef1599d commit 7bf246b
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 24 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ node_modules/
.vscode
.idea
.atom-build.json
.project
.project
coverage
dist
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.5] - 2020-12-11
### Changed
- Moved credentials from diplomat.js to config.js

## [1.0.4] - 2020-09-14

### Security
Expand Down Expand Up @@ -41,7 +45,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Frontend app
- Examples of gateway + 2 federated services

[unreleased]: https://github.com/pipedrive/graphql-schema-registry/compare/v1.0.1...HEAD
[unreleased]: https://github.com/pipedrive/graphql-schema-registry/compare/v1.0.5...HEAD
[1.0.5]: https://github.com/pipedrive/graphql-schema-registry/compare/v1.0.4...v1.0.5
[1.0.4]: https://github.com/pipedrive/graphql-schema-registry/compare/v1.0.3...v1.0.4
[1.0.3]: https://github.com/pipedrive/graphql-schema-registry/compare/v1.0.2...v1.0.3
[1.0.2]: https://github.com/pipedrive/graphql-schema-registry/compare/v1.0.1...v1.0.2
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,27 @@ Graphql schema storage as dockerized on-premise service for federated graphql ga

<img width="1309" alt="Screenshot 2020-08-31 at 15 40 43" src="https://user-images.githubusercontent.com/445122/91720806-65985c00-eba0-11ea-8763-986b9f3f166b.png">

## Roadmap
- client tracking (for breaking changes)
- schema usage tracking (for breaking changes)
- separate APQs (use cache only) from backend-registered persisted queries (use DB only)

## Installation
Assuming you have [nvm](https://github.com/nvm-sh/nvm) & [docker](https://www.docker.com/) installed:

```
nvm use
npm install
npm run build
docker-compose up
docker-compose up --build
```

Open http://localhost:6001

## Configuration
We rely on docker network and uses hostnames from `docker-compose.yml`.
Check `app/config.js` to see credentials that node service uses to connect to mysql & redis and change it if you install it with own setup. If you use dynamic service discovery (consul/etcd), edit `diplomat.js`

## Use cases

### Validating schema on deploy
Expand Down
15 changes: 15 additions & 0 deletions app/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,19 @@ module.exports = {
//override me
formatCommitLink: (serviceName, hash) =>
`https://github.com/MY_ORGANIZATION/${serviceName}/commit/${hash}`,

serviceDiscovery: {
'gql-schema-registry-db': {
host: 'gql-schema-registry-db',
port: '3306',
username: 'root',
secret: 'root',
},
'gql-schema-registry-redis': {
host: 'gql-schema-registry-redis',
port: '6379',
username: '',
secret: '',
}
}
};
25 changes: 5 additions & 20 deletions app/diplomat.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
const config = require('./config');

module.exports = {
getServiceInstance: (name) => {
const address = {
host: '',
port: '',
username: '',
secret: '',
};
switch (name) {
case 'gql-schema-registry-db':
address.host = 'gql-schema-registry-db';
address.port = '3306';
address.username = 'root';
address.secret = 'root';
return address;

case 'gql-schema-registry-redis':
address.host = 'gql-schema-registry-redis';
address.port = '6379';
return address;
if(!config.serviceDiscovery[name]){
throw new Error(`undefined service ${name} networkaddress`);
}

throw new Error(`undefined service ${name} networkaddress`);
return config.serviceDiscovery[name];
},
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "graphql-schema-registry",
"version": "1.0.3",
"version": "1.0.5",
"description": "Graphql schema registry",
"main": "schema-registry.js",
"scripts": {
Expand Down

0 comments on commit 7bf246b

Please sign in to comment.