@hongminhee@hollo.social

I've been thinking about client-server interactions in the . isn't widely used, and most clients rely on Mastodon-compatible APIs instead.

What if we created a new standardized API based on GraphQL + Relay for client-server communication, while keeping ActivityPub for server-to-server federation?

The Mastodon-compatible API lacks formal schema definitions for code generation and type checking, which hurts developer productivity. And ActivityPub C2S is honestly too cumbersome to use directly from client apps.

would give us type safety, efficient data fetching (only get what you need), and the ability to evolve the API without breaking clients. 's features for pagination, caching, and optimistic updates seem perfect for social apps.

Would this be valuable to our community? What challenges do you see? How might we handle backward compatibility? And should this be formalized as an FEP?

Curious what others think about this approach.

relay.dev

Relay

8 replies

@silverpill@mitra.social · Reply to 洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee

Non-ActivityPub APIs should be domain-specific. We already have good APIs designed by domain experts (Mastdon API, Lemmy API, etc), and I don't think there is much room for improvement.

The standardized / universal client API should be based on ActivityPub C2S, because only then it can offer major improvements that domain-specific APIs don't offer.

@charlag@birb.site · Reply to 洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee I feel like graphql did not really deliver. it is also generally hard to predict the load with graphql and it adds a bunch of complexity.

it would be great if client API was not just half-documented masto API but something else but it also is preeeetty stable and the schemas were written many times over

@thisismissem@hachyderm.io · Reply to 洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee I think it goes beyond that: if C2S was actually useful for building applications & didn't require heavy processing on the client, then it'd likely be more used.

But it doesn't define like "give me a chronological feed of all incoming posts" or "give me a chronological feed of all my notifications" or "give me all my follow requests that I haven't accepted or rejected"

Those are application concerns, which to implement with current C2S would mean fetching the entire inbox and/or outbox collection and filtering/reducing that dataset.

The consequence is that you inherently end up with either a backend for frontend (custom API / AppView) or a very heavy and potentially slow client application.