Bonfire.Me.API.GraphQLMasto.Adapter (Bonfire v1.0.1-social-alpha.28)

View Source

Account/User related API endpoints for Mastodon-compatible client apps.

This adapter handles:

  • User profile queries (GET /api/v1/accounts/:id, /api/v1/accounts/verify_credentials)
  • Follow/unfollow actions
  • Followers/following lists with batch-loaded stats
  • Account relationships

User → Mastodon Account transformation is delegated to Mappers.Account.

Summary

Functions

Accept/authorize a follow request (POST /api/v1/follow_requests/:account_id/authorize)

Follow an account

List incoming follow requests (GET /api/v1/follow_requests)

List outgoing follow requests (GET /api/v1/follow_requests/outgoing)

List followers of an account

List accounts that an account is following

Lookup an account by webfinger address. Mastodon API: GET /api/v1/accounts/lookup?acct=username or acct=username@domain

Get the current user's profile (verify_credentials)

Reject a follow request (POST /api/v1/follow_requests/:account_id/reject)

Get relationships between the current user and given accounts. Mastodon API: GET /api/v1/accounts/relationships?id[]=1&id[]=2

Search for accounts by username or display name. Mastodon API: GET /api/v1/accounts/search?q=query

Get suggested accounts to follow.

Unfollow an account

Update the authenticated user's profile. Mastodon API: PATCH /api/v1/accounts/update_credentials

Get a user profile by filter (id, username, etc)

Functions

authorize_follow_request(account_id, conn)

Accept/authorize a follow request (POST /api/v1/follow_requests/:account_id/authorize)

follow_account(map, conn)

Follow an account

follow_requests(params, conn)

List incoming follow requests (GET /api/v1/follow_requests)

follow_requests_outgoing(params, conn)

List outgoing follow requests (GET /api/v1/follow_requests/outgoing)

followers(account_id, params, conn)

List followers of an account

following(account_id, params, conn)

List accounts that an account is following

get_preferences(params \\ %{}, conn)

Get user preferences

graphql(conn_or_socket, name \\ nil, params \\ %{})

liveql(socket, name \\ nil, params \\ %{})

lookup_account(params, conn)

Lookup an account by webfinger address. Mastodon API: GET /api/v1/accounts/lookup?acct=username or acct=username@domain

me(params \\ %{}, conn)

Get the current user's profile (verify_credentials)

reject_follow_request(account_id, conn)

Reject a follow request (POST /api/v1/follow_requests/:account_id/reject)

relationships(params, conn)

Get relationships between the current user and given accounts. Mastodon API: GET /api/v1/accounts/relationships?id[]=1&id[]=2

search_accounts(params, conn)

Search for accounts by username or display name. Mastodon API: GET /api/v1/accounts/search?q=query

suggestions(params, conn)

Get suggested accounts to follow.

Mastodon API v2: GET /api/v2/suggestions

Returns accounts from the curated "Suggested Profiles" circle maintained by admins/mods. Falls back to discoverable users from the local instance if the circle is empty.

Parameters

  • limit - Maximum number of suggestions to return (default: 40, max: 80)

See: https://docs.joinmastodon.org/methods/suggestions/#v2

unfollow_account(map, conn)

Unfollow an account

update_credentials(params, conn)

Update the authenticated user's profile. Mastodon API: PATCH /api/v1/accounts/update_credentials

user(params, conn)

Get a user profile by filter (id, username, etc)