-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* e2e setup * prepare and setup * cjs * should start mesh * improved utils * available port and stuff * use tsx cjs loader * test compose and waitforexit reject * fix compose * e2e test ci * chore(dependencies): updated changesets for modified dependencies * sync getavailport * e2e node matrix * changeset * serve script * tenv and stuff * tenv args and serve helper * tenv only serve and compose * esm config in cjs project * simplify and use 0.0.0.0 * more details * extend proc and less listners * stderr for logs, stdout for outputs * stable tenv std * compose to stdout * unnecessary serve script * more wait for serve * stable stderr * compose to target * simpler match for stability * actually check stuff * update snapshots * snapshot file * unnecessary port * use 0.0.0.0 * unnecessary comment * allow nodejs modules in e2e * better args * refactor and begin with type merging batching example * increase timeout * open example * clarify * link * lol * lol * even more lol * test plans * WIP spawn detached and kill whole process group * improve child process handling and use node with tsx for subgraphs * stop reachability wait after exit * append new line when logging to stderr * nobuild e2e * utils mkdir independant of fs * type merging batching planning tests run concurrently * execution tests * check for aborted on retry * touches * fix(fusion/query-planner): skip the resolver if it has required variables that the parent subgraph doesn't have * update snaps * unnecessary assers * listen to stderr * subgraphs -> services * service can be in <name>/index.ts * thrift-calculator * sqlite-chinook * lockfile * serveoptions * ensure compose creates file * tenv serve.execute * just fusiongraph * rest transport explicit type export * openapi-javascript-wiki * simpler doc * tenv composition target is temp * use target's absolute path if detected * unused import * increase reachability wait timeout even more * try less workeser * await available port making sure the server closes * maxConcurr * use __project * wait for reachability longer * disposable * waitforexit is internal * tenv containers and waiting adjustments * mysql-employees * mysql-employees no dates * neo4j-example * detectopenhandles * args type leak from cjs-project * auto-type-merging * timeout e2e tests because of open handles * batching-resolver * federation-example * unnecessary delay * federation example servers * soap-demo * openapi-subscriptions * no example queries * revert prettierpath * tfetch not necessary * unnecessary deferstream plugin * openapi v3 petstore * mysql-rfam * batching resolver simpler api service * lockfile * json-schema-subscriptions * fusiongraph is not necessary * json-schema-reddit * neo4j uses serve and pubsub * make sure the pubsub is destroyed * mysql-rfam pubsub * lockfile * use ardatan/graphql-tools#6055 * chore(dependencies): updated changesets for modified dependencies * specify endpoint for petstore * auto-type-merging use container petstore * use stable release of utils * chore(dependencies): updated changesets for modified dependencies * Fix federation example * no skipping * no dates in snaps * Changeset * update snap relating to a720512 * json-schema-reddit example * use stable release of utils * chore(dependencies): updated changesets for modified dependencies --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Arda TANRIKULU <[email protected]>
- Loading branch information
1 parent
e196a82
commit 6399add
Showing
296 changed files
with
8,132 additions
and
64,617 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@graphql-mesh/compose-cli": patch | ||
--- | ||
dependencies updates: | ||
- Added dependency [`tsx@^4.7.1` ↗︎](https://www.npmjs.com/package/tsx/v/4.7.1) (to `dependencies`) | ||
- Removed dependency [`ts-node@^10.9.2` ↗︎](https://www.npmjs.com/package/ts-node/v/10.9.2) (from `dependencies`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@graphql-mesh/fusion-runtime": patch | ||
--- | ||
dependencies updates: | ||
- Updated dependency [`@graphql-tools/utils@^10.1.3` ↗︎](https://www.npmjs.com/package/@graphql-tools/utils/v/10.1.3) (from `^10.1.0`, in `dependencies`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@graphql-mesh/serve-cli": patch | ||
--- | ||
dependencies updates: | ||
- Added dependency [`tsx@^4.7.1` ↗︎](https://www.npmjs.com/package/tsx/v/4.7.1) (to `dependencies`) | ||
- Removed dependency [`ts-node@^10.9.2` ↗︎](https://www.npmjs.com/package/ts-node/v/10.9.2) (from `dependencies`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@graphql-mesh/serve-runtime": patch | ||
--- | ||
dependencies updates: | ||
- Updated dependency [`@graphql-tools/utils@^10.1.3` ↗︎](https://www.npmjs.com/package/@graphql-tools/utils/v/10.1.3) (from `^10.0.8`, in `dependencies`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@graphql-mesh/utils": patch | ||
--- | ||
|
||
fs operations types don't depend on Node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@graphql-mesh/serve-cli": patch | ||
--- | ||
|
||
Destroy pubsub on process kill signals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@graphql-mesh/compose-cli": minor | ||
"@graphql-mesh/serve-cli": minor | ||
--- | ||
|
||
use tsx node loader instead of ts-node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@graphql-mesh/transport-rest": patch | ||
--- | ||
|
||
Explicitly specify type for type exports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
"@graphql-mesh/fusion-execution": patch | ||
--- | ||
|
||
Skip the resolver if it has required variables that the parent subgraph doesn't have | ||
|
||
```graphql | ||
type Foo | ||
# There is only Foo_A_id, but no Foo_B_id or Foo_C_id | ||
@variable(name: "Foo_A_id", select: "id", subgraph: "A") | ||
# This resolver should be skipped | ||
@resolver(operation: "query FooFromB($Foo_B_id: ID!) { foo(id: $Foo_B_id) }", subgraph: "B") | ||
# This resolver should be used | ||
@resolver(operation: "query FooFromB($Foo_A_id: ID!) { foo(id: $Foo_A_id) }", subgraph: "B") | ||
# This resolver should be skipped | ||
@resolver(operation: "query FooFromC($Foo_C_id: ID!) { foo(id: $Foo_C_id) }", subgraph: "C") | ||
# This resolver should be used | ||
@resolver(operation: "query FooFromC($Foo_A_id: ID!) { foo(id: $Foo_A_id) }", subgraph: "C") { | ||
id: ID! @source(subgraph: "A") | ||
bar: String! @source(subgraph: "B") | ||
baz: String! @source(subgraph: "C") | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@graphql-mesh/fusion-federation": patch | ||
--- | ||
|
||
- Use the subgraph names given by the user instead of uppercased ones generated by Rover CLI | ||
- If a field that is a key in a different supergraph but is an external field, still consider it as a part of that subgraph for Fusion query planning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@graphql-mesh/compose-cli": patch | ||
--- | ||
|
||
fix writing to json target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@graphql-mesh/compose-cli": minor | ||
--- | ||
|
||
write composed schema to stdout by default when no target is specified |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@graphql-mesh/compose-cli": patch | ||
--- | ||
|
||
Use target's absolute path if detected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@graphql-mesh/utils": minor | ||
--- | ||
|
||
logs go to stderr, stdout is for program result or output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ dist/ | |
.bob/ | ||
.yarn | ||
supergraph-invalid.graphql | ||
__generated__/ |
270 changes: 270 additions & 0 deletions
270
e2e/auto-type-merging/__snapshots__/auto-type-merging.test.ts.snap
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Container, createTenv } from '@e2e/tenv'; | ||
|
||
const { compose, service, serve, container } = createTenv(__dirname); | ||
|
||
let petstore!: Container; | ||
beforeAll(async () => { | ||
petstore = await container({ | ||
name: 'petstore', | ||
image: 'swaggerapi/petstore3:1.0.7', | ||
containerPort: 8080, | ||
healthcheck: ['CMD-SHELL', 'wget --spider http://0.0.0.0:8080'], | ||
}); | ||
}); | ||
|
||
it('should compose the appropriate schema', async () => { | ||
const { result } = await compose({ | ||
services: [petstore, await service('vaccination')], | ||
maskServicePorts: true, | ||
}); | ||
expect(result).toMatchSnapshot(); | ||
}); | ||
|
||
it.concurrent.each([ | ||
{ | ||
name: 'GetPet', | ||
query: /* GraphQL */ ` | ||
query GetPet { | ||
getPetById(petId: 1) { | ||
__typename | ||
id | ||
name | ||
vaccinated | ||
} | ||
} | ||
`, | ||
}, | ||
])('should execute $name', async ({ query }) => { | ||
const { target } = await compose({ | ||
target: 'graphql', | ||
services: [petstore, await service('vaccination')], | ||
}); | ||
const { execute } = await serve({ fusiongraph: target }); | ||
await expect(execute({ query })).resolves.toMatchSnapshot(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "@e2e/auto-type-merging", | ||
"private": true, | ||
"devDependencies": { | ||
"@graphql-mesh/compose-cli": "workspace:*", | ||
"@graphql-mesh/serve-cli": "workspace:*", | ||
"@omnigraph/openapi": "workspace:*", | ||
"graphql": "^16.8.1", | ||
"graphql-yoga": "^5.1.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
e2e/batching-resolver/__snapshots__/batching-resolver.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`should compose the appropriate schema 1`] = ` | ||
"schema @transport(subgraph: "API", kind: "rest", location: "http://0.0.0.0:<api_port>") { | ||
query: Query | ||
mutation: Mutation | ||
} | ||
directive @httpOperation(subgraph: String, path: String, operationSpecificHeaders: ObjMap, httpMethod: HTTPMethod, isBinary: Boolean, requestBaseBody: ObjMap, queryParamArgMap: ObjMap, queryStringOptionsByParam: ObjMap, jsonApiFields: Boolean) on FIELD_DEFINITION | ||
directive @transport(subgraph: String, kind: String, location: String, headers: ObjMap, queryStringOptions: ObjMap, queryParams: ObjMap) on OBJECT | ||
type Query { | ||
dummy: String @resolver(subgraph: "API", operation: "query dummy { dummy }") @source(subgraph: "API", name: "dummy", type: "String") | ||
user(id: Float!): User @resolver(subgraph: "API", kind: BATCH, operation: """ | ||
mutation UserBatch($id: [Float!]!) { | ||
usersByIds(input: { ids: $id }) { | ||
results | ||
} | ||
} | ||
""") | ||
} | ||
type Mutation { | ||
usersByIds(input: UsersByIdRequest_Input): UsersByIdResponse @httpOperation(subgraph: "API", path: "/users_by_ids", operationSpecificHeaders: "\\"{\\\\\\"Content-Type\\\\\\":\\\\\\"application/json\\\\\\",\\\\\\"accept\\\\\\":\\\\\\"application/json\\\\\\"}\\"", httpMethod: POST) @resolver(subgraph: "API", operation: "mutation mutationusersByIds($input: UsersByIdRequest_Input) { usersByIds(input: $input) }") @source(subgraph: "API", name: "usersByIds", type: "UsersByIdResponse") | ||
} | ||
type UsersByIdResponse @source(subgraph: "API", name: "UsersByIdResponse") { | ||
results: [User]! @source(subgraph: "API", name: "results", type: "[User]!") | ||
} | ||
type User @source(subgraph: "API", name: "User") { | ||
id: Float! @source(subgraph: "API", name: "id", type: "Float!") | ||
name: String! @source(subgraph: "API", name: "name", type: "String!") | ||
} | ||
input UsersByIdRequest_Input @source(subgraph: "API", name: "UsersByIdRequest_Input") { | ||
ids: [Float]! @source(subgraph: "API", name: "ids", type: "[Float]!") | ||
} | ||
scalar ObjMap @source(subgraph: "API", name: "ObjMap") @source(subgraph: "API", name: "ObjMap") | ||
enum HTTPMethod @source(subgraph: "API", name: "HTTPMethod") { | ||
GET @source(subgraph: "API", name: "GET") | ||
HEAD @source(subgraph: "API", name: "HEAD") | ||
POST @source(subgraph: "API", name: "POST") | ||
PUT @source(subgraph: "API", name: "PUT") | ||
DELETE @source(subgraph: "API", name: "DELETE") | ||
CONNECT @source(subgraph: "API", name: "CONNECT") | ||
OPTIONS @source(subgraph: "API", name: "OPTIONS") | ||
TRACE @source(subgraph: "API", name: "TRACE") | ||
PATCH @source(subgraph: "API", name: "PATCH") | ||
} | ||
" | ||
`; | ||
exports[`should execute User 1`] = ` | ||
{ | ||
"data": { | ||
"jane": [ | ||
{ | ||
"id": 2, | ||
"name": "Jane Doe", | ||
}, | ||
], | ||
"john": [ | ||
{ | ||
"id": 1, | ||
"name": "John Doe", | ||
}, | ||
], | ||
}, | ||
} | ||
`; |
Oops, something went wrong.