Skip to content

Instantly share code, notes, and snippets.

View mechmillan's full-sized avatar
💭
👨‍💻

Alfonso Millan mechmillan

💭
👨‍💻
View GitHub Profile
@mechmillan
mechmillan / notes.md
Last active February 13, 2019 15:26
GraphQL Morning Bytes Notes
const express = require('express');
const graphqlHTTP = require('express-graphql'); // HTTP server middleware
const fetch = require('node-fetch'); // to perform our POST request
const DataLoader = require('dataloader'); // utility for batching and caching
const cors = require('cors'); // to set up cross-origin resource sharing
const schema = require('./schema'); // our data models
let app = express();
// Fetch data from the Pokemon API
const {
GraphQLSchema,
GraphQLObjectType,
GraphQLInt,
GraphQLString,
GraphQLList
} = require('graphql'); // Reference implementation of graphQL for JavaScript
// Creating a new Object Type, note self-documenting nature of the code
// static-types allow GraphiQL GUI to update with correct fields
@mechmillan
mechmillan / index.html
Last active December 12, 2017 01:42
Both files have to be in the same directory
<!DOCTYPE html>
<html>
<head>
<title>For JS Debugger Access on Chrome Console</title>
<meta charset="utf-8">
</head>
<body>
<script src="testFile.js"></script>
</body>
</html>