@vantreeseba/drizzle-graphql 10.0.0 → 10.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -1
- package/dist/index.cjs +382 -247
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +383 -248
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ Automatically create GraphQL schema or customizable schema config fields from Dr
|
|
|
51
51
|
// Create a custom one
|
|
52
52
|
customUsers: {
|
|
53
53
|
// You can reuse and customize types from original schema
|
|
54
|
-
type: new GraphQLList(new GraphQLNonNull(entities.types.
|
|
54
|
+
type: new GraphQLList(new GraphQLNonNull(entities.types.Users)),
|
|
55
55
|
args: {
|
|
56
56
|
// You can reuse inputs as well
|
|
57
57
|
where: {
|
|
@@ -79,12 +79,20 @@ Automatically create GraphQL schema or customizable schema config fields from Dr
|
|
|
79
79
|
const yoga = createYoga({
|
|
80
80
|
schema
|
|
81
81
|
})
|
|
82
|
+
const server = createServer(yoga)
|
|
82
83
|
|
|
83
84
|
server.listen(4000, () => {
|
|
84
85
|
console.info('Server is running on http://localhost:4000/graphql')
|
|
85
86
|
})
|
|
86
87
|
```
|
|
87
88
|
|
|
89
|
+
The keys on `entities` follow the naming rules below: with the defaults, table `users`
|
|
90
|
+
gives type `entities.types.Users`, inputs `entities.inputs.UsersFilters` /
|
|
91
|
+
`UsersOrderBy` / `CreateUsersInput` / `UpdateUsersInput`, queries
|
|
92
|
+
`entities.queries.users` / `usersSingle`, and mutations
|
|
93
|
+
`entities.mutations.createUsers` / `updateUsers` / `deleteUsers`. A `typeNameMapper`
|
|
94
|
+
changes these keys too, so a composed schema has to use the mapped names.
|
|
95
|
+
|
|
88
96
|
## Naming the generated types and fields
|
|
89
97
|
|
|
90
98
|
By default every name comes from the table's key in the Drizzle schema: `tasks` gives type
|