Skip to content

Instantly share code, notes, and snippets.

View danstarns's full-sized avatar
🤟

Daniel Starns danstarns

🤟
View GitHub Profile
@danstarns
danstarns / neo4j-chainlink-seed.gql
Created January 8, 2022 21:18
neo4j-chainlink-seed
@danstarns
danstarns / example.toml
Last active January 9, 2022 09:23
example.toml
type = "directrequest"
schemaVersion = 1
name = "select"
contractAddress = "YOUR_ORACLE_ADDRESS"
maxTaskDuration = "0s"
observationSource = """
decode_log [type="ethabidecodelog"
abi="OracleRequest(bytes32 indexed specId, address requester, bytes32 requestId, uint256 payment, address callbackAddr, bytes4 callbackFunctionId, uint256 cancelExpiration, uint256 dataVersion, bytes data)"
data="$(jobRun.logData)"
topics="$(jobRun.logTopics)"]
@danstarns
danstarns / neo4j-chainlink-write-cypher.gql
Created January 8, 2022 17:56
neo4j-chainlink-write-cypher
@danstarns
danstarns / neo4j-chainlink-cypher-read.gql
Created January 8, 2022 17:53
neo4j-chainlink-cypher-read
@danstarns
danstarns / movie-contract.sol
Created January 8, 2022 13:21
movie-contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
contract Movie {
string public title;
string public imdbRating;
constructor() {
title = "Forrest Gump";
imdbRating = "8.8";
@danstarns
danstarns / Neo4j-GraphQL-Code-Challenge.md
Created January 7, 2022 13:18
Neo4j-GraphQL-Code-Challenge

Neo4j-GraphQL-Code-Challenge

In this project, connect to or start a Neo4j database and seed data, run your own Neo4j GraphQL API, and make a HTTP call to your Neo4j GraphQL API using Javascript in the browser.

Objectives

  1. Connect to or start a Neo4j database and seed data
  2. Build a Neo4j GraphQL API to interact with the seeded data
@danstarns
danstarns / neo4j-graphql-aggregate-with-ogm.js
Created November 17, 2021 14:11
neo4j-graphql-aggregate-with-ogm
const { OGM } = require("@neo4j/graphql");
const neo4j = require("neo4j");
const typeDefs = gql`
type Movie {
released: BigInt!
tagline: String
title: String!
## Rest of the Relationships
}
@danstarns
danstarns / aggregation-queries-hasura-vs-neo4j-graphql.md
Created November 17, 2021 13:12
aggregation-queries-hasura-vs-neo4j-graphql

Aggregation Queries Hasura vs Neo4j GraphQL

Comparing the queries here.

Fetch aggregated data of an object

Hasura

query {
@danstarns
danstarns / neo4j-graphql-aggregations-highest-movie-rating-json.json
Created November 17, 2021 10:12
neo4j-graphql-aggregations-highest-movie-rating-json
{
"data": {
"movies": [
{
"title": "The Da Vinci Code",
"reviewersAggregate": {
"edge": {
"rating": {
"max": "68"
}
@danstarns
danstarns / neo4j-graphql-aggregations-highest-movie-rating-gql.gql
Created November 17, 2021 10:08
neo4j-graphql-aggregations-highest-movie-rating-gql
{
movies(where: { title: "The Da Vinci Code" }) {
title
reviewersAggregate {
edge {
rating {
max
}
}
}