By Claude Code (Anthropic)
With vague assistance from Merlin Mann
April 7, 2026
Tip
A suggested prompt for your AI of choice:
🚚 The bookmarklet has moved to https://github.com/bramus/mastodon-profile-redirect/
| import gql from 'graphql-tag' | |
| import { print } from 'graphql/language/printer' | |
| import richTextFragment from './contentModules/richText.gql' | |
| import logoBlockFragment from './contentModules/logoBlock.gql' | |
| import embedBlockFragment from './contentModules/embedBlock.gql' | |
| import videoBlockFragment from './contentModules/videoBlock.gql' | |
| import imageCollageFragment from './contentModules/imageCollage.gql' | |
| import imageGridFragment from './contentModules/imageGrid.gql' | |
| import slideshowBlockFragment from './contentModules/slideshowBlock.gql' | |
| import singleImageFragment from './contentModules/singleImage.gql' |
When working with Web-to-Lead forms, you might run into a situation where you'd like to integrate the form with your frontend framework (React, Vue, Angular, etc...). This can be accomplished quite easily using whatever HTTP library you're most comfortable with.
To demonstrate this, let's take a look at an example Web-to-Lead form, and the JavaScript required to post Leads to a SFDC org.
<html lang="en">| <?php | |
| use craft\elements\db\EntryQuery; | |
| use craft\elements\Entry; | |
| use modules\appmodule\transformers\ProductTransformer; | |
| use rias\scout\IndexSettings; | |
| use rias\scout\ScoutIndex; | |
| use Tightenco\Collect\Support\Collection; | |
| $indexPrefix = getenv('ALGOLIA_INDEX_PREFIX') ?: CRAFT_ENVIRONMENT . '_'; |
| include: 'https://gitlab.com/gitlab-cd/ssh-template/raw/master/ssh.yml' | |
| # Install build dependencies. | |
| .build: | |
| image: node:12.8 | |
| variables: | |
| YARN_CACHE_DIR: '.ci/yarn-cache' | |
| script: | |
| # Some build dependencies |
| const { createHttpLink } = require('apollo-link-http'); | |
| const fetch = require('node-fetch'); | |
| const store = require('store'); | |
| const sourceNodes = require('gatsby/dist/utils/source-nodes'); | |
| require('dotenv').config(); | |
| const craftGqlUrl = process.env.CRAFT_GQL_URL; | |
| const craftGqlToken = process.env.CRAFT_GQL_TOKEN; | |
| module.exports = { |
my-clientProject number on the project Home screen (Craft refers to this as the Project ID)+ Create credentials button and choose the Service Account typecraft-cms or similarOwnerKeys tab and click Add key > Create new key and select the JSON format| // Server API makes it possible to hook into various parts of Gridsome | |
| // on server-side and add custom data to the GraphQL data layer. | |
| // Learn more: https://gridsome.org/docs/server-api | |
| // Changes here requires a server restart. | |
| // To restart press CTRL + C in terminal and run `gridsome develop` | |
| const { setContext } = require('apollo-link-context') | |
| const { HttpLink } = require('apollo-link-http') | |
| const { |
| - webpack.config.js | |
| - postcss.config.js | |
| - config.js | |
| - addons.js |