Skip to content

Commit eeaa59f

Browse files
Merge branch 'master' into develop
2 parents c3954ef + 9a66f54 commit eeaa59f

File tree

3 files changed

+48
-28
lines changed

3 files changed

+48
-28
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [8.0.0](https://github.com/teamstarter/graphql-sequelize-generator/compare/v7.5.1...v8.0.0) (2023-01-31)
6+
7+
8+
### Bug Fixes
9+
10+
* **associations:** Fix limit and offset type from string to int. And fix many small linting issues. ([04fc241](https://github.com/teamstarter/graphql-sequelize-generator/commit/04fc241))
11+
* **documentation:** Update documentation to warn of Apollo upgrade. ([ab5c67d](https://github.com/teamstarter/graphql-sequelize-generator/commit/ab5c67d))
12+
13+
14+
### Features
15+
16+
* **infra:** Upgrade minium node version. ([2d9ecf4](https://github.com/teamstarter/graphql-sequelize-generator/commit/2d9ecf4))
17+
18+
19+
### BREAKING CHANGES
20+
21+
* **documentation:** Update documentation to warn of Apollo upgrade.
22+
23+
24+
525
### [7.5.1](https://github.com/teamstarter/graphql-sequelize-generator/compare/v7.5.0...v7.5.1) (2022-01-20)
626

727
### Features

README.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ It's a very good fit for POCs and MVPs, while also scaling pretty well thanks to
88
---
99

1010
## Documentation
11+
1112
The complete documentation car be found [here](https://teamstarter.github.io/gsg-documentation/)
1213

1314
## What can I do with GSG?
@@ -54,62 +55,62 @@ Create a file where you will set up your server and paste the following code. We
5455

5556
```javascript
5657
// index.js
57-
const { expressMiddleware } = require("@apollo/server/express4");
58-
const express = require("express");
59-
const http = require("http");
60-
const cors = require("cors");
61-
const json = require("body-parser");
62-
const { createContext, EXPECTED_OPTIONS_KEY } = require("dataloader-sequelize");
63-
const setupServer = require("./schema");
64-
const models = require("./models"); //Assuming "models" is your import of the Sequelize models folder, initialized by Sequelize-Cli
58+
const { expressMiddleware } = require('@apollo/server/express4')
59+
const express = require('express')
60+
const http = require('http')
61+
const cors = require('cors')
62+
const json = require('body-parser')
63+
const { createContext, EXPECTED_OPTIONS_KEY } = require('dataloader-sequelize')
64+
const setupServer = require('./schema')
65+
const models = require('./models') //Assuming "models" is your import of the Sequelize models folder, initialized by Sequelize-Cli
6566

6667
const createServer = async (options = {}, globalPreCallback = () => null) => {
67-
const app = express();
68+
const app = express()
6869
options = {
6970
spdy: { plain: true },
7071
...options,
71-
};
72-
const httpServer = http.createServer(options, app);
73-
const { server } = setupServer(globalPreCallback, httpServer);
74-
await server.start();
72+
}
73+
const httpServer = http.createServer(options, app)
74+
const { server } = setupServer(globalPreCallback, httpServer)
75+
await server.start()
7576
//server.applyMiddleware({ app, path: '/graphql' })
7677
app.use(
77-
"/graphql",
78+
'/graphql',
7879
cors(),
7980
json(),
8081
expressMiddleware(server, {
8182
context: async ({ req, connection }) => {
82-
const contextDataloader = createContext(models.sequelize);
83+
const contextDataloader = createContext(models.sequelize)
8384

8485
// Connection is provided when a webSocket is connected.
8586
if (connection) {
8687
// check connection for metadata
8788
return {
8889
...connection.context,
8990
[EXPECTED_OPTIONS_KEY]: contextDataloader,
90-
};
91+
}
9192
}
9293
},
9394
})
94-
);
95+
)
9596

9697
await new Promise((resolve) => {
9798
httpServer.listen(process.env.PORT || 8080, () => {
98-
resolve();
99-
});
99+
resolve()
100+
})
100101

101102
console.log(
102103
`🚀 Server ready at http://localhost:${process.env.PORT || 8080}/graphql`
103-
);
104-
});
105-
return httpServer;
106-
};
104+
)
105+
})
106+
return httpServer
107+
}
107108

108109
const closeServer = async (server) => {
109-
await Promise.all([new Promise((resolve) => server.close(() => resolve()))]);
110-
};
110+
await Promise.all([new Promise((resolve) => server.close(() => resolve()))])
111+
}
111112

112-
createServer();
113+
createServer()
113114
```
114115

115116
## Getting started with boilerplates
@@ -118,4 +119,3 @@ You can easily start a project with graphql-sequelize-generator using these boil
118119

119120
- In JavaScript : [GSG Boilerplate](https://github.com/teamstarter/gsg-boilerplate)
120121
- In TypeScript : [GSG Typescript Boilerplate](https://github.com/teamstarter/gsg-boilerplate-typescript)
121-

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "graphql-sequelize-generator",
3-
"version": "7.5.1",
3+
"version": "8.0.0",
44
"description": "A set of tools to easily generate a Graphql API from sequelize models.",
55
"keywords": [
66
"graphql",

0 commit comments

Comments
 (0)