You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-74Lines changed: 7 additions & 74 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,82 +18,11 @@
18
18
19
19
## Summary
20
20
21
-
Warthog is a [Node.js](http://nodejs.org) GraphQL API framework for quickly building consistent GraphQL APIs that have sorting, filtering and pagination out of the box. It is written in [TypeScript](http://www.typescriptlang.org) and makes heavy use of decorators for concise, declarative code.
22
-
23
-
## Note: Upgrading from 1.0 to 2.0
24
-
25
-
Warthog is now on version 2.0! There were a few breaking changes that you should consider while upgrading. Also, we tried to keep all new features development on v1, but did end up adding JSON filtering directly to 2.0 as it was much easier given some foundation refactors.
26
-
27
-
<details>
28
-
<summary>Expand for Breaking change details</summary>
29
-
<p>
30
-
31
-
### More specific scalars
32
-
33
-
A few fields have been updated to use more specific GraphQL scalars:
34
-
35
-
- ID fields: previously these were represented by type `String`. Dates now use type `ID`
36
-
- Date fields: previously these were represented by type `String`. Dates now use type `DateTime`
37
-
38
-
Since your GraphQL schema has changed and so have the associated TypeScript types in `classes.ts`, there might be changes in your server code and even perhaps some associated client code if you use these generated classes in your client code.
39
-
40
-
### `mockDBConnection` has been removed
41
-
42
-
The old codegen pipeline used TypeORM's metadata in order to generate the GraphQL schema since Warthog didn't also capture this metadata. Warthog now captures the necessary metadata, so we no longer need to lean on TypeORM and therefore we don't need the `mockDBConnection` we previously used during codegen. Searching your codebase for `mockDBConnection` and `WARTHOG_MOCK_DATABASE`/`MOCK_DATABASE` should do it. If you've been using the Warthog CLI for codegen, you shouldn't have anything to do here.
43
-
44
-
### Project Dependencies Updated
45
-
46
-
Staying on the latest versions of libraries is good for security, performance and new features. We've bumped to the latest stable versions of each of Warthog's dependencies. This might require some changes to your package.json.
47
-
48
-
### Troubleshooting
49
-
50
-
#### Cannot get connection "default" from the connection manager
51
-
52
-
If you get an error like:
53
-
54
-
```txt
55
-
Cannot get connection "default" from the connection manager. Make sure you have created such connection. Also make sure you have called useContainer(Container) in your application before you established a connection and importing any entity.
56
-
```
57
-
58
-
It could be caused by 2 things:
59
-
60
-
##### Remove explicit `Container` injection
61
-
62
-
In V1 of Warthog, the README suggested that you should explicitly create your DI containers and pass them into your `App` instance like so:
63
-
64
-
```typescript
65
-
import { Container } from'typedi'; // REMOVE this
66
-
import { useContainer } from'typeorm'; // REMOVE this
67
-
68
-
import { App } from'warthog';
69
-
70
-
asyncfunction run() {
71
-
useContainer(Container); // REMOVE this
72
-
73
-
const app =newApp({ container: Container }); // REMOVE the container option here
74
-
awaitapp.start();
75
-
}
76
-
```
77
-
78
-
In V2, it is recommended that you no longer do this unless you explicitly need access to the Container.
79
-
80
-
##### Remove references to Warthog's dependencies
81
-
82
-
It can sometimes cause problems to explicitly require Warthog's depdendencies (ie `type-graphql`, `typedi`, `typeorm` and `typeorm-typedi-extensions`). In future versions, remove these explicit dependencies from `package.json`:
83
-
84
-
```txt
85
-
- "type-graphql": "...",
86
-
- "typedi": "...",
87
-
- "typeorm": "...",
88
-
- "typeorm-typedi-extensions": "...",
89
-
```
90
-
91
-
</p>
92
-
</details>
21
+
Warthog is a [Node.js](http://nodejs.org) GraphQL API framework for quickly building consistent GraphQL APIs that have sorting, filtering and pagination out of the box. It is written in [TypeScript](http://www.typescriptlang.org) and makes use of decorators for concise, declarative code. With Warthog, you write your models and resolvers and we handle the rest.
93
22
94
23
## Philosophy
95
24
96
-
This library is intentionally opinionated and generates as much code as possible. When teams build products quickly, even if they have strong conventions and good linters, the GraphQL can quickly become inconsistent, making it difficult for clients to consume the APIs in a reusable way.
25
+
This library brings a lot of opinions and generates as much code as possible. When teams build products quickly, even if they have strong conventions and good linters, the GraphQL can quickly become inconsistent, making it difficult for clients to consume the APIs in a reusable way.
97
26
98
27
To do this, Warthog automatically generates the following:
99
28
@@ -112,7 +41,7 @@ Further, it covers the following concerns by hooking into best-in-class open sou
112
41
113
42
## Prerequisites
114
43
115
-
Warthog currently only supports PostgreSQL as a DB engine, so you must have Postgres installed before getting Warthog set up. (Note: Postgres 12 is not currently supported)
44
+
Warthog currently only supports PostgreSQL as a DB engine, so you must have Postgres (version 10, 11 or 12) installed before getting Warthog set up.
116
45
117
46
<details>
118
47
<summary>Expand for Postgres installation options</summary>
@@ -254,6 +183,10 @@ Note that the examples in the [examples](./examples/README.md) folder use relati
254
183
</p>
255
184
</details>
256
185
186
+
## Documentation
187
+
188
+
Our documentation is hosted at [warthog.dev](https://warthog.dev) or you can browse the [docs](./docs/src) directory.
189
+
257
190
## Contributing
258
191
259
192
PRs accepted, fire away! Or add issues if you have use cases Warthog doesn't cover.
0 commit comments