@webresto/graphql 1.3.5 → 1.3.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,7 +8,6 @@ exports.default = {
8
8
  sendAction
9
9
  };
10
10
  function sendMessage(orderId, message) {
11
- console.log({ orderId, message });
12
11
  const pubsub = graphql_1.default.getPubsub();
13
12
  pubsub.publish("message", { orderId, message });
14
13
  }
@@ -11,7 +11,6 @@ export {
11
11
  }
12
12
 
13
13
  function sendMessage(orderId: String, message: any) {
14
- console.log({orderId, message})
15
14
  const pubsub = graphql.getPubsub();
16
15
  pubsub.publish("message", {orderId, message});
17
16
  }
@@ -223,17 +223,12 @@ function createType(model) {
223
223
  scalarType = scalarTypes[relationModel.attributes[relationModel.primaryKey].type];
224
224
  const name = sails.models[attributes[prop].model.toLowerCase()].globalId;
225
225
  type += ` ${prop}: ${name}\n`;
226
- // todelete
227
- type += ` ${prop}Id: ${scalarType}\n`;
228
226
  }
229
227
  // COLLECTION SCHEMA GENERATION
230
228
  if (attributes[prop].collection) {
231
229
  scalarType = scalarTypes[attributes[sails.models[attributes[prop].collection.toLowerCase()].primaryKey].type.toLowerCase()];
232
230
  const name = sails.models[attributes[prop].collection.toLowerCase()].globalId;
233
- console.log(1, scalarType);
234
231
  type += ` ${prop}: [${name}]\n`;
235
- // todelete
236
- type += ` ${prop}Ids: ${scalarType}\n`;
237
232
  }
238
233
  }
239
234
  if (customFields[modelName]) {
@@ -228,20 +228,13 @@ function createType(model) {
228
228
  scalarType = scalarTypes[relationModel.attributes[relationModel.primaryKey].type]
229
229
  const name = sails.models[attributes[prop].model.toLowerCase()].globalId;
230
230
  type += ` ${prop}: ${name}\n`;
231
-
232
- // todelete
233
- type += ` ${prop}Id: ${scalarType}\n`;
234
231
  }
235
232
 
236
233
  // COLLECTION SCHEMA GENERATION
237
234
  if (attributes[prop].collection) {
238
235
  scalarType = scalarTypes[attributes[sails.models[attributes[prop].collection.toLowerCase()].primaryKey].type.toLowerCase()]
239
236
  const name = sails.models[attributes[prop].collection.toLowerCase()].globalId;
240
- console.log(1,scalarType)
241
237
  type += ` ${prop}: [${name}]\n`;
242
-
243
- // todelete
244
- type += ` ${prop}Ids: ${scalarType}\n`;
245
238
  }
246
239
  }
247
240
  if (customFields[modelName]) {
package/package.json CHANGED
@@ -60,5 +60,5 @@
60
60
  "test:js": "mocha test/bootstrap.js './test/{,!(fixture)/**}/*.test.js' --exit",
61
61
  "test:init": "cd ./test/fixture && npm i --no-package-lock --prefix ./ && cd -"
62
62
  },
63
- "version": "1.3.5"
63
+ "version": "1.3.6"
64
64
  }
@@ -16,4 +16,10 @@ export declare const additionalResolver: {
16
16
  Group: {
17
17
  parentGroup: (parent: any, args: any, context: any, info: any) => Promise<any>;
18
18
  };
19
+ Order: {
20
+ dishes: (parent: any, args: any, context: any, info: any) => Promise<any>;
21
+ };
22
+ OrderDish: {
23
+ dish: (parent: any, args: any, context: any, info: any) => Promise<any>;
24
+ };
19
25
  };
