Skip to content

Commit

Permalink
Add spellcheck to test suite (#858)
Browse files Browse the repository at this point in the history
* Add spellcheck to test suite

* Add README
  • Loading branch information
leebyron authored Apr 23, 2021
1 parent 086bb1f commit 5b7b9f6
Show file tree
Hide file tree
Showing 8 changed files with 1,727 additions and 118 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ or are actively interested in, building their own GraphQL implementations and
tools.

In order to be broadly adopted, GraphQL will have to target a wide
variety of backends, frameworks, and languages, which will necessitate a
variety of backend environments, frameworks, and languages, which will necessitate a
collaborative effort across projects and organizations. This specification serves as a point of coordination for this effort.

Looking for help? Find resources [from the community](https://graphql.org/community/).
Expand Down Expand Up @@ -271,7 +271,6 @@ case, `Query`. As defined above, `Query` has a `hero` field that returns a
returns a `String`, so we query for that, completing our query. The result of
this query would then be:


```json
{
"hero": {
Expand Down Expand Up @@ -397,7 +396,7 @@ which will give us the nested response
```

The `Query` type above defined a way to fetch a human given their
ID. We can use it by hardcoding the ID in the query:
ID. We can use it by hard-coding the ID in the query:

```graphql
query FetchLukeQuery {
Expand Down Expand Up @@ -608,7 +607,7 @@ on runtime checks.

For our Star Wars example, the file
[starWarsValidationTests.js](https://github.com/graphql/graphql-js/blob/main/src/__tests__/starWarsValidation-test.js)
contains a number of queries demonstrating various invalidities, and is a test
contains a number of demonstrations of invalid operations, and is a test
file that can be run to exercise the reference implementation's validator.

To start, let's take a complex valid query. This is the `NestedQuery` example
Expand Down
23 changes: 23 additions & 0 deletions cspell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
language: en-US
ignoreRegExpList:
# Posessives
- /[a-z]{2,}'s/
words:
# Terms of art
- endianness
- interoperation
- monospace
- openwebfoundation
- parallelization
- structs
- subselection
# Fictional characters / examples
- alderaan
- hagrid
- leia
- newhope
- othername
- skywalker
- tatooine
- zuck
- zuckerberg
1,693 changes: 1,639 additions & 54 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@
"url": "http://github.com/graphql/graphql-spec.git"
},
"scripts": {
"test": "spec-md spec/GraphQL.md > /dev/null",
"test": "npm run test:build && npm run test:spellcheck",
"test:build": "spec-md spec/GraphQL.md > /dev/null",
"test:spellcheck": "cspell 'spec/**/*.md' README.md",
"build": "mkdir -p out; spec-md --githubSource 'https://github.com/graphql/graphql-spec/blame/main/' spec/GraphQL.md > out/index.html",
"watch": "nodemon -e json,md --exec 'npm run build'"
},
"devDependencies": {
"cspell": "5.3.12",
"nodemon": "2.0.7",
"spec-md": "3.0.2"
}
Expand Down
2 changes: 1 addition & 1 deletion spec/Appendix A -- Notation Conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ and their expanded definitions in the context-free grammar.
A grammar production may specify that certain expansions are not permitted by
using the phrase "but not" and then indicating the expansions to be excluded.

For example, the following production means that the nonterminal {SafeWord} may
For example, the following production means that the non-terminal {SafeWord} may
be replaced by any sequence of characters that could replace {Word} provided
that the same sequence of characters could not replace {SevenCarlinWords}.

Expand Down
6 changes: 3 additions & 3 deletions spec/Section 2 -- Language.md
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ For example in this operation using the Facebook data model:

```graphql example
query FragmentTyping {
profiles(handles: ["zuck", "cocacola"]) {
profiles(handles: ["zuck", "coca-cola"]) {
handle
...userFragment
...pageFragment
Expand Down Expand Up @@ -654,7 +654,7 @@ will be present and `friends` will not.
"friends": { "count": 1234 }
},
{
"handle": "cocacola",
"handle": "coca-cola",
"likers": { "count": 90234512 }
}
]
Expand All @@ -673,7 +673,7 @@ example. We could accomplish the same thing using inline fragments.

```graphql example
query inlineFragmentTyping {
profiles(handles: ["zuck", "cocacola"]) {
profiles(handles: ["zuck", "coca-cola"]) {
handle
... on User {
friends {
Expand Down
Loading

0 comments on commit 5b7b9f6

Please sign in to comment.