This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* NodeJS logger with datetime stamp just because. | |
* =============================================== | |
* | |
* Hold onto your socks now. | |
* | |
* Usage example | |
* var logger = new (require('./logger'))().log; | |
* var prefixedLogger = new (require('./logger'))('[PREFIX]').log; | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Arango = require('arangojs'); | |
var async = require('async'); | |
var db = Arango.Connection(); | |
var testDate = 1406881769977; // Fri Aug 01 2014 08:29:29 GMT+0000 | |
var dateDelta = 500000; | |
var data = []; | |
var edgesData = []; | |
var createdDocuments = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Arango = require('arangojs'); | |
var async = require('async'); | |
var db = Arango.Connection(); | |
var testDate = 1406881769977; // Fri Aug 01 2014 16:29:29 GMT+0800 (SGT) | |
var dateDelta = 500000; | |
var data = []; | |
var edgesData = []; | |
var createdDocuments = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// In GraphQL's type system shorthand notation. | |
// (See: http://graphql.org/docs/typesystem) | |
// | |
type Query { | |
latestPost: String | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": { | |
"latestPost": "Hello World!" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPOST http://localhost:8080/graphql \ | |
-H 'Content-Type: application/graphql' \ | |
-d 'query Root{ latestPost }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// In GraphQL's type system shorthand notation. | |
// (See: http://graphql.org/docs/typesystem) | |
// | |
type Post { | |
id: ID! | |
text: String | |
} | |
type Query { | |
latestPost: Post |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
... | |
"github.com/sogko/golang-relay-starter-kit/data" | |
) | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Relay from 'react-relay'; | |
// Your Relay routes | |
// Define a root GraphQL query into which your | |
// containers' query fragments will be composed. | |
export default class extends Relay.Route { | |
static queries = { | |
latestPost: () => Relay.QL` | |
query { | |
latestPost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
OlderNewer