Skip to content

Instantly share code, notes, and snippets.

View praveenweb's full-sized avatar

Praveen Durairaju praveenweb

View GitHub Profile
query {
amazing_synonyms {
synonym
}
}
@praveenweb
praveenweb / codegen.js
Created September 5, 2019 11:46
graphql-code-generator-config
module.exports = {
"schema": [
{
"http://localhost:8080/v1/graphql": {
"headers": {
// neccessary auth headers to fetch schema
}
}
}
],
@praveenweb
praveenweb / AuthorSubscriptions.svelte
Created May 23, 2019 12:04
GraphQL Subscriptions using Svelte
<script context="module">
import gql from 'graphql-tag';
import { client } from './apollo';
import { subscribe } from 'svelte-apollo';
const AUTHOR_LIST = gql`
subscription {
author(order_by: [{name: asc}]) {
name
@praveenweb
praveenweb / Articles.svelte
Created May 23, 2019 11:58
Fetch Articles using GraphQL in Svelte
<script context="module">
import gql from 'graphql-tag';
import { client } from './apollo';
const ARTICLES = gql`
{
article {
id
title
author {
@praveenweb
praveenweb / Articles.svelte
Created May 23, 2019 11:58
Fetch Articles using GraphQL in Svelte
<script context="module">
import gql from 'graphql-tag';
import { client } from './apollo';
const ARTICLES = gql`
{
article {
id
title
author {
@praveenweb
praveenweb / static.config.js
Created February 11, 2019 07:55
react-static routing with GraphQL data fetch
import client from './src/apollo'
import {GET_AUTHOR, GET_ARTICLE} from './src/graphql/queries'
export default {
getSiteData: () => ({
title: 'React Static with Hasura GraphQL',
}),
getRoutes: async () => {
const {
data: { author },
<template>
<div>
<h3>Authors</h3>
<ul>
<li v-for="item in author" :key="item.id">
<nuxt-link :to="`/article/${item.id}`">
{{ item.name }}
</nuxt-link>
</li>
</ul>
require("honeycomb-beeline")({
writeKey: "<your-write-key>",
dataset: "node-js"
// ... additional optional configuration ...
});
var tracer = require('dd-trace').init({
hostname: '<host-name>',
port: 8126,
debug: true
});
tracer.use('express');
docker run -d -v /var/run/docker.sock:/var/run/docker.sock:ro \
-v /proc/:/host/proc/:ro \
-v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
-e DD_API_KEY=<YOUR_API_KEY> \
-e DD_APM_ENABLED=true \
datadog/agent:latest