Skip to content

Instantly share code, notes, and snippets.

@kkworden kkworden/script.js

Created Dec 12, 2018
Embed
What would you like to do?
Script code for the GraphQL chat API
function getChatroom() {
$.post('/api', { query: '{ messages }' }, function(data) {
$('#messages').html(data.data.messages);
});
}
setInterval(function() {
getChatroom();
}, 2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.