Bootstrapped using create-next-app
Create
src/data/globals.ts favicon
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
groqd playground page builder query:
import { runQuery } from "playground";
import { q } from "groqd";
const pricingSectionGroqd = {
"_type == 'pricingSection'": {
_type: q.literal("pricingSection"),
heading: q.string(),
description: q.string().nullable(),
priceCards: q("priceCards")
.filter()
.grab$({
name: q.string(),
description: q.string(),
features: q.array(q.string()).nullable(),
priceFrequency: q.string(),
price: q.string(),
cta: q("cta").grab({
label: q.string(),
url: q.string(),
}),
terms: q.string(),
}),
},
};
const pageBuilder = {
pageBuilder: q("coalesce(pageBuilder, [])")
.filter()
.grab(
{
_key: q.string(),
},
{
...pricingSectionGroqd,
}
),
};
runQuery(
q("*")
.filter("_type == 'service'")
.slice(0, 10)
.grab$({
_id: q.string(),
...pageBuilder
}),
// params (optional)
{}
);