Skip to content

Instantly share code, notes, and snippets.

View sudarshang's full-sized avatar

Sudarshan Gaikaiwari sudarshang

View GitHub Profile
@sudarshang
sudarshang / SingleTableAppSync.md
Created September 4, 2020 18:48 — forked from dabit3/SingleTableAppSync.md
GraphQL Single Table Design with DynamoDB and AWS AppSync

GraphQL

GraphQL Schema

type Customer {
  id: ID!
  email: String!
}
#!/usr/bin/env python3
"Generate all strings containing just ( and ) with parens balenced."
from itertools import count
def parens():
def nested(x):
return ("(" * x) + (")" * x) if x > 0 else ""
(function (history, trackingId, options) {
const generateId = () => {
return '_' + Math.random().toString(36).substr(2, 9);
};
const getId = () => {
if (!localStorage.cid) {
localStorage.cid = generateId()
}
return localStorage.cid;
};
@sudarshang
sudarshang / tutorial.md
Created July 17, 2018 15:15 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.

Sequence of Gatsby's bootstrap lifecycle with links to source code as of v2.0.0

  1. open and validate gatsby-config (get-config-file.js)
  2. load plugins (load-plugins/index.js) from the list given in gatsby-config.js
  3. onPreBootstrap: runs onPreBootstrap if it is implemented in any plugins, for example gatsby-plugin-typography. Receives handy [apiCallArgs](https://github.com/gatsbyjs/gatsby/blob/ffd8b2d691c995c760fe380769852bcdb26a2278/packages/gatsby/src/util