Skip to content

Instantly share code, notes, and snippets.

View sogko's full-sized avatar

Hafiz Ismail sogko

View GitHub Profile

Keybase proof

I hereby claim:

  • I am sogko on github.
  • I am sogko (https://keybase.io/sogko) on keybase.
  • I have a public key ASD0R6VsTfZSI37_2wKvxjFy4ES_Qltu2-sJRunyNzzA-Qo

To claim this, I am signing this object:

// GraphQL Shorthand Notation Cheatsheet
// - Read the full article at: https://wehavefaces.net/graphql-shorthand-notation-cheatsheet-17cd715861b6
Schema
=======
GraphQL Schema => schema
Built-in scalar types
@sogko
sogko / main.go
Last active May 28, 2024 00:29
Example of creating custom `graphql-go/handler` using `handler.NewRequestOptions()` to parse http.Requests
package main
import (
"encoding/json"
"net/http"
"github.com/graphql-go/graphql"
"github.com/graphql-go/handler"
"github.com/graphql-go/relay/examples/starwars"
)
@sogko
sogko / main.go
Last active March 10, 2016 04:50
Example of using graphql-go/handler with a custom JWT middleware
package main
import (
"net/http"
"log"
"github.com/graphql-go/handler"
"github.com/graphql-go/relay/examples/starwars"
)
@sogko
sogko / schema.go
Last active February 11, 2016 05:59
package graphql
type Resources struct {
}
type Resource struct {
ID string `json:"id"`
Total float64 `json:"total"`
Used float64 `json:"used"`
When time.Time `json:"when"`
@sogko
sogko / SassMeister-input.scss
Created November 24, 2015 04:31
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$viewportIncrement: 1px;
$small: 480px;
$postSmall: $small + $viewportIncrement;
.test {
width: $viewportIncrement;
@sogko
sogko / main.go
Last active November 16, 2020 03:51
[graphql-go] Mutation example with `graphql-go/handler`
package main
import (
"github.com/graphql-go/graphql"
"github.com/graphql-go/handler"
"net/http"
)
type Todo struct {
ID string `json:"id"`
@sogko
sogko / main.go
Last active January 20, 2017 06:08
[graphql-go] Mutation example
package main
import (
"github.com/graphql-go/graphql"
"github.com/kr/pretty"
)
type Todo struct {
ID string `json:"id"`
Text string `json:"text"`
@sogko
sogko / test.js
Created November 2, 2015 16:52
graphql-go #35
import {
GraphQLSchema,
GraphQLObjectType,
GraphQLString,
GraphQLNonNull,
GraphQLList,
GraphQLBoolean,
GraphQLInt,
GraphQLFloat,
GraphQLEnumType,
@sogko
sogko / App.js
Last active October 14, 2015 14:53
hello-world-relay-part-1 - RelayJS App
import React from 'react';
import Relay from 'react-relay';
// Your React component
class App extends React.Component {
render() {
return (
<div>
<h1>{this.props.latestPost.text}</h1>
</div>