Skip to content

Instantly share code, notes, and snippets.

@Insayt
Last active December 13, 2018 20:05
Show Gist options
  • Save Insayt/404e28ee6091af83542eeaaa734c7e23 to your computer and use it in GitHub Desktop.
Save Insayt/404e28ee6091af83542eeaaa734c7e23 to your computer and use it in GitHub Desktop.
test
const { request } = require('graphql-request');
const sendDataToLkMedia = (user, account, order) => {
// сообщаем lk.tooligram.com об оплате
const postData = `mutation {
createClient(
tooliUserId: "${order.user_id}",
tooliAccountId: "${order.account_id}",
instagramLogin: "${order.insta_login}",
instagramAvatar: "${account.avatar_url || ''}",
payDate: "${new Date(order.dt_to).getTime()}",
payRebilling: true,
tgone: ${parseInt(order.type) === 32},
token: "XSh6V6DEt4GUi5QTTkan57thSJs32t"
) {
id
}
}`;
request('http://localhost:3000/graphql', postData).then(data =>
console.log(data)
)
};
sendDataToLkMedia({}, {}, {
user_id: "kBqChcQ2E4VfGgPa1x5MjqrYWZ53",
account_id: '1',
insta_login: 'test',
dt_to: Date.now(),
type: 5
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment