Skip to content

Instantly share code, notes, and snippets.

@kbrandwijk
kbrandwijk / Query.ts
Created January 4, 2018 13:18
forwardTo
import { Context, forwardTo } from '../utils'
export const Query = {
viewer: () => ({}),
topExperiences: async (parent, args, ctx: Context, info) => {
return ctx.db.query.experiences({ orderBy: 'popularity_DESC' }, info)
},
// Here's the magic line
@kbrandwijk
kbrandwijk / finalSchema.ts
Created November 28, 2017 12:16
Schema imports
export const finalSchema = `
# import { topExperiences, topHomes, topReservations, featuredDestinations, experiencesByCity } from 'homepage'
# import { viewer } from 'viewer'
# import { signup, login } from 'auth'
# import { addPaymentMethod, book } from 'newmutations'
type Query {
topExperiences: [Experience!]!
topHomes: [Home!]!
topReservations: [Reservation!]!
@kbrandwijk
kbrandwijk / graphcool.lua
Created November 12, 2017 15:16
Graphcool autocomplete for clink/cmder
-- For clink, place this file in one of the folders described here:
-- https://github.com/mridgers/clink/blob/master/docs/clink.md#file-locations
-- For cmder, place this file in the cmder config folder
local parser = clink.arg.new_parser
local no_options_parser = parser({})
local target_options = {
@kbrandwijk
kbrandwijk / gateway.yml
Last active October 31, 2017 01:20
Graphcool API Gateway configuration
endpoints:
- url: http://localhost:60000/simple/v1/cj9bgncpa00040157l0nft8x4
authentication: caller
- url: ${env:GRAPHCOOL_SECOND_ENDPOINT}
authentication:
token: ${env:GRAPHCOOL_TOKEN}
types:
- sdl: ./src/linkingSchema.graphql
- code: ./src/permissionSchema.ts
@kbrandwijk
kbrandwijk / _Integration ideas.md
Last active September 28, 2018 04:46
Graphcool-AWS integration ideas

Graphcool and AWS functions

Context

I have a Graphcool project definition, with multiple stages, and I have a Serverless AWS definition. I use the Serverless AWS definition to deploy all of my functions, and I link them to Graphcool by using Webhooks. This document describes some of the ideas for linking those two deployments together.

Information exchange

So what kind of information do the Graphcool service and the Serverless service need to know about each other in order to connect?