Skip to content

Commit

Permalink
Pre-prettier tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Jun 2, 2020
1 parent af1af47 commit 08ce57c
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 29 deletions.
3 changes: 1 addition & 2 deletions spec/GraphQL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
GraphQL
-------
# **GraphQL**

*Current Working Draft*

Expand Down
14 changes: 9 additions & 5 deletions spec/Section 2 -- Language.md
Original file line number Diff line number Diff line change
Expand Up @@ -646,11 +646,11 @@ will be present and `friends` will not.
"profiles": [
{
"handle": "zuck",
"friends": { "count" : 1234 }
"friends": { "count": 1234 }
},
{
"handle": "cocacola",
"likers": { "count" : 90234512 }
"likers": { "count": 90234512 }
}
]
}
Expand Down Expand Up @@ -838,7 +838,7 @@ indentation and blank initial and trailing lines via {BlockStringValue()}.

For example, the following operation containing a block string:

```graphql example
```rawgraphql example
mutation {
sendEmail(message: """
Hello,
Expand Down Expand Up @@ -1199,13 +1199,17 @@ Directives may be provided in a specific syntactic order which may have semantic
These two type definitions may have different semantic meaning:

```graphql example
type Person @addExternalFields(source: "profiles") @excludeField(name: "photo") {
type Person
@addExternalFields(source: "profiles")
@excludeField(name: "photo") {
name: String
}
```

```graphql example
type Person @excludeField(name: "photo") @addExternalFields(source: "profiles") {
type Person
@excludeField(name: "photo")
@addExternalFields(source: "profiles") {
name: String
}
```
12 changes: 6 additions & 6 deletions spec/Section 3 -- Type System.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ self descriptive.

As an example, this simple GraphQL schema is well described:

```graphql example
```rawgraphql example
"""
A simple GraphQL schema which is well described.
"""
Expand Down Expand Up @@ -1071,7 +1071,7 @@ interface. Querying for `age` is only valid when the result of `entity` is a
... on Person {
age
}
},
}
phoneNumber
}
```
Expand All @@ -1083,7 +1083,7 @@ interface must define each field that is specified by the implemented interface.
For example, the interface Resource must define the field id to implement the
Node interface:

```graphql example
```rawgraphql example
interface Node {
id: ID!
}
Expand All @@ -1099,7 +1099,7 @@ that is being implemented) must also be defined on an implementing type or
interface. For example, `Image` cannot implement `Resource` without also
implementing `Node`:

```graphql example
```rawgraphql example
interface Node {
id: ID!
}
Expand Down Expand Up @@ -1297,7 +1297,7 @@ Instead, the query would be:
Union members may be defined with an optional leading `|` character to aid
formatting when representing a longer list of possible types:

```graphql example
```rawgraphql example
union SearchResult =
| Photo
| Person
Expand Down Expand Up @@ -1787,7 +1787,7 @@ fragment SomeFragment on SomeType {
Directive locations may be defined with an optional leading `|` character to aid
formatting when representing a longer list of possible locations:

```graphql example
```rawgraphql example
directive @example on
| FIELD
| FRAGMENT_SPREAD
Expand Down
2 changes: 1 addition & 1 deletion spec/Section 4 -- Introspection.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ would return
{
"name": "birthday",
"type": { "name": "Date" }
},
}
]
}
}
Expand Down
23 changes: 16 additions & 7 deletions spec/Section 5 -- Validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ type Query {
dog: Dog
}

enum DogCommand { SIT, DOWN, HEEL }
enum DogCommand {
SIT
DOWN
HEEL
}

type Dog implements Pet {
name: String!
Expand Down Expand Up @@ -69,7 +73,9 @@ type Human implements Sentient {
pets: [Pet!]
}

enum CatCommand { JUMP }
enum CatCommand {
JUMP
}

type Cat implements Pet {
name: String!
Expand Down Expand Up @@ -950,7 +956,7 @@ Defined fragments must be used within a document.

For example the following is an invalid document:

```graphql counter-example
```rawgraphql counter-example
fragment nameFragment on Dog { # unused
name
}
Expand Down Expand Up @@ -1270,7 +1276,7 @@ interface scope which it implements.
In the example below, the `...resourceFragment` fragments spreads is valid,
since `Resource` implements `Node`.

```graphql example
```rawgraphql example
interface Node {
id: ID!
}
Expand Down Expand Up @@ -1492,7 +1498,7 @@ For example, the following query will not pass validation because `@skip` has
been used twice for the same field:

```graphql counter-example
query ($foo: Boolean = true, $bar: Boolean = false) {
query($foo: Boolean = true, $bar: Boolean = false) {
field @skip(if: $foo) @skip(if: $bar)
}
```
Expand All @@ -1501,7 +1507,7 @@ However the following example is valid because `@skip` has been used only once
per location, despite being used twice in the query and on the same named field:

```graphql example
query ($foo: Boolean = true, $bar: Boolean = false) {
query($foo: Boolean = true, $bar: Boolean = false) {
field @skip(if: $foo) {
subfieldA
}
Expand Down Expand Up @@ -1577,7 +1583,10 @@ used as inputs.
For these examples, consider the following typesystem additions:

```graphql example
input ComplexInput { name: String, owner: String }
input ComplexInput {
name: String
owner: String
}

extend type Query {
findDog(complex: ComplexInput): Dog
Expand Down
16 changes: 8 additions & 8 deletions spec/Section 7 -- Response.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ The response might look like:
"errors": [
{
"message": "Name for character with ID 1002 could not be fetched.",
"locations": [ { "line": 6, "column": 7 } ],
"path": [ "hero", "heroFriends", 1, "name" ]
"locations": [{ "line": 6, "column": 7 }],
"path": ["hero", "heroFriends", 1, "name"]
}
],
"data": {
Expand Down Expand Up @@ -153,8 +153,8 @@ be the same:
"errors": [
{
"message": "Name for character with ID 1002 could not be fetched.",
"locations": [ { "line": 6, "column": 7 } ],
"path": [ "hero", "heroFriends", 1, "name" ]
"locations": [{ "line": 6, "column": 7 }],
"path": ["hero", "heroFriends", 1, "name"]
}
],
"data": {
Expand Down Expand Up @@ -186,8 +186,8 @@ there are no additional restrictions on its contents.
"errors": [
{
"message": "Name for character with ID 1002 could not be fetched.",
"locations": [ { "line": 6, "column": 7 } ],
"path": [ "hero", "heroFriends", 1, "name" ],
"locations": [{ "line": 6, "column": 7 }],
"path": ["hero", "heroFriends", 1, "name"],
"extensions": {
"code": "CAN_NOT_FETCH_BY_ID",
"timestamp": "Fri Feb 9 14:33:09 UTC 2018"
Expand All @@ -210,8 +210,8 @@ still discouraged.
"errors": [
{
"message": "Name for character with ID 1002 could not be fetched.",
"locations": [ { "line": 6, "column": 7 } ],
"path": [ "hero", "heroFriends", 1, "name" ],
"locations": [{ "line": 6, "column": 7 }],
"path": ["hero", "heroFriends", 1, "name"],
"code": "CAN_NOT_FETCH_BY_ID",
"timestamp": "Fri Feb 9 14:33:09 UTC 2018"
}
Expand Down

0 comments on commit 08ce57c

Please sign in to comment.