The GraphQL Summit schedule as a graph!
GraphQL Summit is the world's largest conference dedicated to GraphQL. This repo contains a simple demo GRANDstack app to explore the conference sessions and show personalized recommendations using:
GRANDstack
Follow these steps to get the GraphQL Summit Graph up and running:
The data for the app is stored in Neo4j graph database. You can download Neo4j Desktop locally or spin up a blank Neo4j Sandbox.
If you are using Neo4j Desktop you'll need to install the APOC standard library by clicking "Add Plugin" then select Install for APOC. Neo4j Sandbox already includes APOC so if using Sandbox this step is not necessary.
To import the GraphQL Summit schedule data into Neo4j, run this query in Neo4j Browser by copy/pasting it in the query editor in Neo4j Browser:
LOAD CSV WITH HEADERS FROM "https://raw.githubusercontent.com/johnymontana/graphql-summit-graph/master/data/summit_schedule.csv" AS row
MERGE (s:Session {title: row.title})
SET
s.date = datetime({epochMillis: apoc.date.parse(row.date, 'ms', 'MM/dd/yyyy HH:mm a')}),
s.level = row.audience,
s.format = row.format,
s.abstract = row.abstract,
s.title = row.title
MERGE (sp:Speaker {name: row.name})
SET
sp.twitter = row.twitter,
sp.github = row.github,
sp.website = row.website,
sp.role = row.role,
sp.image = coalesce(row.image, row.headshot)
MERGE (sp)-[:PRESENTS]->(s)
MERGE (cp:Company {name: row.organization})
MERGE (cp)<-[wf:WORKS_FOR]-(sp)
MERGE (th:Theme {name: row.theme})
MERGE (th)<-[:HAS_THEME]-(s)
MERGE (r:Room {name: row.track})
MERGE (r)<-[:IN_ROOM]-(s)
A GraphQL API fetches data from Neo4j using the neo4j-graphql.js
Install dependencies
cd api
npm install
Add Neo4j credentials to .env
Edit the .env
file, adding the connection credentials for your Neo4j database. If using Neo4j Sandbox, check the "Details" tab for your sandbox credentials. The value for NEO4J_URI
will be of the format bolt://<IP_ADDRESS>:<BOLT_PORT>
. For example, given the sandbox instance:
then in your .env
file:
NEO4J_USER=neo4j
NEO4J_PASSWORD=ways-nails-radians
NEO4J_URI=bolt://54.236.16.222:33773
If you are using Neo4j Desktop locally, then you .env
file should be:
NEO4J_USER=neo4j
NEO4J_PASSWORD=<THE_DATABASE_PASSWORD_YOU_SET_WHEN_CREATING_IT_HERE>
NEO4J_URI=bolt://localhost:7687
Then start the GraphQL API application, which will connect to your Neo4j instance, translate GraphQL requests to Cypher and handle data fetching. This will start the API app at http://localhost:4001
by default:
Start API server
DEBUG=neo4j-graphql.js npm run start
Navigate to http://localhost:4001
in a web browser to load GraphQL Playground, an interactive tool to query our GraphQL endpoint.
Here are some interesting GraphQL queries you can try:
Find sessions with "resolver" in the abstract and recommended sessions
{
Session(filter: { abstract_contains: "resolver" }) {
title
abstract
room {
name
}
theme {
name
}
presentedBy {
name
worksFor {
name
}
}
recommended {
title
}
}
}