@@ -3,8 +3,8 @@ declare const _default: {
3
3
  checkOrder: {
4
4
  def: string;
5
5
  fn: (parent: any, args: any, context: any) => Promise<void | {
6
+ message: any;
6
7
  order: import("@webresto/core/models/Order").default;
7
- message?: undefined;
8
8
  } | {
9
9
  message: {
10
10
  type: string;
@@ -64,7 +64,6 @@ exports.default = {
64
64
  await Order.update({ id: order.id }, order).fetch();
65
65
  await Order.check(order.id, data.customer, isSelfService, data.address, data.paymentMethodId);
66
66
  order = await Order.findOne(data.orderId);
67
- console.log(order.dishes);
68
67
  let message;
69
68
  if (order.state === "CHECKOUT") {
70
69
  message = {
@@ -80,7 +80,6 @@ export default {
80
80
  );
81
81
 
82
82
  order = await Order.findOne(data.orderId);
83
- console.log(order.dishes)
84
83
 
85
84
  let message;
86
85
 
@@ -2,7 +2,6 @@ const expect = require("chai").expect;
2
2
  describe('GraphQl', function () {
3
3
  it('Added fields exist in schema', async () => {
4
4
  const graphql = require('./../fixture/node_modules/@webresto/graphql/src/graphql').default;
5
- console.log(graphql);
6
5
  const result = await graphql.getServer().executeOperation({
7
6
  query: '{dish { id } \n group { id }}'
8
7
  });
@@ -4,7 +4,6 @@ describe('GraphQl', function () {
4
4
  it('Added fields exist in schema', async () => {
5
5
 
6
6
  const graphql = require('./../fixture/node_modules/@webresto/graphql/src/graphql').default;
7
- console.log(graphql)
8
7
  const result = await graphql.getServer().executeOperation({
9
8
  query: '{dish { id } \n group { id }}'
10
9
  });
@@ -2,7 +2,6 @@ const expect = require("chai").expect;
2
2
  describe('Send order to restarant', function () {
3
3
  it('Create new', async () => {
4
4
  const graphql = require('./../fixture/node_modules/@webresto/graphql/src/graphql').default;
5
- console.log(graphql);
6
5
  const result = await graphql.getServer().executeOperation({
7
6
  query: `
8
7
  {order(orderId:"test-cart"){
@@ -14,7 +13,6 @@ describe('Send order to restarant', function () {
14
13
  });
15
14
  it('orderAddDish', async () => {
16
15
  const graphql = require('./../fixture/node_modules/@webresto/graphql/src/graphql').default;
17
- console.log(graphql);
18
16
  const result = await graphql.getServer().executeOperation({
19
17
  query: `
20
18
  mutation{orderAddDish(dishId: "df19cbbc-c026-595e-9296-1c8a378da6b3", orderId:"test-cart", amount: 1){
@@ -34,7 +32,6 @@ describe('Send order to restarant', function () {
34
32
  });
35
33
  it('checkOrder', async () => {
36
34
  const graphql = require('./../fixture/node_modules/@webresto/graphql/src/graphql').default;
37
- console.log(graphql);
38
35
  const result = await graphql.getServer().executeOperation({
39
36
  query: `
40
37
  mutation{checkOrder(orderId:"test-cart", paymentMethodId: "", address: {city: "town", street: "test", home: "123"}, customer: {phone: {code: "+1", number: "0000000000"}, name: "Piter Parker"}) {
@@ -59,7 +56,6 @@ describe('Send order to restarant', function () {
59
56
  });
60
57
  it('sendOrder', async () => {
61
58
  const graphql = require('./../fixture/node_modules/@webresto/graphql/src/graphql').default;
62
- console.log(graphql);
63
59
  const result = await graphql.getServer().executeOperation({
64
60
  query: `
65
61
  mutation{sendOrder(orderId:"test-cart") {
@@ -4,7 +4,6 @@ describe('Send order to restarant', function () {
4
4
  it('Create new', async () => {
5
5
 
6
6
  const graphql = require('./../fixture/node_modules/@webresto/graphql/src/graphql').default;
7
- console.log(graphql)
8
7
  const result = await graphql.getServer().executeOperation({
9
8
  query: `
10
9
  {order(orderId:"test-cart"){
@@ -22,7 +21,7 @@ describe('Send order to restarant', function () {
22
21
  it('orderAddDish', async () => {
23
22
 
24
23
  const graphql = require('./../fixture/node_modules/@webresto/graphql/src/graphql').default;
25
- console.log(graphql)
24
+
26
25
  const result = await graphql.getServer().executeOperation({
27
26
  query: `
28
27
  mutation{orderAddDish(dishId: "df19cbbc-c026-595e-9296-1c8a378da6b3", orderId:"test-cart", amount: 1){
@@ -45,7 +44,7 @@ describe('Send order to restarant', function () {
45
44
  it('checkOrder', async () => {
46
45
 
47
46
  const graphql = require('./../fixture/node_modules/@webresto/graphql/src/graphql').default;
48
- console.log(graphql)
47
+
49
48
  const result = await graphql.getServer().executeOperation({
50
49
  query: `
51
50
  mutation{checkOrder(orderId:"test-cart", paymentMethodId: "", address: {city: "town", street: "test", home: "123"}, customer: {phone: {code: "+1", number: "0000000000"}, name: "Piter Parker"}) {
@@ -74,7 +73,7 @@ describe('Send order to restarant', function () {
74
73
  it('sendOrder', async () => {
75
74
 
76
75
  const graphql = require('./../fixture/node_modules/@webresto/graphql/src/graphql').default;
77
- console.log(graphql)
76
+
78
77
  const result = await graphql.getServer().executeOperation({
79
78
  query: `
80
79
  mutation{sendOrder(orderId:"test-cart") {
package/todo.md CHANGED
@@ -1 +1 @@
1
- 1. Add support for multi websoketServer (several tests placed in lib dirrectory)
1
+ 1. Add support for multi websoketServer (several tests placed in lib dirrectory)
package/restApi.http DELETED
@@ -1,11 +0,0 @@
1
- @host = http://127.0.0.1:42777
2
-
3
- @host2 = https://api.lifenadym.webresto.dev
4
-
5
- GET {{host}}/api/0.5/menu
6
-
7
- ###
8
- GET {{host2}}/api/0.5/api/getNomenclature
9
-
10
- ###
11
- GET {{host}}/api/0.5/menu?groupSlug=sousy