This file contains hidden or 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
// temporary fix for https://github.com/neo4j/graphql/issues/292 | |
import { wrapSchema, RenameInputObjectFields } from '@graphql-tools/wrap' | |
import { Neo4jGraphQL } from '@neo4j/graphql' | |
import { typeDefs } from './typeDefs' | |
// renames all InputObjectFields matching 'skip' | |
// see https://www.graphql-tools.com/docs/schema-wrapping#renaming | |
const renamingFn = (typeName: string, fieldName: string): string => { |
This file contains hidden or 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
const invariant = require('invariant'); | |
const { Kind } = require('graphql'); | |
const byKindGetInfo = { | |
// SchemaDefinition | |
[Kind.SCHEMA_DEFINITION]: def => ({ | |
isExtension: false, | |
type: 'schema', | |
typeName: 'schema', | |
}), |
This file contains hidden or 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
const Web3 = require('web3') | |
// *WRONG* | |
// const localProviderUrl = 'wss://localhost:8545' | |
// Result: | |
// | |
// connection not open on send() | |
// Error in subscription wss://localhost:8545 | |
// Error: connection not open |
This file contains hidden or 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
const Web3 = require('web3'); | |
const fs = require('fs'); | |
const solc = require('solc'); | |
/* | |
* connect to ethereum node | |
*/ | |
const ethereumUri = 'http://localhost:8540'; | |
const address = '0x004ec07d2329997267Ec62b4166639513386F32E'; // user |
This file contains hidden or 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
digraph architecture { | |
rankdir=LR; | |
// Storage - #303F9F (dark blue) | |
node[fillcolor="#303F9F" style="filled" fontcolor="white"]; | |
database[label="DB"]; cache[label="Redis"]; | |
// Client-side Apps - #FFEB3B (yellow) | |
node[fillcolor="#FFEB3B" style="filled" fontcolor="black"]; | |
front_end[label="Front-end App"]; extension[label="Browser Extension"]; |
This file contains hidden or 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
// npm install graphql graphql-tools graphql-subscriptions | |
const { PubSub, SubscriptionManager } = require('graphql-subscriptions'); | |
const { makeExecutableSchema } = require('graphql-tools'); | |
// Our "database" | |
const messages = []; | |
// Minimal schema | |
const typeDefs = ` | |
type Query { |