UNPKG

3.89 kBJavaScriptView Raw
1"use strict";
2var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4 return cooked;
5};
6Object.defineProperty(exports, "__esModule", { value: true });
7var graphql_tag_1 = require("graphql-tag");
8var util_1 = require("util");
9var reshape_1 = require("./reshape");
10var getData = graphql_tag_1.default(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n {\n peoples: people @_(get: \"edges\") {\n edges @_(each: { assign: \"node\" }) {\n cursor\n node @_(assign: [\"homeworld\", \"species\"]) {\n id\n name @_(trim: none)\n isLuke: name @_(isMatch: { match: \"Luke\", flags: \"ig\" })\n Name: name @_(match: { match: \"Luke\", flags: \"ig\" }, take: 0)\n species {\n sp_id: id\n spName: name\n classification\n }\n some @_(get: \"notItHasHaving.atAll\") {\n notItHasHaving {\n atAll\n }\n }\n homeworld {\n hw_id: id\n hwName: name\n }\n }\n }\n }\n }\n"], ["\n {\n peoples: people @_(get: \"edges\") {\n edges @_(each: { assign: \"node\" }) {\n cursor\n node @_(assign: [\"homeworld\", \"species\"]) {\n id\n name @_(trim: none)\n isLuke: name @_(isMatch: { match: \"Luke\", flags: \"ig\" })\n Name: name @_(match: { match: \"Luke\", flags: \"ig\" }, take: 0)\n species {\n sp_id: id\n spName: name\n classification\n }\n some @_(get: \"notItHasHaving.atAll\") {\n notItHasHaving {\n atAll\n }\n }\n homeworld {\n hw_id: id\n hwName: name\n }\n }\n }\n }\n }\n"])));
11var data = {
12 people: {
13 edges: [
14 {
15 cursor: 'Y29ubmVjdGlvbi41OTllOTBhY2I0NjljNzNhOGU0MWRkMzQ=',
16 node: {
17 id: 'UGVyc29uOjU5OWU5MGFjYjQ2OWM3M2E4ZTQxZGQzNA==',
18 name: ' Luke Skywalker ',
19 species: {
20 spName: 'Just a Human being',
21 classification: null,
22 },
23 homeworld: {
24 hwName: 'Coruscant',
25 },
26 },
27 },
28 ],
29 },
30};
31var reverseData = graphql_tag_1.default(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n {\n people @_(dive: \"people.edges\") {\n cursor\n id @_(dive: \"node.id\")\n name @_(trim: none, dive: \"node.name\")\n hwName @_(dive: \"node.homeworld.name\")\n spName @_(dive: \"node.species.name\")\n classification @_(dive: \"node.species.classification\")\n }\n }\n"], ["\n {\n people @_(dive: \"people.edges\") {\n cursor\n id @_(dive: \"node.id\")\n name @_(trim: none, dive: \"node.name\")\n hwName @_(dive: \"node.homeworld.name\")\n spName @_(dive: \"node.species.name\")\n classification @_(dive: \"node.species.classification\")\n }\n }\n"])));
32var reverse = {
33 people: [
34 {
35 cursor: 'Y29ubmVjdGlvbi41OTllOTBhY2I0NjljNzNhOGU0MWRkMzQ=',
36 id: 'UGVyc29uOjU5OWU5MGFjYjQ2OWM3M2E4ZTQxZGQzNA==',
37 name: ' Luke Skywalker ',
38 hwName: 'Coruscant',
39 spName: 'Just a Human being',
40 classification: null,
41 },
42 ],
43};
44var log = function (doc, data) {
45 console.log(util_1.inspect(reshape_1.default(doc, data), { depth: 10 }));
46};
47log(getData, data);
48log(reverseData, reverse);
49var templateObject_1, templateObject_2;
50//# sourceMappingURL=checkany.js.map
\No newline at end of file