schema_kitchen_sink.graphql 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. schema {
  6. query: QueryType
  7. mutation: MutationType
  8. }
  9. """
  10. This is a description
  11. of the `Foo` type.
  12. """
  13. type Foo implements Bar {
  14. one: Type
  15. two(argument: InputType!): Type
  16. three(argument: InputType, other: String): Int
  17. four(argument: String = "string"): String
  18. five(argument: [String] = ["string", "string"]): String
  19. six(argument: InputType = {key: "value"}): Type
  20. seven(argument: Int = null): Type
  21. }
  22. type AnnotatedObject @onObject(arg: "value") {
  23. annotatedField(arg: Type = "default" @onArg): Type @onField
  24. }
  25. type UndefinedType
  26. extend type Foo {
  27. seven(argument: [String]): Type
  28. }
  29. extend type Foo @onType
  30. """
  31. This is a description
  32. """
  33. interface Bar {
  34. one: Type
  35. four(argument: String = "string"): String
  36. }
  37. interface AnnotatedInterface @onInterface {
  38. annotatedField(arg: Type @onArg): Type @onField
  39. }
  40. interface UndefinedInterface
  41. extend interface Bar {
  42. two(argument: InputType!): Type
  43. }
  44. extend interface Bar @onInterface
  45. union Feed = Story | Article | Advert
  46. union AnnotatedUnion @onUnion = A | B
  47. union AnnotatedUnionTwo @onUnion = | A | B
  48. union UndefinedUnion
  49. extend union Feed = Photo | Video
  50. extend union Feed @onUnion
  51. scalar CustomScalar
  52. scalar AnnotatedScalar @onScalar
  53. extend scalar CustomScalar @onScalar
  54. enum Site {
  55. DESKTOP
  56. MOBILE
  57. }
  58. enum AnnotatedEnum @onEnum {
  59. ANNOTATED_VALUE @onEnumValue
  60. OTHER_VALUE
  61. }
  62. enum UndefinedEnum
  63. extend enum Site {
  64. VR
  65. }
  66. extend enum Site @onEnum
  67. input InputType {
  68. key: String!
  69. answer: Int = 42
  70. }
  71. input AnnotatedInput @onInputObject {
  72. annotatedField: Type @onField
  73. }
  74. input UndefinedInput
  75. extend input InputType {
  76. other: Float = 1.23e4
  77. }
  78. extend input InputType @onInputObject
  79. directive @skip(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
  80. directive @include(if: Boolean!)
  81. on FIELD
  82. | FRAGMENT_SPREAD
  83. | INLINE_FRAGMENT
  84. directive @include2(if: Boolean!) on
  85. | FIELD
  86. | FRAGMENT_SPREAD
  87. | INLINE_FRAGMENT