| 1 |
# Copyright (c) 2015-present, Facebook, Inc. |
| 2 |
# |
| 3 |
# This source code is licensed under the MIT license found in the |
| 4 |
# LICENSE file in the root directory of this source tree. |
| 5 |
|
| 6 |
schema { |
| 7 |
query: QueryType |
| 8 |
mutation: MutationType |
| 9 |
} |
| 10 |
|
| 11 |
""" |
| 12 |
This is a description |
| 13 |
of the `Foo` type. |
| 14 |
""" |
| 15 |
type Foo implements Bar & Baz { |
| 16 |
"Description of the `one` field." |
| 17 |
one: Type |
| 18 |
""" |
| 19 |
This is a description of the `two` field. |
| 20 |
""" |
| 21 |
two( |
| 22 |
""" |
| 23 |
This is a description of the `argument` argument. |
| 24 |
""" |
| 25 |
argument: InputType! |
| 26 |
): Type |
| 27 |
"""This is a description of the `three` field.""" |
| 28 |
three(argument: InputType, other: String): Int |
| 29 |
four(argument: String = "string"): String |
| 30 |
five(argument: [String] = ["string", "string"]): String |
| 31 |
six(argument: InputType = {key: "value"}): Type |
| 32 |
seven(argument: Int = null): Type |
| 33 |
} |
| 34 |
|
| 35 |
type AnnotatedObject @onObject(arg: "value") { |
| 36 |
annotatedField(arg: Type = "default" @onArgumentDefinition): Type @onField |
| 37 |
} |
| 38 |
|
| 39 |
type UndefinedType |
| 40 |
|
| 41 |
extend type Foo { |
| 42 |
seven(argument: [String]): Type |
| 43 |
} |
| 44 |
|
| 45 |
extend type Foo @onType |
| 46 |
|
| 47 |
interface Bar { |
| 48 |
one: Type |
| 49 |
four(argument: String = "string"): String |
| 50 |
} |
| 51 |
|
| 52 |
interface AnnotatedInterface @onInterface { |
| 53 |
annotatedField(arg: Type @onArgumentDefinition): Type @onField |
| 54 |
} |
| 55 |
|
| 56 |
interface UndefinedInterface |
| 57 |
|
| 58 |
extend interface Bar { |
| 59 |
two(argument: InputType!): Type |
| 60 |
} |
| 61 |
|
| 62 |
extend interface Bar @onInterface |
| 63 |
|
| 64 |
union Feed = |
| 65 |
| Story |
| 66 |
| Article |
| 67 |
| Advert |
| 68 |
|
| 69 |
union AnnotatedUnion @onUnion = A | B |
| 70 |
|
| 71 |
union AnnotatedUnionTwo @onUnion = | A | B |
| 72 |
|
| 73 |
union UndefinedUnion |
| 74 |
|
| 75 |
extend union Feed = Photo | Video |
| 76 |
|
| 77 |
extend union Feed @onUnion |
| 78 |
|
| 79 |
scalar CustomScalar |
| 80 |
|
| 81 |
scalar AnnotatedScalar @onScalar |
| 82 |
|
| 83 |
extend scalar CustomScalar @onScalar |
| 84 |
|
| 85 |
enum Site { |
| 86 |
""" |
| 87 |
This is a description of the `DESKTOP` value |
| 88 |
""" |
| 89 |
DESKTOP |
| 90 |
|
| 91 |
"""This is a description of the `MOBILE` value""" |
| 92 |
MOBILE |
| 93 |
|
| 94 |
"This is a description of the `WEB` value" |
| 95 |
WEB |
| 96 |
} |
| 97 |
|
| 98 |
enum AnnotatedEnum @onEnum { |
| 99 |
ANNOTATED_VALUE @onEnumValue |
| 100 |
OTHER_VALUE |
| 101 |
} |
| 102 |
|
| 103 |
enum UndefinedEnum |
| 104 |
|
| 105 |
extend enum Site { |
| 106 |
VR |
| 107 |
} |
| 108 |
|
| 109 |
extend enum Site @onEnum |
| 110 |
|
| 111 |
input InputType { |
| 112 |
key: String! |
| 113 |
answer: Int = 42 |
| 114 |
} |
| 115 |
|
| 116 |
input AnnotatedInput @onInputObject { |
| 117 |
annotatedField: Type @onInputFieldDefinition |
| 118 |
} |
| 119 |
|
| 120 |
input UndefinedInput |
| 121 |
|
| 122 |
extend input InputType { |
| 123 |
other: Float = 1.23e4 @onInputFieldDefinition |
| 124 |
} |
| 125 |
|
| 126 |
extend input InputType @onInputObject |
| 127 |
|
| 128 |
""" |
| 129 |
This is a description of the `@skip` directive |
| 130 |
""" |
| 131 |
directive @skip( |
| 132 |
if: Boolean! @onArgumentDefinition |
| 133 |
) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT |
| 134 |
|
| 135 |
directive @include(if: Boolean!) |
| 136 |
on FIELD |
| 137 |
| FRAGMENT_SPREAD |
| 138 |
| INLINE_FRAGMENT |
| 139 |
|
| 140 |
directive @include2(if: Boolean!) on |
| 141 |
| FIELD |
| 142 |
| FRAGMENT_SPREAD |
| 143 |
| INLINE_FRAGMENT |
| 144 |
|
| 145 |
extend schema @onSchema |
| 146 |
|
| 147 |
extend schema @onSchema { |
| 148 |
subscription: SubscriptionType |
| 149 |
} |