Skip to content

Commit 42818fb

Browse files
committed
Update sample GraphQL files
These are borrowed from the graphql-js project.
1 parent 1292e4e commit 42818fb

File tree

3 files changed

+46
-22
lines changed

3 files changed

+46
-22
lines changed

samples/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 GraphQL Contributors
3+
Copyright (c) GraphQL Contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

samples/kitchen-sink.graphql

+35-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
11
query queryName($foo: ComplexType, $site: Site = MOBILE) @onQuery {
22
whoever123is: node(id: [123, 456]) {
3-
id ,
3+
id
44
... on User @onInlineFragment {
55
field2 {
6-
id ,
7-
alias: field1(first:10, after:$foo,) @include(if: $foo) {
8-
id,
6+
id
7+
alias: field1(first: 10, after: $foo) @include(if: $foo) {
8+
id
99
...frag @onFragmentSpread
1010
}
1111
}
12+
13+
field3!
14+
field4?
15+
requiredField5: field5!
16+
requiredSelectionSet(first: 10)! @directive {
17+
field
18+
}
19+
20+
unsetListItemsRequiredList: listField[]!
21+
requiredListItemsUnsetList: listField[!]
22+
requiredListItemsRequiredList: listField[!]!
23+
unsetListItemsOptionalList: listField[]?
24+
optionalListItemsUnsetList: listField[?]
25+
optionalListItemsOptionalList: listField[?]?
26+
multidimensionalList: listField[[[!]!]!]!
1227
}
1328
... @skip(unless: $foo) {
1429
id
@@ -28,8 +43,9 @@ mutation likeStory @onMutation {
2843
}
2944

3045
subscription StoryLikeSubscription(
31-
$input: StoryLikeSubscribeInput
32-
) @onSubscription {
46+
$input: StoryLikeSubscribeInput @onVariableDefinition
47+
)
48+
@onSubscription {
3349
storyLikeSubscribe(input: $input) {
3450
story {
3551
likers {
@@ -43,16 +59,23 @@ subscription StoryLikeSubscription(
4359
}
4460

4561
fragment frag on Friend @onFragmentDefinition {
46-
foo(size: $size, bar: $b, obj: {key: "value", block: """
47-
62+
foo(
63+
size: $size
64+
bar: $b
65+
obj: {
66+
key: "value"
67+
block: """
4868
block string uses \"""
49-
50-
"""})
69+
"""
70+
}
71+
)
5172
}
5273
5374
{
54-
unnamed(truthy: true, falsy: false, nullish: null),
75+
unnamed(truthy: true, falsy: false, nullish: null)
5576
query
5677
}
5778
58-
query { __typename }
79+
query {
80+
__typename
81+
}

samples/schema-kitchen-sink.graphql

+10-9
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ schema {
55

66
"""
77
This is a description
8-
of the `Foo` type.
8+
of the \`Foo\` type.
99
"""
1010
type Foo implements Bar & Baz & Two {
11-
"Description of the `one` field."
11+
"Description of the \`one\` field."
1212
one: Type
1313
"""
14-
This is a description of the `two` field.
14+
This is a description of the \`two\` field.
1515
"""
1616
two(
1717
"""
18-
This is a description of the `argument` argument.
18+
This is a description of the \`argument\` argument.
1919
"""
2020
argument: InputType!
2121
): Type
22-
"""This is a description of the `three` field."""
22+
"""This is a description of the \`three\` field."""
2323
three(argument: InputType, other: String): Int
2424
four(argument: String = "string"): String
2525
five(argument: [String] = ["string", "string"]): String
@@ -85,14 +85,14 @@ extend scalar CustomScalar @onScalar
8585

8686
enum Site {
8787
"""
88-
This is a description of the `DESKTOP` value
88+
This is a description of the \`DESKTOP\` value
8989
"""
9090
DESKTOP
9191

92-
"""This is a description of the `MOBILE` value"""
92+
"""This is a description of the \`MOBILE\` value"""
9393
MOBILE
9494

95-
"This is a description of the `WEB` value"
95+
"This is a description of the \`WEB\` value"
9696
WEB
9797
}
9898

@@ -127,9 +127,10 @@ extend input InputType {
127127
extend input InputType @onInputObject
128128

129129
"""
130-
This is a description of the `@skip` directive
130+
This is a description of the \`@skip\` directive
131131
"""
132132
directive @skip(
133+
"""This is a description of the \`if\` argument"""
133134
if: Boolean! @onArgumentDefinition
134135
) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
135136

0 commit comments

Comments
 (0)