Skip to content

Instantly share code, notes, and snippets.

View frikille's full-sized avatar

Peter Balazs frikille

  • @flowyltd
  • London
View GitHub Profile
@frikille
frikille / buckets.tf
Created May 17, 2020 15:47 — forked from nagelflorian/buckets.tf
Terraform config for static website hosting on AWS
# AWS S3 bucket for static hosting
resource "aws_s3_bucket" "website" {
bucket = "${var.website_bucket_name}"
acl = "public-read"
tags {
Name = "Website"
Environment = "production"
}
@frikille
frikille / schema.graphql
Last active August 2, 2018 09:54
Full schema definition example for GraphQL Input Union RFC
literal PostInputKind
literal ImageInputKind
input AddPostInput {
kind: ImageInputKind
title: String!
body: String!
}
input AddImageInput {
@frikille
frikille / input-interface.graphql
Last active July 26, 2018 15:57
GraphQL input union proposal
interface AddMediaBlock = {
inputTypeName: AddMediaBlockInputTypeNameEnum!
}
enum AddMediaBlockInputTypeNameEnum {
AddPostInput
AddImageInput
}
input AddPostInput implements AddMediaBlockInterface {
@frikille
frikille / examples
Created June 22, 2017 12:06
custom errors in graphql mutation
// query
mutation {
createUser(user: {username: "John Doe", email: "john.doe@test"}) {
user {
email
username
}
errors {
key
message

Keybase proof

I hereby claim:

  • I am frikille on github.
  • I am frikille (https://keybase.io/frikille) on keybase.
  • I have a public key ASBy10DArxJ_ZxGaXFZ9hobR6CYl_1myVT7MCOaqGQrJEwo

To claim this, I am signing this object:

@GQLQuery
class CommentsAndLikes extends React.Component {
static queries = {
commentAndLikes() {
return `
likes {
id,
user {
id
}
let PostMutationType = new GraphQLObjectType({
name: 'PostType',
fields: () => ({
like: {
type: PostLikeType,
args: {
postId: {
name: 'postId',
type: GraphQLInt
}
export function GQLQuery(Component) {
Component.getQuery = function (name, ...params) {
return this.queries[name].apply(this, params);
};
return Component;
}
import React from 'react';
import { GQLQuery } from './GQLQuery.js';
@GQLQuery
class CommentsAndLikes extends React.Component {
static queries = {
commentAndLikes() {
return `
likes {
id,
import {
graphql,
GraphQLObjectType,
GraphQLInt,
GraphQLString,
GraphQLSchema
} from 'graphql';
import PostType from './PostType.js';
import User from '../models/User.js';