Skip to content

Instantly share code, notes, and snippets.

@camiinthisthang
camiinthisthang / addgist.txt
Created January 20, 2022 23:11
description
This is a cool way to add a gist!
//This assumes that you've already set up Apollo Client and have wrapped your React app in an ApolloProvider component.
//Inside your component you want to make the query from and display that data in:
import { gql, useQuery } from "@apollo/client";
const AddOns = () => {
const [cartItems, setCartItems] = useState([]);
const [sort, setSort] = useState("salePrice_DESC");
const [productTypeFilter, setProductTypeFilter] = useState([]);
const [strainTypeFilter, setstrainTypeFilter] = useState([]);
//Create a .env file and assign all of your firebase private keys to variables and refernce them in the firebase component.
// In the firebase.js component:
import firebase from "firebase/app";
import "firebase/firestore";
import "firebase/auth";
import "firebase/database";
const app = {
apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY,
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
// Create a file in your pages folder and define what actions to take on your content
import * as contentful from "contentful-management";
export default async (req, res) => {
console.log("whats in request body", typeof req.body);
const client = contentful.createClient({
// This is the access token for this space. Normally you get the token in the Contentful web app
accessToken: "ppfbfBBbqdaC4KTIqne8rtJhU_XXChx6rBzXbX6x8gI",