Skip to content

Docs: added "Cheat Sheet" #392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft

Docs: added "Cheat Sheet" #392

wants to merge 13 commits into from

Conversation

scottrippey
Copy link
Member

@scottrippey scottrippey commented May 30, 2025

Adds a "Cheat Sheet".
This document was copied from Sanity's own Cheat Sheet docs and adapted for GroqD.

Testing

Review this doc here:

https://groqd-git-cheat-sheet-formidable-labs.vercel.app/docs/API/groqd-cheat-sheet

TODO:

  • Organize better via frontmatter
  • Consider eliminating irrelevant examples (eg. all the raw)

Copy link

changeset-bot bot commented May 30, 2025

⚠️ No Changeset found

Latest commit: 0e41a51

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented May 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
groqd ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 2, 2025 9:05pm

.filterRaw('count((categories[]->slug.current)[@ in ["action", "thriller"]]) > 0') // documents that reference categories with slugs of "action" or "thriller"
.filterRaw('count((categories[]->slug.current)[@ in ["action", "thriller"]]) == 2') // documents that reference categories with slugs of "action" and "thriller"
.filterRaw('defined(awardWinner)') // has been assigned an award winner status (any kind of value)
.filterRaw('!defined(awardWinner)') // has not been assigned an award winner status (any kind of value)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking for feedback on something …

This file is a copy of Sanity’s “GROQ Cheat Sheet” page, which has a lot of examples of GROQ queries.

I’m really happy with showing this ton of examples. But one concern is that a lot of these Sanity examples are “edge cases” and so I’m forced to wrap a lot of them with .raw or .filterRaw.

Should I leave these examples in there, so that I have 1:1 parity with the Sanity docs? Or should I remove/minimize them, so that this doc is focused on just GroqD examples?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant