Read the latest specification: graphql
Visit the repo for this gist: repo
<!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> |
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 |
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 |
// in basic server.js | |
// mount express-graphql on '/graphql' as a route-handler | |
app.use( | |
GRAPHQL_ENDPOINT, | |
graphqlHTTP(req => { | |
// STEP 5: define your resolvers | |
// batch loading functions | |
// accepting an array of keys and returning | |
// promises that resolve to an array of values |
{"lastUpload":"2021-12-14T18:45:31.719Z","extensionVersion":"v3.4.3"} |
{ | |
"name": "run-git-log-with-npx-from-gist", | |
"version": "1.0.0", | |
"scripts": { | |
"set-global": "git config --global grep.extendedRegexp true", | |
"format-commits": "git log --pretty=format:"%h%x09%d%x09%an%x09%ad%x09%s" --no-merges --date=short --author="Alfonso" | commits.txt", | |
"log-unix": "npm run set-global && npm run format-commits", | |
}, | |
} |
// in a file called index.js | |
const fs = require('fs'); | |
const path = require('path'); | |
// Make sure to install spamscanner in your package.json | |
const SpamScanner = require('spamscanner'); | |
const scanEmail = async () => { | |
// For a list of all options & their defaults, see: | |
// https://www.npmjs.com/package/spamscanner#api | |
const scanner = new SpamScanner({ debug: true }); |
interface ParsedMail { | |
attachments: Attachment[]; | |
bcc?: AddressObject | AddressObject[]; | |
cc?: AddressObject | AddressObject[]; | |
date?: Date; | |
from?: AddressObject; | |
headerLines: HeaderLines; | |
headers: Headers; | |
html: string | false; | |
inReplyTo?: string; |
// in a file called index.js | |
const fs = require("fs"); | |
const path = require("path"); | |
// Make sure to install spamscanner in your package.json | |
const SpamScanner = require("spamscanner"); | |
const scanEmail = async () => { | |
// For a list of all options & their defaults, see: | |
// https://www.npmjs.com/package/spamscanner#api | |
const scanner = new SpamScanner({ debug: true }); |