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

Refactor #2260

Merged
merged 1 commit into from
Jun 22, 2021
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
18 changes: 18 additions & 0 deletions .changeset/angry-dragons-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'@graphql-mesh/cli': minor
'@graphql-mesh/config': minor
'@graphql-mesh/graphql': minor
'@graphql-mesh/grpc': minor
'@graphql-mesh/json-schema': minor
'@graphql-mesh/mysql': minor
'@graphql-mesh/neo4j': minor
'@graphql-mesh/odata': minor
'@graphql-mesh/openapi': minor
'@graphql-mesh/postgraphile': minor
'@graphql-mesh/store': minor
'@graphql-mesh/types': minor
'@graphql-mesh/utils': minor
'@graphql-mesh/cache-store': minor
---

New MeshStore approach
5 changes: 5 additions & 0 deletions .changeset/five-schools-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-mesh/neo4j': minor
---

feat(neo4j): better schema inference
5 changes: 5 additions & 0 deletions .changeset/friendly-crabs-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-mesh/transform-resolvers-composition': minor
---

feat(resolvers-composition): load compositions async
5 changes: 5 additions & 0 deletions .changeset/neat-boats-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-mesh/grpc': minor
---

feat(grpc): support nested types and avoid naming convention
5 changes: 5 additions & 0 deletions .changeset/sharp-pigs-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-mesh/merger-stitching': minor
---

feat(stitching): federation support
5 changes: 5 additions & 0 deletions .changeset/sixty-bugs-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-mesh/mysql': minor
---

enhance(mysql): remove naming convention and get prefix
5 changes: 5 additions & 0 deletions .changeset/tasty-poets-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-mesh/json-schema': minor
---

feat(json-schema): Huge refactor
35 changes: 35 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,32 @@ jobs:
strategy:
matrix:
node_version: [12, 16]
# Service containers to run with `runner-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: docker
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
mysql:
image: genschsa/mysql-employees
env:
MYSQL_ROOT_PASSWORD: passwd
ports:
- 33306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- name: Checkout Master
uses: actions/checkout@v2
Expand Down Expand Up @@ -92,8 +118,17 @@ jobs:
restore-keys: |
${{ runner.os }}-${{matrix.node_version}}-jest-${{ hashFiles('yarn.lock') }}
${{ runner.os }}-${{matrix.node_version}}-jest-
- name: Download Postgres Dump
run: 'curl https://raw.githubusercontent.com/morenoh149/postgresDBSamples/master/worldDB-1.0/world.sql -o /tmp/backup.sql'
- name: Load Postgres Data
uses: tj-actions/pg-restore@v4.5
with:
database_url: 'postgres://postgres:docker@localhost:5432/postgres'
backup_file: '/tmp/backup.sql'
- name: Test
run: yarn test
env:
CI: true
NODE_TLS_REJECT_UNAUTHORIZED: 0
GH_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LC_ALL: en-US
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"yaml.schemas": {
"./packages/types/src/config-schema.json": ".meshrc.*"
}
}
},
"typescript.tsdk": "node_modules/typescript/lib"
}
2 changes: 2 additions & 0 deletions declarations.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
declare interface ObjectConstructor {
keys<T>(obj: T): Array<keyof T>;
}
declare module 'ajv-formats';
declare module 'federation-to-stitching-sdl';
9 changes: 3 additions & 6 deletions examples/federation-example/.meshrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ sources:
keyFields:
- id
resolveReference:
targetSource: accounts
targetMethod: user
args:
id: root.id
queryFieldName: user
- name: reviews
handler:
graphql:
Expand All @@ -32,5 +29,5 @@ sources:
graphql:
endpoint: http://localhost:9874/graphql

serve:
exampleQuery: example-query.graphql
documents:
- example-query.graphql
10 changes: 9 additions & 1 deletion examples/federation-example/example-query.graphql
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
{
me {
id
username
name
reviews {
id
body
product {
inStock
name
price
shippingEstimate
upc
weight
}
author {
id
name
username
name
reviews {
body
}
Expand Down
2 changes: 1 addition & 1 deletion examples/federation-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"scripts": {
"start": "concurrently \"npm:start-services npm:start-gateway-delayed\"",
"start-gateway": "mesh serve",
"start-gateway": "mesh dev",
"start-gateway-delayed": "delay 1 && npm run start-gateway",
"start-service-accounts": "nodemon services/accounts/index.js",
"start-service-reviews": "nodemon services/reviews/index.js",
Expand Down
4 changes: 3 additions & 1 deletion examples/federation-example/services/accounts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ const server = new ApolloServer({
});

module.exports = server.listen({ port: 9871 }).then(({ url }) => {
console.log(`🚀 Server ready at ${url}`);
if (!process.env.CI) {
console.log(`🚀 Server ready at ${url}`);
}
return server;
});
4 changes: 3 additions & 1 deletion examples/federation-example/services/inventory/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ const server = new ApolloServer({
});

module.exports = server.listen({ port: 9872 }).then(({ url }) => {
console.log(`🚀 Server ready at ${url}`);
if (!process.env.CI) {
console.log(`🚀 Server ready at ${url}`);
}
return server;
});

Expand Down
4 changes: 3 additions & 1 deletion examples/federation-example/services/products/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ const server = new ApolloServer({
});

module.exports = server.listen({ port: 9873 }).then(({ url }) => {
console.log(`🚀 Server ready at ${url}`);
if (!process.env.CI) {
console.log(`🚀 Server ready at ${url}`);
}
return server;
});

Expand Down
4 changes: 3 additions & 1 deletion examples/federation-example/services/reviews/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ const server = new ApolloServer({
});

module.exports = server.listen({ port: 9874 }).then(({ url }) => {
console.log(`🚀 Server ready at ${url}`);
if (!process.env.CI) {
console.log(`🚀 Server ready at ${url}`);
}
return server;
});

Expand Down
Loading