Skip to content

Commit 41477dc

Browse files
committed
chore: format & npm add over install
1 parent 026fe91 commit 41477dc

40 files changed

+279
-415
lines changed

.prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
dist
22
.now
3+
/website/*
4+
!/website/content

.prettierrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
...require('@prisma-labs/prettier-config'),
33
overrides: [
44
{
5-
files: ['prisma.md'],
5+
files: ['prisma.md', 'prisma.mdx'],
66
options: {
77
printWidth: 35,
88
},

docs/api/modules/main/exports/settings.md

-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ false | { formatError?: (authConfig: AuthConfig) => Error }
160160

161161
Disable or configure the `authorize` field behaviour.
162162

163-
164163
#### `schema.rootTypingsGlobPattern`
165164

166165
<div class="OneLineSignature"></div>

docs/components/logger/about.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
Delightful logging library that is pretty practical & performant
44

55
```cli
6-
npm install @nexus/logger
6+
npm add @nexus/logger
77
```

docs/components/schema/about.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# `@nexus/schema`
22

33
```cli
4-
npm install @nexus/schema
4+
npm add @nexus/schema
55
```
66

77
#### Why Nexus? {docsify-ignore}

docs/components/schema/api/copy/best-practices.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ code chunks. The most common approach is to break up types into files, either on
3838
However you end up structuring your files, they ultimately all need to be imported and passed to the `makeSchema` function, and keeping a consistent approach to file naming makes it simpler
3939

4040
```ts
41-
import * as userTypes from "./schema/user";
42-
import * as postTypes from "./schema/post";
43-
import * as commentTypes from "./schema/comment";
41+
import * as userTypes from './schema/user'
42+
import * as postTypes from './schema/post'
43+
import * as commentTypes from './schema/comment'
4444
```
4545

4646
You could also consolidate this in an `index.js` or similar export file:
4747

4848
```ts
49-
export * from "./user";
50-
export * from "./post";
51-
export * from "./comment";
49+
export * from './user'
50+
export * from './post'
51+
export * from './comment'
5252
```
5353

5454
Using that file to build the schema:

docs/components/schema/api/copy/ecosystem-plugins.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ sidebar_label: nexus-prisma
1111
`nexus-prisma` is for bridging [Prisma](https://www.prisma.io) and [Nexus](https://nexus.js.org). It extends the Nexus DSL `t` with `.model` and `.crud` making it easy to project Prisma models and expose operations against them in your GraphQL API. Resolvers are dynamically created for you removing the need for traditional ORMs/query builders like TypeORM, Sequelize, or Knex. Out-of-box features include pagination, filtering, and ordering. When you do need to drop down into custom resolvers a [`Photon`](https://photonjs.prisma.io) instance on `ctx` will be ready to serve you, the same great tool `nexus-prisma` itself bulids upon.
1212

1313
```ts
14-
import { nexusPrismaPlugin } from "nexus-prisma";
14+
import { nexusPrismaPlugin } from 'nexus-prisma'
1515

1616
makeSchema({
1717
// ...
1818
plugin: [nexusPrismaPlugin()],
19-
});
19+
})
2020
```
2121

2222
If you are still using `nexus-prisma@0.3` / Prisma 1 you can find the old docs [here](https://github.com/prisma-labs/nexus/blob/8cf2d6b3e22a9dec1f7c23f384bf33b7be5a25cc/docs/database-access-with-prisma-v2.md).

docs/components/schema/api/copy/getting-started.md

+30-30
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ GraphQL Nexus can be installed with either `npm` or `yarn`.
2929
<!--npm-->
3030

3131
```sh
32-
npm install nexus
33-
npm install graphql # required as a peer dependency
32+
npm add nexus
33+
npm add graphql # required as a peer dependency
3434
```
3535

3636
<!--yarn-->
@@ -56,47 +56,47 @@ import {
5656
intArg,
5757
arg,
5858
makeSchema,
59-
} from "@nexus/schema";
59+
} from '@nexus/schema'
6060

6161
const Node = interfaceType({
62-
name: "Node",
62+
name: 'Node',
6363
definition(t) {
64-
t.id("id", { description: "Unique identifier for the resource" });
65-
t.resolveType(() => null);
64+
t.id('id', { description: 'Unique identifier for the resource' })
65+
t.resolveType(() => null)
6666
},
67-
});
67+
})
6868

6969
const Account = objectType({
70-
name: "Account",
70+
name: 'Account',
7171
definition(t) {
72-
t.implements(Node); // or t.implements("Node")
73-
t.string("username");
74-
t.string("email");
72+
t.implements(Node) // or t.implements("Node")
73+
t.string('username')
74+
t.string('email')
7575
},
76-
});
76+
})
7777

7878
const StatusEnum = enumType({
79-
name: "StatusEnum",
80-
members: ["ACTIVE", "DISABLED"],
81-
});
79+
name: 'StatusEnum',
80+
members: ['ACTIVE', 'DISABLED'],
81+
})
8282

8383
const Query = queryType({
8484
definition(t) {
85-
t.field("account", {
85+
t.field('account', {
8686
type: Account, // or "Account"
8787
args: {
8888
name: stringArg(),
89-
status: arg({ type: "StatusEnum" }),
89+
status: arg({ type: 'StatusEnum' }),
9090
},
91-
});
92-
t.list.field("accountsById", {
91+
})
92+
t.list.field('accountsById', {
9393
type: Account, // or "Account"
9494
args: {
9595
ids: intArg({ list: true }),
9696
},
97-
});
97+
})
9898
},
99-
});
99+
})
100100

101101
// Recursively traverses the value passed to types looking for
102102
// any valid Nexus or graphql-js objects to add to the schema,
@@ -105,7 +105,7 @@ const schema = makeSchema({
105105
types: [Account, Node, Query, StatusEnum],
106106
// or types: { Account, Node, Query }
107107
// or types: [Account, [Node], { Query }]
108-
});
108+
})
109109
```
110110

111111
## Nullability & Default Values
@@ -132,13 +132,13 @@ One common idiom in GraphQL is exposing fields that mask or rename the property
132132

133133
```ts
134134
const User = objectType({
135-
name: "User",
135+
name: 'User',
136136
definition(t) {
137-
t.id("id", (o) => o.user_id);
138-
t.string("name", (o) => o.user_name);
139-
t.string("description", (o) => o.user_description);
137+
t.id('id', (o) => o.user_id)
138+
t.string('name', (o) => o.user_name)
139+
t.string('description', (o) => o.user_description)
140140
},
141-
});
141+
})
142142
```
143143

144144
## Auto-Generated Artifacts
@@ -153,10 +153,10 @@ const schema = makeSchema({
153153
/* All schema types provided here */
154154
],
155155
outputs: {
156-
schema: path.join(__dirname, "../../my-schema.graphql"),
157-
typegen: path.join(__dirname, "../../my-generated-types.d.ts"),
156+
schema: path.join(__dirname, '../../my-schema.graphql'),
157+
typegen: path.join(__dirname, '../../my-generated-types.d.ts'),
158158
},
159-
});
159+
})
160160
```
161161

162162
Read more about how the automatic [type generation](type-generation.md) works.

docs/components/schema/api/copy/library-authors.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,36 @@ If you are a library author building tools for GraphQL, it is recommended that y
1111
One example of this pattern would be for creating relay-style connections:
1212

1313
```ts
14-
export const UserConnectionTypes = connectionType("User");
14+
export const UserConnectionTypes = connectionType('User')
1515
```
1616

1717
Where `connectionType` is really just a wrapper creating two `objectTypes`:
1818

1919
```ts
20-
import { core, objectType } from "@nexus/schema";
20+
import { core, objectType } from '@nexus/schema'
2121

2222
export function connectionType(name: core.AllOutputTypes) {
2323
const Connection = objectType({
2424
name: `${name}Connection`,
2525
definition(t) {
26-
t.field("edges", { type: `${name}Edge` });
26+
t.field('edges', { type: `${name}Edge` })
2727
},
28-
});
28+
})
2929
const Edge = objectType({
3030
name: `${name}Edge`,
3131
definition(t) {
32-
t.id("cursor", (root) => `${name}:${root.id}`);
33-
t.field("node", { type: name });
32+
t.id('cursor', (root) => `${name}:${root.id}`)
33+
t.field('node', { type: name })
3434
},
35-
});
35+
})
3636
const PageInfo = objectType({
3737
name: `${name}PageInfo`,
3838
definition(t) {
39-
t.boolean("hasNextPage");
40-
t.boolean("hasPreviousPage");
39+
t.boolean('hasNextPage')
40+
t.boolean('hasPreviousPage')
4141
},
42-
});
43-
return { Connection, Edge, PageInfo };
42+
})
43+
return { Connection, Edge, PageInfo }
4444
}
4545
```
4646

0 commit comments

Comments
 (0)