Skip to content

Commit

Permalink
Go
Browse files Browse the repository at this point in the history
chore(dependencies): updated changesets for modified dependencies

Go

Go

Fix tests

Go

Cleanup

Go

Update snapshots

Go

Update snapshot

chore(dependencies): updated changesets for modified dependencies

Cleanup yarn.lock
  • Loading branch information
ardatan committed Dec 6, 2022
1 parent 9bacd95 commit c84f817
Show file tree
Hide file tree
Showing 181 changed files with 81,388 additions and 824,716 deletions.
5 changes: 5 additions & 0 deletions .changeset/@graphql-mesh_cli-4767-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-mesh/cli": patch
---
dependencies updates:
- Updated dependency [`@graphql-codegen/[email protected]` ↗︎](https://www.npmjs.com/package/@graphql-codegen/typed-document-node/v/2.3.8) (from `2.3.7`, in `dependencies`)
5 changes: 5 additions & 0 deletions .changeset/@graphql-mesh_http-4767-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-mesh/http": patch
---
dependencies updates:
- Updated dependency [`[email protected]` ↗︎](https://www.npmjs.com/package/graphql-yoga/v/3.1.1) (from `3.1.0`, in `dependencies`)
5 changes: 5 additions & 0 deletions .changeset/@graphql-mesh_openapi-4767-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-mesh/openapi": patch
---
dependencies updates:
- Added dependency [`@graphql-tools/[email protected]` ↗︎](https://www.npmjs.com/package/@graphql-tools/utils/v/9.1.1) (to `dependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@graphql-mesh/plugin-prometheus": patch
---
dependencies updates:
- Updated dependency [`@graphql-yoga/[email protected]` ↗︎](https://www.npmjs.com/package/@graphql-yoga/plugin-prometheus/v/1.1.1) (from `1.1.0`, in `dependencies`)
- Updated dependency [`[email protected]` ↗︎](https://www.npmjs.com/package/graphql-yoga/v/3.1.1) (from `3.1.0`, in `peerDependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-mesh/plugin-response-cache": patch
---
dependencies updates:
- Updated dependency [`@graphql-yoga/[email protected]` ↗︎](https://www.npmjs.com/package/@graphql-yoga/plugin-response-cache/v/1.1.1) (from `1.1.0`, in `dependencies`)
5 changes: 5 additions & 0 deletions .changeset/@graphql-mesh_postgraphile-4767-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-mesh/postgraphile": patch
---
dependencies updates:
- Updated dependency [`[email protected]` ↗︎](https://www.npmjs.com/package/postgraphile/v/4.12.12) (from `4.12.11`, in `dependencies`)
5 changes: 5 additions & 0 deletions .changeset/@graphql-mesh_raml-4767-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-mesh/raml": patch
---
dependencies updates:
- Added dependency [`@graphql-tools/[email protected]` ↗︎](https://www.npmjs.com/package/@graphql-tools/utils/v/9.1.1) (to `dependencies`)
18 changes: 18 additions & 0 deletions .changeset/smart-balloons-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'@graphql-mesh/config': patch
'@graphql-mesh/json-schema': patch
'@graphql-mesh/mongoose': patch
'@graphql-mesh/mysql': patch
'@graphql-mesh/openapi': patch
'@graphql-mesh/raml': patch
'@omnigraph/json-schema': patch
'@omnigraph/openapi': patch
'@omnigraph/raml': patch
'@omnigraph/soap': patch
'@graphql-mesh/runtime': patch
'@graphql-mesh/plugin-hive': patch
'@graphql-mesh/transform-hive': patch
'@graphql-mesh/types': patch
---

Bump
2 changes: 1 addition & 1 deletion examples/auth0/.meshrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sources:
- name: PrivateAPI
handler:
jsonSchema:
baseUrl: http://localhost:3001
endpoint: http://localhost:3001
operations:
- type: Query
field: secret
Expand Down
2 changes: 1 addition & 1 deletion examples/cloudflare-workers/.meshrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sources:
- name: OpenBrewery
handler:
jsonSchema:
baseUrl: https://api.openbrewerydb.org
endpoint: https://api.openbrewerydb.org
operations:
- type: Query
field: breweries
Expand Down
2 changes: 1 addition & 1 deletion examples/hasura-openbrewery-geodb/.meshrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sources:
- name: OpenBrewery
handler:
jsonSchema:
baseUrl: https://api.openbrewerydb.org
endpoint: https://api.openbrewerydb.org
operations:
- type: Query
field: breweries
Expand Down
47 changes: 31 additions & 16 deletions examples/hasura-openbrewery-geodb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,29 @@
This example takes two API sources and merges them together:

1. Postgres GeoDB - a seed database of geo locations and their metadata (uses Hasura GraphQL Engine)
2. OpenBrewery API - a free API for public information on breweries, cideries, brewpubs, and bottleshops.
2. OpenBrewery API - a free API for public information on breweries, cideries, brewpubs, and
bottleshops.

The two schemas are connected and let you search for locations, and then fetch breweries that are located in that location.
The two schemas are connected and let you search for locations, and then fetch breweries that are
located in that location.

### Create GeoDB Database

Because a running Postgres DB is required, you need to setup local Postgres running, and load the schema and data seed.
Because a running Postgres DB is required, you need to setup local Postgres running, and load the
schema and data seed.

To do that, run the following:

1. Install and run Postgres using Docker - `docker run --name pg-docker -e POSTGRES_PASSWORD=docker -d -p 5432:5432 postgres`
1. Install and run Postgres using Docker -
`docker run --name pg-docker -e POSTGRES_PASSWORD=docker -d -p 5432:5432 postgres`
2. Install Postgres CLI: `brew upgrade postgresql` (or, you can use any of your favorite tool)
3. Seed the DB with data: `curl https://raw.githubusercontent.com/morenoh149/postgresDBSamples/master/worldDB-1.0/world.sql | psql -h localhost -d postgres -U postgres`
3. Seed the DB with data:
`curl https://raw.githubusercontent.com/morenoh149/postgresDBSamples/master/worldDB-1.0/world.sql | psql -h localhost -d postgres -U postgres`

### Create Hasura Instance

We need to install Hasura using Docker but we will use a special version of Hasura to benefit from Remote Joins;
We need to install Hasura using Docker but we will use a special version of Hasura to benefit from
Remote Joins;

```sh
docker run -d -p 8080:8080 \
Expand All @@ -30,8 +36,8 @@ docker run -d -p 8080:8080 \

### Create GraphQL Mesh Project

We need to have `yarn` and Node.js on our computer to run GraphQL Mesh locally.
Run the following command to create a new project on an empty directory;
We need to have `yarn` and Node.js on our computer to run GraphQL Mesh locally. Run the following
command to create a new project on an empty directory;

```sh
yarn init
Expand All @@ -45,9 +51,11 @@ yarn add graphql @graphql-mesh/cli @graphql-mesh/json-schema

### Create Proxy GraphQL API to OpenBrewery

OpenBrewery doesn't have any kind of recognized schema metadata, so we need to create our own using JSON Schema Handler;
OpenBrewery doesn't have any kind of recognized schema metadata, so we need to create our own using
JSON Schema Handler;

In OpenBrewery's documentation, they have examples for both request and response objects. Let's create files for each inside `/json-schemas` directory;
In OpenBrewery's documentation, they have examples for both request and response objects. Let's
create files for each inside `/json-schemas` directory;

```json filename="breweries.json"
// breweries.json
Expand Down Expand Up @@ -94,7 +102,7 @@ sources:
- name: OpenBrewery
handler:
jsonSchema:
baseUrl: https://api.openbrewerydb.org
endpoint: https://api.openbrewerydb.org
operations:
- type: Query
field: breweries
Expand All @@ -114,23 +122,30 @@ yarn mesh dev

### Connect new OpenBrewery API to Hasura

Go to [Remote Schemas](http://localhost:8080/console/remote-schemas/manage/schemas) tab in Hasura and add our OpenBrewery GraphQL API which has `http://host.docker.internal:4000/graphql`.
Go to [Remote Schemas](http://localhost:8080/console/remote-schemas/manage/schemas) tab in Hasura
and add our OpenBrewery GraphQL API which has `http://host.docker.internal:4000/graphql`.

> `host.docker.internal` is used because Docker accesses your host machine `localhost` under this alias.
> `host.docker.internal` is used because Docker accesses your host machine `localhost` under this
> alias.
### Create GraphQL fields for GeoDB

Go to [Data](http://localhost:8080/console/data/schema/public) tab in Hasura and track all the tables to see how complex relationships work with Mesh.
Go to [Data](http://localhost:8080/console/data/schema/public) tab in Hasura and track all the
tables to see how complex relationships work with Mesh.

### Create Remote Join between GeoDB and OpenBrewery

Let's say we would like to see breweries in a specific city. Go to [Data](http://localhost:8080/console/data/schema/public) tab in Hasura and scroll down to **Remote Relationships** section. Add `breweries` field to `City` by connecting `breweries.by_city` argument and `City.name` parent field like below;
Let's say we would like to see breweries in a specific city. Go to
[Data](http://localhost:8080/console/data/schema/public) tab in Hasura and scroll down to **Remote
Relationships** section. Add `breweries` field to `City` by connecting `breweries.by_city` argument
and `City.name` parent field like below;

![image](https://user-images.githubusercontent.com/20847995/83945179-a71fa200-a811-11ea-81fc-e641e68bc9ce.png)

### Make a query to see how it works

Go to [GraphiQL](http://localhost:8080/console/api-explorer) and make a query like below to see how the integration works;
Go to [GraphiQL](http://localhost:8080/console/api-explorer) and make a query like below to see how
the integration works;

```graphql
{
Expand Down
Loading

0 comments on commit c84f817

Please sign in to comment.