TryGhost / TryGhost/NQL

Support for filtering empty and not empty relations

Open
#44 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
JavaScript
Stars
7
Forks
7
Avg merge
9h 4m
Merged PRs (30d)
22

Description

Problem

In Ghost we want to be able to filter posts that have tags, or do not have tags.

Solution

IMO the syntax should be filter=tags:null or filter=tags:-null.

This doesn't cause an error, but it also doesn't do what you'd expect.

filter=tags:null - should return all posts with no tags
filter=tags:-null - should return all posts with at least one tag

Alternatively it could perhaps be done by supporting filtering on counts e.g.

filter=count.tags:0
filter=count.tags:>0

But this I think is a lot less intuitive.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named in the issue. Start by locating NQL's relation-filter parsing and query generation, then determine how null and negated-null filters are represented; done means filters for posts with no tags and with at least one tag return the expected sets, with coverage for the chosen syntax.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.