Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Tracking Issue for deficiencies vs. GraphQL #1272

@wycats

Description

@wycats

In principle, JSON:API describes a very similar data and querying model to GraphQL.

  • unlike traditional REST, both GraphQL and JSON:API send more than one entity in a single response.
  • both GraphQL and JSON:API model the backend data as a single "graph in the sky"
  • both GraphQL and JSON:API support "sparse fieldsets", to allow granularly fetching only the fields you need
  • both GraphQL and JSON:API support fetching related entities on demand in the query

But there are a number of areas where JSON:API is behind. In most cases, there has been some activity on this repo to try to address it, but not much recent traction:

  • Deep querying. We support sparse fieldsets and granular includes, but don't specify how to target fields nested in a relationship, or how to target sorting, paging and filtering at the contents of a relationship.
  • Some solution for "mutations" that is more flexible. Maybe operations is sufficient, but something like RPC-style mutations or sideposting are probably necessary to make it feel ergonomic. At minimum, RPC-style mutations are a nice escape valve.
  • A built in way to describe types/schema. There are various community solutions for this, but nothing recommended by JSON:API.
  • API exploration out of the box (GraphiQL). This probably required more introspection capabilities, and dovetails with the schema goal.

Not all of these necessarily need to be in the base spec; some could be official recommendations or part of a profile designed for better toolability. The base spec would then become a basis for tools operating against the protocol, while the enhanced protocol would be the basis for zero-config client-side ORM-like tools.

However we do it, we have a strong need to improve deficiencies of JSON:API relative to GraphQL, and I think that we should focus some energy on closing those gaps.

I'm opening this thread to collect feedback from the community about prioritization of features on this list (which features would most help you as a GraphQL user) as well as to collect other use-cases that make JSON:API seem inferior to GraphQL that I've missed in my initial pass.

For a more free-wheeling conversation, I suggest http://discuss.jsonapi.org 😄

Please also feel free to link to other issues in this repository, and I'll link them up in the list above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions