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

spec: JSON:API Graphs #9073

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

spec: JSON:API Graphs #9073

wants to merge 16 commits into from

Conversation

runspired
Copy link
Contributor

@runspired runspired commented Oct 30, 2023

As EmberData builds out its JSON:API support and Schema driven behaviors, we've noticed that some useful capabilities are less usable by JSON:API users due to that spec not yet considering the overall ergonomics of querying and consuming graphs.

This adds a specification with an extension and profile that APIs may implement to make use of these capabilities.

Rendered

# if ceo is an employee and something else
# also declares fields for an employee, the
# field sets will be merged
profileImage

Choose a reason for hiding this comment

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

for exclusion could do something like:

{
  -name
}

and if the only fields are exclusion fields in the brackets ({}) then you receive all fields minus excludes. You may not mix included and excluded fields.

@vlascik
Copy link

vlascik commented Feb 26, 2024

Great idea, JSON:API needs this.

IMO though, for a query language to be really useful it should also contain comparison operators, such as:

eq (equals)
neq (not equals)
gt (greater than)
lt (less than)
gte (greater than or equal to)
lte (less than or equal to), 
in (list)
not_in (list), 
contains (string) or like

and perhaps some basic grouping and logic (and, or, not) as in https://dgraph.io/docs/graphql/queries/and-or-not/ or https://hasura.io/docs/latest/queries/postgres/filters/boolean-operators/
and maybe even aggregate functions (sum, avg, min, max) as in https://dgraph.io/docs/graphql/queries/aggregate/
and multi-field ordering (order_by: ['date': 'desc', 'name': 'asc'], or something similar to https://dgraph.io/docs/graphql/queries/order-page/

@runspired runspired marked this pull request as draft April 6, 2024 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Planning
Development

Successfully merging this pull request may close these issues.

None yet

3 participants