Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4c76c59

Browse files
committedSep 21, 2022
Add missing file from graphql#3361
1 parent 87d003d commit 4c76c59

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
 

‎integrationTests/node/index.cjs

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const assert = require('assert');
2+
const { readFileSync } = require('fs');
3+
4+
const { graphqlSync } = require('graphql');
5+
const { buildSchema } = require('graphql/utilities');
6+
const { version } = require('graphql/version');
7+
8+
assert.deepStrictEqual(
9+
version,
10+
JSON.parse(readFileSync('./node_modules/graphql/package.json')).version,
11+
);
12+
13+
const schema = buildSchema('type Query { hello: String }');
14+
15+
const result = graphqlSync({
16+
schema,
17+
source: '{ hello }',
18+
rootValue: { hello: 'world' },
19+
});
20+
21+
assert.deepStrictEqual(result, {
22+
data: {
23+
__proto__: null,
24+
hello: 'world',
25+
},
26+
});

0 commit comments

Comments
 (0)
Please sign in to comment.