Skip to content

Instantly share code, notes, and snippets.

View TheMagoo73's full-sized avatar
🦧
Doing Open Source stuff

John Clarke TheMagoo73

🦧
Doing Open Source stuff
View GitHub Profile
const path = require('path')
module.exports = {
"stories": [
"../src/**/*.stories.mdx",
"../src/**/*.stories.@(js|jsx|ts|tsx)"
],
"addons": [
"@storybook/addon-links",
"@storybook/addon-essentials",
@import "../../index.css";
module.exports = {
style: {
postcss: {
plugins: [
require('tailwindcss'),
require('autoprefixer'),
],
},
},
}
import './App.css';
function App() {
return (
<div className="w-full h-screen mx-auto container flex flex-col items-center justify-center">
<div className="items-center flex flex-col items-center bg-blue-400 px-16 py-12 rounded-lg shadow-xl">
<div className="text-2xl text-white font-extrabold ">React + Tailwind + Storybook</div>
<div className="text-lg text-white font-medium">Much awesome frontend development!</div>
</div>
</div>
@tailwind base;
@tailwind components;
@tailwind utilities;
@tailwind forms;
module.exports = {
purge: ['./src/**/*.{js,jsx,ts,tsx}', './public/index.html'],
darkMode: false, // or 'media' or 'class'
theme: {
extend: {},
},
variants: {
extend: {},
},
plugins: [
const chai = require('chai')
chai.should()
const { makeExecutableSchema } = require('graphql-tools')
const { graphql } = require('graphql')
const mockQuoteService = () => {
return "Foo is never a substitute for Bar"
}
@TheMagoo73
TheMagoo73 / graphql-context-injection.js
Created March 31, 2020 10:16
Get a quote of the day using Apollo and node-fetch
const express = require ('express')
const { ApolloServer, gql } = require('apollo-server-express')
const fetch = require('node-fetch')
const typeDefs = gql`
type Query {
quote: String
}
`
@TheMagoo73
TheMagoo73 / apollo-resolver-example.js
Created March 31, 2020 08:52
Apollo resolver example
const express = require ('express')
const { ApolloServer, gql } = require('apollo-server-express')
const typeDefs = gql`
type Query {
greeting(username: String!): String
}
`
const resolvers = {
const express = require ('express')
const { ApolloServer, gql } = require('apollo-server-express')
const typeDefs = gql`
type Query {
greeting: String
}
`
const resolvers = {