Skip to content

Commit e78d2b5

Browse files
committed
Merge branch 'main' into oneof-v2
2 parents 5a966f2 + 56d6107 commit e78d2b5

16 files changed

+906
-1854
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,45 @@
11
name: CI
2+
23
on:
34
push:
45
branches:
56
- main
67
pull_request:
7-
branches:
8-
- main
8+
99
jobs:
10-
test:
10+
test-spelling:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
14-
- uses: actions/setup-node@v1
15-
with:
16-
node-version: "16.x"
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-node@v3
15+
- run: npm ci
16+
- run: npm run test:spelling
17+
test-format:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
- uses: actions/setup-node@v3
1722
- run: npm ci
18-
- run: npm test
23+
- run: npm run test:format
24+
test-build:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v3
28+
- uses: actions/setup-node@v3
29+
- run: npm ci
30+
- run: npm run test:build
1931
publish:
2032
if: github.ref == 'refs/heads/main'
21-
needs: test
33+
needs:
34+
- test-spelling
35+
- test-format
36+
- test-build
2237
runs-on: ubuntu-latest
2338
steps:
24-
- uses: actions/checkout@v2
39+
- uses: actions/checkout@v3
2540
with:
2641
fetch-depth: 0
27-
- uses: actions/setup-node@v1
28-
with:
29-
node-version: "16.x"
42+
- uses: actions/setup-node@v3
3043
- run: npm ci
3144
- run: npm run build
3245
- uses: peaceiris/actions-gh-pages@v3

.github/workflows/prettier.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

STYLE_GUIDE.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
**This document is a work in progress.**
2+
3+
# GraphQL Specification Style Guide
4+
5+
This document outlines the styles used in the GraphQL spec to aid editorial and
6+
consistency. The writing style portions are inspired by the AP style guide. When
7+
making changes to the GraphQL specification, please aim to be consistent with
8+
this style guide.
9+
10+
## Auto-Formatting
11+
12+
The GraphQL specification is formatted using the `prettier` tool, so you should
13+
not need to think about gaps between paragraphs and titles, nor about word
14+
wrapping - this is handled for you.
15+
16+
## Headings
17+
18+
The GraphQL specification uses two types of headings: numbered headings and
19+
unnumbered headings. All headings should be written in Title Case (see below).
20+
21+
### Numbered Headings
22+
23+
Lines beginning with a `#` will become numbered headings in the spec-md output.
24+
25+
```
26+
# H1
27+
## H2
28+
### H3
29+
#### H4
30+
##### H5
31+
```
32+
33+
### Unnumbered Headings
34+
35+
Unnumbered headings are added to split large blocks of text up without impacting
36+
the spec numbering system. In the output are styled similarly to an H4. An
37+
unnumbered heading is a line on its own that is bolded:
38+
39+
```md
40+
\*\*This Is an Example of an Unnumbered Heading\*\*
41+
```
42+
43+
### Title Case
44+
45+
Title case is used for headings. Every word in a heading (including words after
46+
hyphens) should be capitalized, with the following exceptions:
47+
48+
- articles: a, an, the
49+
- conjunctions under 4 letters in length: for, and, nor, but, or, yet, so, as,
50+
if
51+
- prepositions under 4 letters in length: in, at, to, on, off, of, for, vs., per
52+
- directive names and type names are unchanged: @include, @specifiedBy,
53+
\_\_EnumValue, \_\_Schema
54+
55+
All elements in hyphenated words follow the same rules, e.g. headings may
56+
contain `Non-Null`, `Context-Free`, `Built-in` (`in` is a preposition, so is not
57+
capitalized).

build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ GITTAG=$(git tag --points-at HEAD)
77
# Build the specification draft document
88
echo "Building spec draft"
99
mkdir -p public/draft
10-
spec-md --githubSource "https://github.com/graphql/graphql-spec/blame/main/" spec/GraphQL.md > public/draft/index.html
10+
spec-md --metadata spec/metadata.json --githubSource "https://github.com/graphql/graphql-spec/blame/main/" spec/GraphQL.md > public/draft/index.html
1111

1212
# If this is a tagged commit, also build the release document
1313
if [ -n "$GITTAG" ]; then
1414
echo "Building spec release $GITTAG"
1515
mkdir -p "public/$GITTAG"
16-
spec-md --githubSource "https://github.com/graphql/graphql-spec/blame/$GITTAG/" spec/GraphQL.md > "public/$GITTAG/index.html"
16+
spec-md --metadata spec/metadata.json --githubSource "https://github.com/graphql/graphql-spec/blame/$GITTAG/" spec/GraphQL.md > "public/$GITTAG/index.html"
1717
fi
1818

1919
# Create the index file

0 commit comments

Comments
 (0)