Skip to content

Instantly share code, notes, and snippets.

@banyan

banyan/a.js Secret

Created June 14, 2019 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save banyan/a7bce090dc1af08791d624110dd79b7d to your computer and use it in GitHub Desktop.
Save banyan/a7bce090dc1af08791d624110dd79b7d to your computer and use it in GitHub Desktop.
const graphql = require('@octokit/graphql');
const a = async () => {
const query = `
mutation {
addLabelsToLabelable(input: {labelIds: ["MDU6TGFiZWwxMTY1MDg0MTQy"], labelableId: "MDExOlB1bGxSZXF1ZXN0Mjg4MzIzNzcz"}) {
clientMutationId
}
}`;
const foo = await graphql(query, {
headers: {
Accept: 'application/vnd.github.hoge-preview+json',
authorization: `token xxx`,
},
});
console.log('foo: ', foo);
};
try {
a();
} catch (err) {
console.log(err);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment