Skip to content

Commit 93fb364

Browse files
Import/require enhancements (#8082)
* Import/require enhancements * Gogo * More * Fix tests * default search * Go * Prettier * Let's go * Dynamic import * Fix versions * chore(dependencies): updated changesets for modified dependencies * .. * Go * Lets go * Changeset --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 19758dc commit 93fb364

File tree

53 files changed

+315
-435
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+315
-435
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@graphql-mesh/compose-cli": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`@graphql-mesh/fusion-composition@^0.7.13` ↗︎](https://www.npmjs.com/package/@graphql-mesh/fusion-composition/v/0.7.13) (from `workspace:^`, in `dependencies`)
6+
- Updated dependency [`@graphql-mesh/include@^0.2.6` ↗︎](https://www.npmjs.com/package/@graphql-mesh/include/v/0.2.6) (from `workspace:^`, in `dependencies`)
7+
- Updated dependency [`@graphql-mesh/string-interpolation@^0.5.7` ↗︎](https://www.npmjs.com/package/@graphql-mesh/string-interpolation/v/0.5.7) (from `workspace:^`, in `dependencies`)
8+
- Updated dependency [`@graphql-mesh/types@^0.103.7` ↗︎](https://www.npmjs.com/package/@graphql-mesh/types/v/0.103.7) (from `workspace:^`, in `dependencies`)
9+
- Updated dependency [`@graphql-mesh/utils@^0.103.7` ↗︎](https://www.npmjs.com/package/@graphql-mesh/utils/v/0.103.7) (from `workspace:^`, in `dependencies`)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@graphql-mesh/graphql": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`@graphql-mesh/cross-helpers@^0.4.9` ↗︎](https://www.npmjs.com/package/@graphql-mesh/cross-helpers/v/0.4.9) (from `workspace:^`, in `dependencies`)
6+
- Updated dependency [`@graphql-mesh/store@^0.103.7` ↗︎](https://www.npmjs.com/package/@graphql-mesh/store/v/0.103.7) (from `workspace:^`, in `dependencies`)
7+
- Updated dependency [`@graphql-mesh/string-interpolation@^0.5.7` ↗︎](https://www.npmjs.com/package/@graphql-mesh/string-interpolation/v/0.5.7) (from `workspace:^`, in `dependencies`)
8+
- Updated dependency [`@graphql-mesh/types@^0.103.7` ↗︎](https://www.npmjs.com/package/@graphql-mesh/types/v/0.103.7) (from `workspace:^`, in `dependencies`)
9+
- Updated dependency [`@graphql-mesh/utils@^0.103.7` ↗︎](https://www.npmjs.com/package/@graphql-mesh/utils/v/0.103.7) (from `workspace:^`, in `dependencies`)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@graphql-mesh/plugin-operation-headers": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`@graphql-mesh/types@^0.103.7` ↗︎](https://www.npmjs.com/package/@graphql-mesh/types/v/0.103.7) (from `workspace:^`, in `dependencies`)
6+
- Updated dependency [`@graphql-mesh/utils@^0.103.7` ↗︎](https://www.npmjs.com/package/@graphql-mesh/utils/v/0.103.7) (from `workspace:^`, in `dependencies`)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@graphql-mesh/supergraph": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`@graphql-mesh/cross-helpers@^0.4.9` ↗︎](https://www.npmjs.com/package/@graphql-mesh/cross-helpers/v/0.4.9) (from `workspace:^`, in `dependencies`)
6+
- Updated dependency [`@graphql-mesh/store@^0.103.7` ↗︎](https://www.npmjs.com/package/@graphql-mesh/store/v/0.103.7) (from `workspace:^`, in `dependencies`)
7+
- Updated dependency [`@graphql-mesh/string-interpolation@^0.5.7` ↗︎](https://www.npmjs.com/package/@graphql-mesh/string-interpolation/v/0.5.7) (from `workspace:^`, in `dependencies`)
8+
- Updated dependency [`@graphql-mesh/types@^0.103.7` ↗︎](https://www.npmjs.com/package/@graphql-mesh/types/v/0.103.7) (from `workspace:^`, in `dependencies`)
9+
- Updated dependency [`@graphql-mesh/utils@^0.103.7` ↗︎](https://www.npmjs.com/package/@graphql-mesh/utils/v/0.103.7) (from `workspace:^`, in `dependencies`)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@omnigraph/openapi": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`@graphql-mesh/cross-helpers@^0.4.9` ↗︎](https://www.npmjs.com/package/@graphql-mesh/cross-helpers/v/0.4.9) (from `workspace:^`, in `dependencies`)
6+
- Updated dependency [`@graphql-mesh/fusion-composition@^0.7.13` ↗︎](https://www.npmjs.com/package/@graphql-mesh/fusion-composition/v/0.7.13) (from `workspace:^`, in `dependencies`)
7+
- Updated dependency [`@graphql-mesh/string-interpolation@^0.5.7` ↗︎](https://www.npmjs.com/package/@graphql-mesh/string-interpolation/v/0.5.7) (from `workspace:^`, in `dependencies`)
8+
- Updated dependency [`@graphql-mesh/types@^0.103.7` ↗︎](https://www.npmjs.com/package/@graphql-mesh/types/v/0.103.7) (from `workspace:^`, in `dependencies`)
9+
- Updated dependency [`@graphql-mesh/utils@^0.103.7` ↗︎](https://www.npmjs.com/package/@graphql-mesh/utils/v/0.103.7) (from `workspace:^`, in `dependencies`)
10+
- Updated dependency [`@omnigraph/json-schema@^0.108.7` ↗︎](https://www.npmjs.com/package/@omnigraph/json-schema/v/0.108.7) (from `workspace:^`, in `dependencies`)
11+
- Updated dependency [`json-machete@^0.97.5` ↗︎](https://www.npmjs.com/package/json-machete/v/0.97.5) (from `workspace:^`, in `dependencies`)

.changeset/twelve-tigers-applaud.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@graphql-mesh/config': patch
3+
'@graphql-mesh/cli': patch
4+
'@graphql-mesh/include': patch
5+
'@graphql-mesh/json-schema': patch
6+
'@graphql-mesh/runtime': patch
7+
'@graphql-mesh/utils': patch
8+
---
9+
10+
Import enhancements

babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ module.exports = {
66
plugins: [
77
'@babel/plugin-proposal-class-properties',
88
'@babel/plugin-proposal-explicit-resource-management',
9+
'@babel/plugin-syntax-top-level-await',
910
],
1011
};

examples/federation-example/tests/polling.test.ts

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,20 @@ describe('Polling Test', () => {
4040
SUPERGRAPH_SOURCE,
4141
},
4242
});
43+
if (process.env.DEBUG) {
44+
buildCmd.stderr?.on('data', function stderrListener(data: string) {
45+
console.error(data);
46+
});
47+
}
4348
await new Promise<void>(resolve => {
4449
buildCmd.stdout?.on('data', function stdoutListener(data: string) {
4550
if (data.includes('Done!')) {
4651
buildCmd.stdout?.off('data', stdoutListener);
4752
resolve();
4853
}
54+
if (process.env.DEBUG) {
55+
console.log(data);
56+
}
4957
});
5058
});
5159
const port = await getAvailablePort();
@@ -57,6 +65,11 @@ describe('Polling Test', () => {
5765
SUPERGRAPH_SOURCE,
5866
},
5967
});
68+
if (process.env.DEBUG) {
69+
serveCmd.stderr?.on('data', function stderrListener(data: string) {
70+
console.error(data);
71+
});
72+
}
6073
await new Promise<void>(resolve => {
6174
serveCmd.stdout?.on('data', function stdoutListener(data: string) {
6275
if (process.env.DEBUG) {
@@ -70,13 +83,14 @@ describe('Polling Test', () => {
7083
});
7184
const hostname = await getLocalHostName(port);
7285
const url = `http://${hostname}:${port}/graphql`;
73-
const resp = await fetch(url, {
74-
method: 'POST',
75-
headers: {
76-
'Content-Type': 'application/json',
77-
},
78-
body: JSON.stringify({
79-
query: `
86+
await expect(
87+
fetch(url, {
88+
method: 'POST',
89+
headers: {
90+
'Content-Type': 'application/json',
91+
},
92+
body: JSON.stringify({
93+
query: `
8094
{
8195
__type(name:"Query") {
8296
fields {
@@ -85,10 +99,9 @@ describe('Polling Test', () => {
8599
}
86100
}
87101
`,
88-
}),
89-
});
90-
const data = await resp.json();
91-
expect(data).toEqual({
102+
}),
103+
}).then(data => data.json()),
104+
).resolves.toEqual({
92105
data: {
93106
__type: {
94107
fields: [
@@ -110,13 +123,14 @@ describe('Polling Test', () => {
110123
});
111124
changedSupergraph = true;
112125
await new Promise(resolve => setTimeout(resolve, 3000));
113-
const resp2 = await fetch(url, {
114-
method: 'POST',
115-
headers: {
116-
'Content-Type': 'application/json',
117-
},
118-
body: JSON.stringify({
119-
query: `
126+
await expect(
127+
fetch(url, {
128+
method: 'POST',
129+
headers: {
130+
'Content-Type': 'application/json',
131+
},
132+
body: JSON.stringify({
133+
query: `
120134
{
121135
__type(name:"Query") {
122136
fields {
@@ -125,10 +139,9 @@ describe('Polling Test', () => {
125139
}
126140
}
127141
`,
128-
}),
129-
});
130-
const data2 = await resp2.json();
131-
expect(data2).toEqual({
142+
}),
143+
}).then(data => data.json()),
144+
).resolves.toEqual({
132145
data: {
133146
__type: {
134147
fields: [

examples/hello-world/.meshrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ documents:
1717
query HelloWorld {
1818
greeting
1919
}
20+
21+
serve:
22+
playground: true

examples/persisted-operations/tests/persisted-queries.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('Persisted Queries', () => {
3131
});
3232
});
3333

34-
afterAll(() => mesh.destroy());
34+
afterAll(() => mesh?.destroy());
3535

3636
it('should give correct response for inline persisted operation', async () => {
3737
const response = await meshHttp.fetch('/graphql', {

0 commit comments

Comments
 (0)