Skip to content

Instantly share code, notes, and snippets.

View chandan-reddy-k's full-sized avatar
:octocat:
Programming is an art, be the artist.

Chandan chandan-reddy-k

:octocat:
Programming is an art, be the artist.
View GitHub Profile
@chandan-reddy-k
chandan-reddy-k / .yml
Last active November 23, 2019 00:16
Travis yml configuration for multi-environment (staging & production) AWS elastic beanstalk deployment
language: node_js
node_js:
- "11.6.0"
branches:
only:
- staging
- master
deploy:
- provider: elasticbeanstalk
access_key_id: ${AWS_ACCESS_KEY_ID}
@chandan-reddy-k
chandan-reddy-k / development.js
Created May 8, 2019 05:37
Introspection Fragment Matcher
import ApolloClient from 'apollo-client';
import { InMemoryCache } from 'apollo-cache-inmemory';
import { HttpLink } from 'apollo-link-http';
import { IntrospectionFragmentMatcher } from 'apollo-cache-inmemory';
import introspectionQueryResultData from './fragmentTypes.json';
const fragmentMatcher = new IntrospectionFragmentMatcher({
introspectionQueryResultData
});
@chandan-reddy-k
chandan-reddy-k / schemaQuery.js
Created May 7, 2019 19:02
Query and fetch Schema
const fetch = require('node-fetch');
const fs = require('fs');
fetch(`https://api.example.com/graphql`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
variables: {},
query: `
{