File: graphql

package info (click to toggle)
ruby-rouge 4.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,836 kB
  • sloc: ruby: 38,168; sed: 2,071; perl: 152; makefile: 8
file content (136 lines) | stat: -rw-r--r-- 2,461 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
"""
---
frontmatter: Hello
things:
  - beer
  - sugar
---

Markdown: Syntax
================

Decimal number serialized as string.

Should match regexp: `/^[+-]?[0-9]+(\.[0-9]+)$/`

Format:
  `<sign>`? `<digit>`+ ( `.` `<digit>`+ )?

Example:
 - `"1000"`
 - `"0.00000001"`
 - `"-10"`
 - `"+1"`

This is invalid:
 - `".01"` *missing preceding zero*
 - `"1,000.00"` *invalid character*
 - `"1e-10"` *exponential form is not allowed*
"""

# Most code copied from https://github.com/rmosolgo/language-graphql/blob/master/spec/fixtures/example.graphql
fragment on AnalysisImage @relay(plural: true) {
  extension
  href
}

scalar Help

interface Character {
  id: ID!
  name: String!
  friends: [Character]
  appearsIn: [Episode]!
}

extend interface Character {
  email: ID!
}

schema {
   widget: Widget
}

type Starship  implements Character {
  id: ID!
  name: String!
  length(unit: LengthUnit = METER): Float
}

extend type User {
  name: ID!
}

input Starship {
  id: ID!
  name: String!
  length(unit: LengthUnit = METER): Float
}

extend input Starship {
  rockerlauncher: Bool!
}

enum Episode {
  NEWHOPE
  EMPIRE
  JEDI
}

extend enum Episode {
  LOLCATS
}

union SearchResult = Human # maybe spans
    | Droid # more
    | Starship #than one line

mutation {}

fragment FragmentName on Type @directives() {
}

query
    queryName(
      $float: f = 123.011e-1, $float:  f = 123.00, $float: f = 123e+20
      $boolean: b ! = true, $boolean: b = false
      $String: s = """Multiline
                   string
                   here
                   """
      $enum: e = aaaa, $enum: e = AAAA_AA
      $list :  [ String!, Boolean!, ID, Int, Float ] ! = ["aaa", 1 , aFlag]
      $object: o = {
        lon: 12.43, lat: -53.211
      }
    )
    @directives (
      number: 1
      float: 123.011e-1, float:123.00, float: 123e+20
      boolean: true, boolean: false
      String: "Some string \" \\ \/ \b \f \r \r and the rest",
      enum: aaaa, enum: AAAA_AA,
      list : ["aaa", 1 , aFlag],
      object: {
        lon: 12.43, lat: -53.211
      }
    )
  {
    me {
      idAlias: id(id: 1) @directive() # fields
      name,
      small: profilePic( size: $devicePicSize ) # field alias
      ...Ignored
      ...A @directives(if: true), # fragment spread
      ... on Type  @directives() { # inline fragment
        ...{ # inline fragment
        }
      }
    }
  }

{
  true: null(flag: false)
  type: interface { }
  query: String(Int: 1) { }
}