Skip to content

Commit afaa62d

Browse files
committed
Revert unnecessary breaking change
1 parent 53c0ec5 commit afaa62d

File tree

6 files changed

+14
-4
lines changed

6 files changed

+14
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,15 +452,15 @@ Then use the `jsonGraphqlExpress` express middleware:
452452

453453
```js
454454
import express from 'express';
455-
import { jsonGraphqlExpress } from 'json-graphql-server/node';
455+
import jsonGraphqlExpress from 'json-graphql-server/node';
456456

457457
const PORT = 3000;
458458
const app = express();
459459
const data = {
460460
// ... your data
461461
};
462462

463-
app.use('/graphql', jsonGraphqlExpress.default(data));
463+
app.use('/graphql', jsonGraphqlExpress(data));
464464
app.listen(PORT);
465465
```
466466

example/index.html renamed to example/browser/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</head>
66
<body>
77
<button id="button">Load posts</button>
8-
<script src="../dist/json-graphql-server.umd.cjs"></script>
8+
<script src="../../dist/json-graphql-server.umd.cjs"></script>
99
<script type="text/javascript">
1010
window.addEventListener('load', function() {
1111
const data = {
File renamed without changes.

example/data.cjs renamed to example/node/data.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
customers: [
33
{
44
id: 0,

example/node/index.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import express from 'express';
2+
import jsonGraphqlExpress from '../../dist/json-graphql-server-node.js';
3+
import data from './data.mjs';
4+
5+
const PORT = 3000;
6+
const app = express();
7+
8+
app.use('/graphql', jsonGraphqlExpress(data));
9+
app.listen(PORT);

src/node.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ import schemaBuilder, { getPlainSchema } from './schemaBuilder';
33

44
export const jsonSchemaBuilder = schemaBuilder;
55
export { getPlainSchema, jsonGraphqlExpress };
6+
export default jsonGraphqlExpress;

0 commit comments

Comments
 (0)