Skip to content

Instantly share code, notes, and snippets.

@davist11
Last active January 22, 2022 14:35
Show Gist options
  • Select an option

  • Save davist11/129038286f04bc5e2941baae32ee509e to your computer and use it in GitHub Desktop.

Select an option

Save davist11/129038286f04bc5e2941baae32ee509e to your computer and use it in GitHub Desktop.
Remix + Craft Live Preview
import { json } from 'remix'
import { gql } from 'graphql-request'
import { gqlClient } from '~/helpers/graphql.server'
export const loader = async ({ request }) => {
const { entries } = await gqlClient(request).request(gql`
{
GRAPHQL_REQUEST_HERE
}
`)
return json({ entries })
}
<?php
return [
'*' => [
'headlessMode' => true,
'previewIframeResizerOptions' => [
'checkOrigin' => [
'https://www.trevor-davis.com',
],
],
],
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment