|
| 1 | +var t = { |
| 2 | + kind: 'Document', |
| 3 | + definitions: [ |
| 4 | + { |
| 5 | + kind: 'OperationDefinition', |
| 6 | + operation: 'query', |
| 7 | + variableDefinitions: [], |
| 8 | + directives: [], |
| 9 | + selectionSet: { |
| 10 | + kind: 'SelectionSet', |
| 11 | + selections: [ |
| 12 | + { |
| 13 | + kind: 'Field', |
| 14 | + name: { kind: 'Name', value: 'products' }, |
| 15 | + arguments: [ |
| 16 | + { |
| 17 | + kind: 'Argument', |
| 18 | + name: { kind: 'Name', value: 'first' }, |
| 19 | + value: { kind: 'IntValue', value: '24' }, |
| 20 | + }, |
| 21 | + ], |
| 22 | + directives: [], |
| 23 | + selectionSet: { |
| 24 | + kind: 'SelectionSet', |
| 25 | + selections: [ |
| 26 | + { |
| 27 | + kind: 'Field', |
| 28 | + name: { kind: 'Name', value: 'nodes' }, |
| 29 | + arguments: [], |
| 30 | + directives: [], |
| 31 | + selectionSet: { |
| 32 | + kind: 'SelectionSet', |
| 33 | + selections: [ |
| 34 | + { |
| 35 | + kind: 'Field', |
| 36 | + name: { kind: 'Name', value: 'databaseId' }, |
| 37 | + arguments: [], |
| 38 | + directives: [], |
| 39 | + }, |
| 40 | + { |
| 41 | + kind: 'Field', |
| 42 | + name: { kind: 'Name', value: 'name' }, |
| 43 | + arguments: [], |
| 44 | + directives: [], |
| 45 | + }, |
| 46 | + { |
| 47 | + kind: 'Field', |
| 48 | + name: { kind: 'Name', value: 'onSale' }, |
| 49 | + arguments: [], |
| 50 | + directives: [], |
| 51 | + }, |
| 52 | + { |
| 53 | + kind: 'Field', |
| 54 | + name: { kind: 'Name', value: 'slug' }, |
| 55 | + arguments: [], |
| 56 | + directives: [], |
| 57 | + }, |
| 58 | + { |
| 59 | + kind: 'Field', |
| 60 | + name: { kind: 'Name', value: 'image' }, |
| 61 | + arguments: [], |
| 62 | + directives: [], |
| 63 | + selectionSet: { |
| 64 | + kind: 'SelectionSet', |
| 65 | + selections: [ |
| 66 | + { |
| 67 | + kind: 'Field', |
| 68 | + name: { kind: 'Name', value: 'sourceUrl' }, |
| 69 | + arguments: [], |
| 70 | + directives: [], |
| 71 | + }, |
| 72 | + ], |
| 73 | + }, |
| 74 | + }, |
| 75 | + { |
| 76 | + kind: 'InlineFragment', |
| 77 | + typeCondition: { |
| 78 | + kind: 'NamedType', |
| 79 | + name: { kind: 'Name', value: 'SimpleProduct' }, |
| 80 | + }, |
| 81 | + directives: [], |
| 82 | + selectionSet: { |
| 83 | + kind: 'SelectionSet', |
| 84 | + selections: [ |
| 85 | + { |
| 86 | + kind: 'Field', |
| 87 | + name: { kind: 'Name', value: 'databaseId' }, |
| 88 | + arguments: [], |
| 89 | + directives: [], |
| 90 | + }, |
| 91 | + { |
| 92 | + kind: 'Field', |
| 93 | + name: { kind: 'Name', value: 'price' }, |
| 94 | + arguments: [], |
| 95 | + directives: [], |
| 96 | + }, |
| 97 | + { |
| 98 | + kind: 'Field', |
| 99 | + name: { kind: 'Name', value: 'regularPrice' }, |
| 100 | + arguments: [], |
| 101 | + directives: [], |
| 102 | + }, |
| 103 | + { |
| 104 | + kind: 'Field', |
| 105 | + name: { kind: 'Name', value: 'salePrice' }, |
| 106 | + arguments: [], |
| 107 | + directives: [], |
| 108 | + }, |
| 109 | + ], |
| 110 | + }, |
| 111 | + }, |
| 112 | + { |
| 113 | + kind: 'InlineFragment', |
| 114 | + typeCondition: { |
| 115 | + kind: 'NamedType', |
| 116 | + name: { kind: 'Name', value: 'VariableProduct' }, |
| 117 | + }, |
| 118 | + directives: [], |
| 119 | + selectionSet: { |
| 120 | + kind: 'SelectionSet', |
| 121 | + selections: [ |
| 122 | + { |
| 123 | + kind: 'Field', |
| 124 | + name: { kind: 'Name', value: 'databaseId' }, |
| 125 | + arguments: [], |
| 126 | + directives: [], |
| 127 | + }, |
| 128 | + { |
| 129 | + kind: 'Field', |
| 130 | + name: { kind: 'Name', value: 'price' }, |
| 131 | + arguments: [], |
| 132 | + directives: [], |
| 133 | + }, |
| 134 | + { |
| 135 | + kind: 'Field', |
| 136 | + name: { kind: 'Name', value: 'regularPrice' }, |
| 137 | + arguments: [], |
| 138 | + directives: [], |
| 139 | + }, |
| 140 | + { |
| 141 | + kind: 'Field', |
| 142 | + name: { kind: 'Name', value: 'salePrice' }, |
| 143 | + arguments: [], |
| 144 | + directives: [], |
| 145 | + }, |
| 146 | + { |
| 147 | + kind: 'Field', |
| 148 | + name: { kind: 'Name', value: 'variations' }, |
| 149 | + arguments: [], |
| 150 | + directives: [], |
| 151 | + selectionSet: { |
| 152 | + kind: 'SelectionSet', |
| 153 | + selections: [ |
| 154 | + { |
| 155 | + kind: 'Field', |
| 156 | + name: { kind: 'Name', value: 'nodes' }, |
| 157 | + arguments: [], |
| 158 | + directives: [], |
| 159 | + selectionSet: { |
| 160 | + kind: 'SelectionSet', |
| 161 | + selections: [ |
| 162 | + { |
| 163 | + kind: 'Field', |
| 164 | + name: { |
| 165 | + kind: 'Name', |
| 166 | + value: 'price', |
| 167 | + }, |
| 168 | + arguments: [], |
| 169 | + directives: [], |
| 170 | + }, |
| 171 | + { |
| 172 | + kind: 'Field', |
| 173 | + name: { |
| 174 | + kind: 'Name', |
| 175 | + value: 'regularPrice', |
| 176 | + }, |
| 177 | + arguments: [], |
| 178 | + directives: [], |
| 179 | + }, |
| 180 | + { |
| 181 | + kind: 'Field', |
| 182 | + name: { |
| 183 | + kind: 'Name', |
| 184 | + value: 'salePrice', |
| 185 | + }, |
| 186 | + arguments: [], |
| 187 | + directives: [], |
| 188 | + }, |
| 189 | + ], |
| 190 | + }, |
| 191 | + }, |
| 192 | + ], |
| 193 | + }, |
| 194 | + }, |
| 195 | + ], |
| 196 | + }, |
| 197 | + }, |
| 198 | + ], |
| 199 | + }, |
| 200 | + }, |
| 201 | + ], |
| 202 | + }, |
| 203 | + }, |
| 204 | + ], |
| 205 | + }, |
| 206 | + }, |
| 207 | + ], |
| 208 | + loc: { start: 0, end: 520 }, |
| 209 | +} |
| 210 | +t.loc.source = { |
| 211 | + body: `{\r |
| 212 | + products(first: 24) {\r |
| 213 | + nodes {\r |
| 214 | + databaseId\r |
| 215 | + name\r |
| 216 | + onSale\r |
| 217 | + slug\r |
| 218 | + image {\r |
| 219 | + sourceUrl\r |
| 220 | + }\r |
| 221 | + ... on SimpleProduct {\r |
| 222 | + databaseId\r |
| 223 | + price\r |
| 224 | + regularPrice\r |
| 225 | + salePrice\r |
| 226 | + }\r |
| 227 | + ... on VariableProduct {\r |
| 228 | + databaseId\r |
| 229 | + price\r |
| 230 | + regularPrice\r |
| 231 | + salePrice\r |
| 232 | + variations {\r |
| 233 | + nodes {\r |
| 234 | + price\r |
| 235 | + regularPrice\r |
| 236 | + salePrice\r |
| 237 | + }\r |
| 238 | + }\r |
| 239 | + }\r |
| 240 | + }\r |
| 241 | + }\r |
| 242 | +}\r |
| 243 | +`, |
| 244 | + name: 'GraphQL request', |
| 245 | + locationOffset: { line: 1, column: 1 }, |
| 246 | +} |
| 247 | +function r(e, i) { |
| 248 | + if (e.kind === 'FragmentSpread') i.add(e.name.value) |
| 249 | + else if (e.kind === 'VariableDefinition') { |
| 250 | + var n = e.type |
| 251 | + n.kind === 'NamedType' && i.add(n.name.value) |
| 252 | + } |
| 253 | + e.selectionSet && |
| 254 | + e.selectionSet.selections.forEach(function (a) { |
| 255 | + r(a, i) |
| 256 | + }), |
| 257 | + e.variableDefinitions && |
| 258 | + e.variableDefinitions.forEach(function (a) { |
| 259 | + r(a, i) |
| 260 | + }), |
| 261 | + e.definitions && |
| 262 | + e.definitions.forEach(function (a) { |
| 263 | + r(a, i) |
| 264 | + }) |
| 265 | +} |
| 266 | +var d = {} |
| 267 | +;(function () { |
| 268 | + t.definitions.forEach(function (i) { |
| 269 | + if (i.name) { |
| 270 | + var n = new Set() |
| 271 | + r(i, n), (d[i.name.value] = n) |
| 272 | + } |
| 273 | + }) |
| 274 | +})() |
| 275 | +export { t as d } |
0 commit comments