Skip to content
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

Feature: Simplified APIs #351

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

Feature: Simplified APIs #351

wants to merge 23 commits into from

Conversation

scottrippey
Copy link
Member

@scottrippey scottrippey commented Feb 14, 2025

We removed irrelevant methods from the root q object, and from query chains.
This improves auto-complete and API discoverability, and reduces confusion.

  • The root q object no longer exposes irrelevant chaining methods.
    • E.g. we removed: q.filter(...), q.deref(), q.field(...), etc.
  • Query chains no longer expose irrelevant top-level utilities.
    • E.g. we removed (chain).star, (chain).conditional(...), (chain).select(...), (chain).value(...), etc.
  • The subquery in a projection no longer exposes irrelevant chaining methods.
    • E.g. with .project(sub => ({ ... })) we removed: sub.filter(...), sub.order(...), etc.

Backwards compatibility: we only removed methods that created invalid GROQ queries,
so this change should be backwards compatible.

Testing

This is fully covered by unit tests.

Copy link

changeset-bot bot commented Feb 14, 2025

🦋 Changeset detected

Latest commit: 7d2419f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
groqd Minor
website Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

vercel bot commented Feb 14, 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 Feb 15, 2025 7:21am

@scottrippey scottrippey changed the title Feature: trimmed API Feature: Simplified APIs Feb 15, 2025
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