Skip to content

Instantly share code, notes, and snippets.

@BerndWessels
Created May 22, 2019 01:42
Show Gist options
  • Save BerndWessels/7f71d4b2076467319979bef846ac454d to your computer and use it in GitHub Desktop.
Save BerndWessels/7f71d4b2076467319979bef846ac454d to your computer and use it in GitHub Desktop.
BFF pulumi medium 2
"use strict";
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// node dependencies
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const fs = require('fs');
const glob = require('glob');
const path = require('path');
// Add the ability to read .graphql files as strings.
require.extensions['.graphql'] = function (module, filename) {
module.exports = fs.readFileSync(filename, 'utf8');
};
// Pulumi dependencies
const pulumi = require("@pulumi/pulumi");
const aws = require("@pulumi/aws");
const awsx = require("@pulumi/awsx");
// Read the GraphQL Schema as a string.
const graphQLSchema = require('./schema.graphql');
// Regular Expression helper function
const findMatches = (regex, str, matches = []) => {
const res = regex.exec(str);
res && matches.push(res[1]) && findMatches(regex, str, matches);
return matches;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment