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
// Run this in node 18 and up | |
(async () => { | |
const API_KEY = `KEY`; | |
const url = `https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=USDT&CMC_PRO_API_KEY=${API_KEY}&convert=GBP`; | |
const response = await fetch(url, { | |
method: "GET", | |
headers: { | |
Accept: "application/json", | |
}, |
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
import express from "express" | |
import { createYoga } from "graphql-yoga"; | |
import { makeExecutableSchema } from "graphql-tools"; | |
const app = express(); | |
// GraphQL Schema | |
const schema = makeExecutableSchema({ | |
typeDefs, | |
resolvers, |
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 nameInputs = document.querySelectorAll("input[type=text]"); | |
const firstName = nameInputs[0]; | |
const secondName = nameInputs[1]; | |
firstName.value = "Daniel"; | |
secondName.value = "Starns"; | |
const checkboxes = document.querySelectorAll("input[type=checkbox]"); | |
const sixPM = checkboxes[0]; |
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
mutation { | |
createPeople( | |
input: [ | |
{ | |
name: "Tom Hanks" | |
movies: { | |
create: [ | |
{ | |
node: { | |
name: "Forrest Gump" |
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
{ | |
"people": [ | |
{ | |
"name": "Tom Hanks", | |
"movies": [ | |
{ | |
"title": "Forrest Gump", | |
"genres": [{ "name": "Drama" }, { "name": "Romance" }] | |
} | |
] |
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
query { | |
people(where: { name: "Tom Hanks" }) { | |
name | |
movies { | |
title | |
genres { | |
name | |
} | |
} | |
} |
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
import { Neo4jGraphQL } from "@neo4j/graphql"; | |
import * as neo4j from "neo4j-driver"; | |
import { ApolloServer } from "apollo-server"; | |
const typeDefs = ` | |
type Movie { | |
title: String! | |
actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) | |
genres: [Genre!]! @relationship(type: "In_GENRE", direction: OUT) | |
} |
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
type Movie { | |
title: String! | |
actors: [Person] @relationship(type: "ACTED_IN", direction: IN) | |
genres: [Genre] @relationship(type: "In_GENRE", direction: OUT) | |
} | |
type Person { | |
name: String! | |
movies: [Movie] @relationship(type: "ACTED_IN", direction: OUT) | |
} |
NewerOlder